Skip to content

Commit

Permalink
Intellisense: Move Keywords to Keywords-Tab in Intellisense list
Browse files Browse the repository at this point in the history
Model:Store "Using static" in a separate list
  • Loading branch information
fforay committed May 24, 2017
1 parent fe303b7 commit 9fd63be
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 6 deletions.
Binary file removed External/Debug/XSharp.CodeAnalysis.VS.pdb
Binary file not shown.
Binary file removed External/Release/XSharp.CodeAnalysis.VS.pdb
Binary file not shown.
29 changes: 29 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<configuration>
<packageRestore>
<!-- Currently, the repository's version of NuGet.exe and Visual Studio's version
fight over the format of project.lock.json because the one in the respository
is newer. To prevent that, turn off package restore. -->
<add key="automatic" value="false" />
</packageRestore>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<clear />
<add key="dotnet.myget.org dotnet-coreclr" value="https://dotnet.myget.org/F/dotnet-coreclr/api/v3/index.json" />
<add key="dotnet.myget.org dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="dotnet.myget.org dotnet-corefxtestdata" value="https://dotnet.myget.org/F/dotnet-corefxtestdata/api/v3/index.json" />
<add key="dotnet.myget.org dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="dotnet.myget.org symreader" value="https://dotnet.myget.org/F/symreader/api/v3/index.json" />
<add key="dotnet.myget.org symreader-portable" value="https://dotnet.myget.org/F/symreader-portable/api/v3/index.json" />
<add key="dotnet.myget.org interactive-window" value="https://dotnet.myget.org/F/interactive-window/api/v3/index.json" />
<add key="dotnet.myget.org roslyn-master-nightly" value="https://dotnet.myget.org/F/roslyn-master-nightly/api/v3/index.json" />
<add key="dotnet.myget.org devcore" value="https://www.myget.org/F/vs-devcore/api/v3/index.json" />
<add key="dotnet.myget.org roslyn-tools" value = "https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
<add key="dotnet.myget.org roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
<add key="myget.org vs-editor" value="https://myget.org/F/vs-editor/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
13 changes: 8 additions & 5 deletions VisualStudio/ProjectPackage/Editors/XSharpCompletionSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
}
// The Completion list we are building
CompletionList compList = new CompletionList();
CompletionList kwdList = new CompletionList();
// The CompletionType we will use to fill the CompletionList
CompletionType cType = null;
// Start of Process
Expand Down Expand Up @@ -244,7 +245,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
// we should also walk all the USINGs, and the current Namespace if any, to search Types
AddTypeNames(compList, file.Project, filterText, Usings);
//
AddXSharpTypesTypeNames(compList, filterText);
AddXSharpTypesTypeNames(kwdList, filterText);
break;
case XSharpLexer.IMPLEMENTS:
// It can be a namespace
Expand All @@ -258,7 +259,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
// we should also walk all the USINGs, and the current Namespace if any, to search Types
AddTypeNames(compList, file.Project, filterText, Usings);
//
AddXSharpTypesTypeNames(compList, filterText);
AddXSharpTypesTypeNames(kwdList, filterText);
// it can be a static Method/Property/Enum
if (cType != null)
{
Expand Down Expand Up @@ -330,7 +331,7 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
// we should also walk all the USINGs, and the current Namespace if any, to search Types
AddTypeNames(compList, file.Project, filterText, Usings);
//
AddXSharpTypesTypeNames(compList, filterText);
AddXSharpTypesTypeNames(kwdList, filterText);
break;
case XSharpLexer.IMPLEMENTS:
// It can be a namespace
Expand All @@ -349,17 +350,19 @@ public void AugmentCompletionSession(ICompletionSession session, IList<Completio
// and Types
AddTypeNames(compList, file.Project, filterText, Usings);
//
AddXSharpTypesTypeNames(compList, filterText);
AddXSharpTypesTypeNames(kwdList, filterText);
break;
}
}
break;
}

// Sort in alphabetical order
compList.Sort((comp1, comp2) => comp1.DisplayText.CompareTo(comp2.DisplayText));
kwdList.Sort((comp1, comp2) => comp1.DisplayText.CompareTo(comp2.DisplayText));
// and put in the SelectionList
completionSets.Add(new CompletionSet("All", "All", applicableTo, compList, Enumerable.Empty<Completion>()));
if( kwdList.Count > 0 )
completionSets.Add(new CompletionSet("Keywords", "Keywords", applicableTo, kwdList, Enumerable.Empty<Completion>()));
}

private void AddTypeNames(CompletionList compList, XProject project, string startWith, HashSet<String> usings)
Expand Down
1 change: 1 addition & 0 deletions VisualStudio/ProjectPackage/Editors/XSharpQuickInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiC
{
currentNS = currentNamespace.Name;
}

XSharpModel.CompletionType cType = XSharpLanguage.XSharpTokenTools.RetrieveType(fileName, tokenList, member, currentNS, stopToken, out gotoElement);
//
//
Expand Down
5 changes: 4 additions & 1 deletion VisualStudio/XSharpModel/ModelParser/XSharpModelDiscover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,10 @@ public override void EnterUsing_([NotNull] XSharpParser.Using_Context context)
if (this.BuildModel)
{
XSharpParser.Using_Context use = (XSharpParser.Using_Context)context;
this._file.Usings.AddUnique(use.Name?.GetText());
if ( use.Static == null)
this._file.Usings.AddUnique(use.Name?.GetText());
else
this._file.UsingStatics.AddUnique(use.Name?.GetText());
}
}

Expand Down
11 changes: 11 additions & 0 deletions VisualStudio/XSharpModel/XFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace XSharpModel
public class XFile
{
private List<String> _usings;
private List<String> _usingStatics;
private string filePath;
private Dictionary<string, XType> _typeList;
private XType _globalType;
Expand All @@ -31,6 +32,7 @@ public XFile(string fullPath)
{
// TODO: Change to support Case Sensitive types
_usings = new List<string>();
_usingStatics = new List<string>();
this.filePath = fullPath;
_xaml = System.IO.Path.GetExtension(fullPath).ToLower() == ".xaml";
//
Expand Down Expand Up @@ -88,6 +90,15 @@ public List<string> Usings

}

public List<string> UsingStatics
{
get
{
return _usingStatics;
}

}

public Dictionary<string, XType> TypeList
{
get
Expand Down
Binary file added nuget.exe
Binary file not shown.

0 comments on commit 9fd63be

Please sign in to comment.