├── art ├── guids-ids.gif ├── guidSHLMainMenu.png ├── knownmonikers.gif └── raw menus │ ├── Build.png │ ├── Debug.png │ ├── Edit.png │ ├── File.png │ ├── Git.png │ ├── Help.png │ ├── Test.png │ ├── Tools.png │ ├── View.png │ ├── Xml.png │ ├── Analyze.png │ ├── Project.png │ ├── Window.png │ ├── CodeWindow.png │ ├── Extensions.png │ ├── FolderNode.png │ ├── ItemNode.png │ ├── ProjectNode.png │ ├── SolutionNode.png │ ├── MainMenuToolbar.png │ └── SolutionFolder.png ├── src ├── VsctCompletion2019 │ ├── Resources │ │ ├── Icon.png │ │ ├── menus │ │ │ ├── Build.png │ │ │ ├── Debug.png │ │ │ ├── Edit.png │ │ │ ├── File.png │ │ │ ├── Git.png │ │ │ ├── Help.png │ │ │ ├── Test.png │ │ │ ├── Tools.png │ │ │ ├── View.png │ │ │ ├── Xml.png │ │ │ ├── Analyze.png │ │ │ ├── Project.png │ │ │ ├── Window.png │ │ │ ├── CodeWindow.png │ │ │ ├── Extensions.png │ │ │ ├── FolderNode.png │ │ │ ├── ItemNode.png │ │ │ ├── ProjectNode.png │ │ │ ├── SolutionNode.png │ │ │ ├── MainMenuToolbar.png │ │ │ ├── SolutionFolder.png │ │ │ └── SolutionNode.AddGroup.png │ │ └── VSGlobals.vsct │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── source.extension.cs │ ├── source.extension.vsixmanifest │ └── VsctCompletion2019.csproj ├── VsctCompletion2022 │ ├── Resources │ │ ├── Icon.png │ │ ├── menus │ │ │ ├── Build.png │ │ │ ├── Debug.png │ │ │ ├── Edit.png │ │ │ ├── File.png │ │ │ ├── Git.png │ │ │ ├── Help.png │ │ │ ├── Test.png │ │ │ ├── Tools.png │ │ │ ├── View.png │ │ │ ├── Xml.png │ │ │ ├── Analyze.png │ │ │ ├── Project.png │ │ │ ├── Window.png │ │ │ ├── CodeWindow.png │ │ │ ├── Extensions.png │ │ │ ├── FolderNode.png │ │ │ ├── ItemNode.png │ │ │ ├── ProjectNode.png │ │ │ ├── SolutionNode.png │ │ │ ├── MainMenuToolbar.png │ │ │ ├── SolutionFolder.png │ │ │ └── SolutionNode.AddGroup.png │ │ └── VSGlobals.vsct │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── source.extension.cs │ ├── source.extension.vsixmanifest │ └── VsctCompletion2022.csproj └── VsctCompletionShared │ ├── Completion │ ├── Providers │ │ ├── ICompletionProvider.cs │ │ ├── KnownMonikersList.cs │ │ ├── EditorProvider.cs │ │ ├── HrefProvider.cs │ │ ├── GuidSymbolIdProvider.cs │ │ ├── GuidSymbolProvider.cs │ │ └── KnownIdList.cs │ ├── VsctCompletionSourceProvider.cs │ ├── VsctCompletionSource.cs │ └── VsctParser.cs │ ├── ContentTypes │ └── VsctContentTypeDefinition.cs │ ├── VsctCompletionShared.shproj │ ├── QuickInfo │ ├── IdQuickInfoProvider.cs │ └── IdQuickInfoSource.cs │ ├── GoToDifinition │ ├── VsctGoToDefinitionCreationListener.cs │ └── VsctGoToDefinitionCommandHandler.cs │ ├── VsctCompletionShared.projitems │ └── ExtensionMethods.cs ├── LICENSE ├── appveyor.yml ├── README.md ├── .gitattributes ├── VsctCompletion.sln ├── .editorconfig └── .gitignore /art/guids-ids.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/guids-ids.gif -------------------------------------------------------------------------------- /art/guidSHLMainMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/guidSHLMainMenu.png -------------------------------------------------------------------------------- /art/knownmonikers.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/knownmonikers.gif -------------------------------------------------------------------------------- /art/raw menus/Build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Build.png -------------------------------------------------------------------------------- /art/raw menus/Debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Debug.png -------------------------------------------------------------------------------- /art/raw menus/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Edit.png -------------------------------------------------------------------------------- /art/raw menus/File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/File.png -------------------------------------------------------------------------------- /art/raw menus/Git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Git.png -------------------------------------------------------------------------------- /art/raw menus/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Help.png -------------------------------------------------------------------------------- /art/raw menus/Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Test.png -------------------------------------------------------------------------------- /art/raw menus/Tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Tools.png -------------------------------------------------------------------------------- /art/raw menus/View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/View.png -------------------------------------------------------------------------------- /art/raw menus/Xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Xml.png -------------------------------------------------------------------------------- /art/raw menus/Analyze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Analyze.png -------------------------------------------------------------------------------- /art/raw menus/Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Project.png -------------------------------------------------------------------------------- /art/raw menus/Window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Window.png -------------------------------------------------------------------------------- /art/raw menus/CodeWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/CodeWindow.png -------------------------------------------------------------------------------- /art/raw menus/Extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/Extensions.png -------------------------------------------------------------------------------- /art/raw menus/FolderNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/FolderNode.png -------------------------------------------------------------------------------- /art/raw menus/ItemNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/ItemNode.png -------------------------------------------------------------------------------- /art/raw menus/ProjectNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/ProjectNode.png -------------------------------------------------------------------------------- /art/raw menus/SolutionNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/SolutionNode.png -------------------------------------------------------------------------------- /art/raw menus/MainMenuToolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/MainMenuToolbar.png -------------------------------------------------------------------------------- /art/raw menus/SolutionFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/art/raw menus/SolutionFolder.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/Icon.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/Icon.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Build.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Debug.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Edit.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/File.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Git.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Help.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Test.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Tools.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/View.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Xml.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Build.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Debug.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Edit.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/File.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Git.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Help.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Test.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Tools.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/View.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Xml.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Analyze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Analyze.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Project.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Window.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Analyze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Analyze.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Project.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Window.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/CodeWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/CodeWindow.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/Extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/Extensions.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/FolderNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/FolderNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/ItemNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/ItemNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/CodeWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/CodeWindow.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/Extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/Extensions.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/FolderNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/FolderNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/ItemNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/ItemNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/ProjectNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/ProjectNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/SolutionNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/SolutionNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/ProjectNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/ProjectNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/SolutionNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/SolutionNode.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/MainMenuToolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/MainMenuToolbar.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/SolutionFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/SolutionFolder.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/MainMenuToolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/MainMenuToolbar.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/SolutionFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/SolutionFolder.png -------------------------------------------------------------------------------- /src/VsctCompletion2019/Resources/menus/SolutionNode.AddGroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2019/Resources/menus/SolutionNode.AddGroup.png -------------------------------------------------------------------------------- /src/VsctCompletion2022/Resources/menus/SolutionNode.AddGroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madskristensen/VsctIntellisense/HEAD/src/VsctCompletion2022/Resources/menus/SolutionNode.AddGroup.png -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/Providers/ICompletionProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml; 4 | using System.Xml.XPath; 5 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; 6 | 7 | namespace VsctCompletion.Completion.Providers 8 | { 9 | internal interface ICompletionProvider 10 | { 11 | IEnumerable GetCompletions(XmlDocument doc, XPathNavigator navigator, Func CreateCompletionItem); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017 Mads Kristensen 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /src/VsctCompletion2019/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using VsctCompletion; 5 | 6 | [assembly: AssemblyTitle(Vsix.Name)] 7 | [assembly: AssemblyDescription(Vsix.Description)] 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyCompany(Vsix.Author)] 10 | [assembly: AssemblyProduct(Vsix.Name)] 11 | [assembly: AssemblyCopyright(Vsix.Author)] 12 | [assembly: AssemblyTrademark("")] 13 | [assembly: AssemblyCulture("")] 14 | 15 | [assembly: ComVisible(false)] 16 | 17 | [assembly: AssemblyVersion(Vsix.Version)] 18 | [assembly: AssemblyFileVersion(Vsix.Version)] 19 | -------------------------------------------------------------------------------- /src/VsctCompletion2022/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using VsctCompletion; 5 | 6 | [assembly: AssemblyTitle(Vsix.Name)] 7 | [assembly: AssemblyDescription(Vsix.Description)] 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyCompany(Vsix.Author)] 10 | [assembly: AssemblyProduct(Vsix.Name)] 11 | [assembly: AssemblyCopyright(Vsix.Author)] 12 | [assembly: AssemblyTrademark("")] 13 | [assembly: AssemblyCulture("")] 14 | 15 | [assembly: ComVisible(false)] 16 | 17 | [assembly: AssemblyVersion(Vsix.Version)] 18 | [assembly: AssemblyFileVersion(Vsix.Version)] 19 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/ContentTypes/VsctContentTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Utilities; 3 | 4 | namespace VsctCompletion.ContentTypes 5 | { 6 | public class VsctContentTypeDefinition 7 | { 8 | public const string VsctContentType = "VSCT"; 9 | 10 | [Export(typeof(ContentTypeDefinition))] 11 | [Name(VsctContentType)] 12 | [BaseDefinition("XML")] 13 | public ContentTypeDefinition IVsctContentType { get; set; } 14 | 15 | [Export(typeof(FileExtensionToContentTypeDefinition))] 16 | [ContentType(VsctContentType)] 17 | [FileExtension(".vsct")] 18 | public FileExtensionToContentTypeDefinition VsctFileExtension { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/Providers/KnownMonikersList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using Microsoft.VisualStudio.Imaging; 6 | 7 | namespace VsctCompletion.Completion.Providers 8 | { 9 | public class KnownMonikersList 10 | { 11 | // Use Lazy to defer reflection until first access and cache the result 12 | private static readonly Lazy> _knownMonikerNames = new(() => 13 | typeof(KnownMonikers) 14 | .GetProperties(BindingFlags.Static | BindingFlags.Public) 15 | .Select(p => p.Name) 16 | ); 17 | 18 | public static IEnumerable KnownMonikerNames => _knownMonikerNames.Value; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/VsctCompletion2019/source.extension.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace VsctCompletion 7 | { 8 | internal sealed partial class Vsix 9 | { 10 | public const string Id = "6c042f35-bf5c-4cf2-826e-05d6d12e5309"; 11 | public const string Name = "VSCT IntelliSense 2019"; 12 | public const string Description = @"Gives IntelliSense for .vsct files used by Visual Studio extension authors."; 13 | public const string Language = "en-US"; 14 | public const string Version = "1.0.2"; 15 | public const string Author = "Mads Kristensen"; 16 | public const string Tags = "vsix, vssdk, vsct"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/VsctCompletion2022/source.extension.cs: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ 2 | // 3 | // This file was generated by VSIX Synchronizer 4 | // 5 | // ------------------------------------------------------------------------------ 6 | namespace VsctCompletion 7 | { 8 | internal sealed partial class Vsix 9 | { 10 | public const string Id = "6c042f35-bf5c-4cf2-826e-05d6d12e5300"; 11 | public const string Name = "VSCT IntelliSense 2022"; 12 | public const string Description = @"Gives IntelliSense for .vsct files used by Visual Studio extension authors."; 13 | public const string Language = "en-US"; 14 | public const string Version = "1.0.2"; 15 | public const string Author = "Mads Kristensen"; 16 | public const string Tags = "vsix, vssdk, vsct"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2022 2 | 3 | install: 4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex 5 | 6 | before_build: 7 | - ps: Vsix-IncrementVsixVersion .\src\VsctCompletion2019\source.extension.vsixmanifest | Vsix-UpdateBuildVersion 8 | - ps: Vsix-IncrementVsixVersion .\src\VsctCompletion2022\source.extension.vsixmanifest 9 | - ps: Vsix-TokenReplacement src\VsctCompletion2019\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' 10 | - ps: Vsix-TokenReplacement src\VsctCompletion2022\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' 11 | 12 | build_script: 13 | - nuget restore -Verbosity quiet 14 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m 15 | 16 | after_test: 17 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VSCT file Intellisense 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/6e12lklt8i6uug41?svg=true)](https://ci.appveyor.com/project/madskristensen/vsctintellisense) 4 | 5 | Download the extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VsctIntellisense) or get the latest [CI build](http://vsixgallery.com/extension/6c042f35-bf5c-4cf2-826e-05d6d12e5309/) 6 | 7 | -------------------------------------- 8 | 9 | ## IntelliSense 10 | This extension provides IntelliSense for a guids, ids, monikers and other types to make it harder to make mistakes and easier to find the right values. 11 | 12 | ### Guids and IDs 13 | ![Guids and IDs](art/guids-ids.gif) 14 | 15 | ### guidSHLMainMenu values 16 | ![guidSHLMainMenu](art/guidSHLMainMenu.png) 17 | 18 | ### KnownMonikers 19 | ![KnownMonikers](art/knownmonikers.gif) 20 | 21 | ## License 22 | [Apache 2.0](LICENSE) -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/Providers/EditorProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml; 4 | using System.Xml.XPath; 5 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; 6 | 7 | namespace VsctCompletion.Completion.Providers 8 | { 9 | public class EditorProvider : ICompletionProvider 10 | { 11 | private static List _items; 12 | 13 | public IEnumerable GetCompletions(XmlDocument doc, XPathNavigator navigator, Func CreateCompletionItem) 14 | { 15 | if (_items == null) 16 | { 17 | _items = new List 18 | { 19 | CreateCompletionItem("GUID_TextEditorFactory", "Guid"), 20 | CreateCompletionItem("guidVSStd97", "Guid"), 21 | CreateCompletionItem("guidVSStd2K", "Guid"), 22 | }; 23 | } 24 | 25 | return _items; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/Providers/HrefProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml; 4 | using System.Xml.XPath; 5 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; 6 | 7 | namespace VsctCompletion.Completion.Providers 8 | { 9 | public class HrefProvider : ICompletionProvider 10 | { 11 | public IEnumerable GetCompletions(XmlDocument doc, XPathNavigator navigator, Func CreateCompletionItem) 12 | { 13 | if (navigator.LocalName == "Extern") 14 | { 15 | yield return CreateCompletionItem("stdidcmd.h", "Def"); 16 | yield return CreateCompletionItem("vsshlids.h", "Def"); 17 | } 18 | else if (navigator.LocalName == "Include") 19 | { 20 | yield return CreateCompletionItem("KnownImageIds.vsct", "KnownMonikers"); 21 | yield return CreateCompletionItem("VSGlobals.vsct", "Aliases"); 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/VsctCompletionShared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | e022858e-e475-44ce-8cdc-d673ed8d7f2c 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/QuickInfo/IdQuickInfoProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Text.Classification; 5 | using Microsoft.VisualStudio.Utilities; 6 | using VsctCompletion.ContentTypes; 7 | 8 | namespace VsctCompletion 9 | { 10 | [Export(typeof(IAsyncQuickInfoSourceProvider))] 11 | [Name(nameof(IdQuickInfoSourceProvider))] 12 | [ContentType(VsctContentTypeDefinition.VsctContentType)] 13 | [Order] 14 | internal sealed class IdQuickInfoSourceProvider : IAsyncQuickInfoSourceProvider 15 | { 16 | [Import] 17 | private IClassifierAggregatorService ClassifierService { get; set; } 18 | 19 | public IAsyncQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) 20 | { 21 | IClassifier classifier = ClassifierService.GetClassifier(textBuffer); 22 | 23 | // This ensures only one instance per textbuffer is created 24 | return textBuffer.Properties.GetOrCreateSingletonProperty(() => new IdQuickInfoSource(textBuffer, classifier)); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/VsctCompletion2019/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | VSCT IntelliSense 2019 6 | Gives IntelliSense for .vsct files used by Visual Studio extension authors. 7 | https://github.com/madskristensen/VsctIntellisense 8 | Resources\LICENSE 9 | Resources\Icon.png 10 | Resources\Icon.png 11 | vsix, vssdk, vsct 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/VsctCompletion2022/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | VSCT IntelliSense 2022 6 | Gives IntelliSense for .vsct files used by Visual Studio extension authors. 7 | https://github.com/madskristensen/VsctIntellisense 8 | Resources\LICENSE 9 | Resources\Icon.png 10 | Resources\Icon.png 11 | vsix, vssdk, vsct 12 | true 13 | 14 | 15 | 16 | amd64 17 | 18 | 19 | arm64 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/GoToDifinition/VsctGoToDefinitionCreationListener.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Editor; 2 | using Microsoft.VisualStudio.Shell; 3 | using Microsoft.VisualStudio.Text.Classification; 4 | using Microsoft.VisualStudio.Text.Editor; 5 | using Microsoft.VisualStudio.Text.Operations; 6 | using Microsoft.VisualStudio.TextManager.Interop; 7 | using Microsoft.VisualStudio.Utilities; 8 | using System; 9 | using System.ComponentModel.Composition; 10 | using VsctCompletion.ContentTypes; 11 | 12 | namespace VsctCompletion.GoToDifinition 13 | { 14 | [Export(typeof(IVsTextViewCreationListener))] 15 | [Name("VsctGoToDefinitionHandler")] 16 | [ContentType(VsctContentTypeDefinition.VsctContentType)] 17 | [TextViewRole(PredefinedTextViewRoles.Editable)] 18 | public class VsctGoToDefinitionCreationListener : IVsTextViewCreationListener 19 | { 20 | [Import(typeof(IVsEditorAdaptersFactoryService))] 21 | public IVsEditorAdaptersFactoryService AdapterService { get; set; } 22 | 23 | [Import(typeof(SVsServiceProvider))] 24 | public SVsServiceProvider ServiceProvider { get; set; } 25 | 26 | [Import(typeof(ITextStructureNavigatorSelectorService))] 27 | public ITextStructureNavigatorSelectorService NavigatorService { get; set; } 28 | 29 | [Import(typeof(IClassifierAggregatorService))] 30 | public IClassifierAggregatorService ClassifierAggregatorService { get; set; } 31 | 32 | public void VsTextViewCreated(IVsTextView textViewAdapter) 33 | { 34 | ITextView textView = AdapterService.GetWpfTextView(textViewAdapter); 35 | 36 | if (textView == null) 37 | { 38 | return; 39 | } 40 | 41 | Func createCommandHandler = () => new VsctGoToDefinitionCommandHandler(textViewAdapter, textView, this); 42 | textView.Properties.GetOrCreateSingletonProperty(createCommandHandler); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/VsctCompletionShared/VsctCompletionShared.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | e022858e-e475-44ce-8cdc-d673ed8d7f2c 7 | 8 | 9 | VsctCompletionShared 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/VsctCompletionSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.Composition; 3 | using Microsoft.VisualStudio; 4 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion; 5 | using Microsoft.VisualStudio.Shell.Interop; 6 | using Microsoft.VisualStudio.Shell; 7 | using Microsoft.VisualStudio.Text; 8 | using Microsoft.VisualStudio.Text.Classification; 9 | using Microsoft.VisualStudio.Text.Editor; 10 | using Microsoft.VisualStudio.Text.Operations; 11 | using Microsoft.VisualStudio.TextManager.Interop; 12 | using Microsoft.VisualStudio.Utilities; 13 | using VsctCompletion.ContentTypes; 14 | 15 | namespace VsctCompletion.Completion 16 | { 17 | [Export(typeof(IAsyncCompletionSourceProvider))] 18 | [Name("Chemical element dictionary completion provider")] 19 | [ContentType(VsctContentTypeDefinition.VsctContentType)] 20 | internal class VsctCompletionSourceProvider : IAsyncCompletionSourceProvider 21 | { 22 | [Import] 23 | private IClassifierAggregatorService ClassifierService { get; set; } 24 | 25 | [Import] 26 | private ITextStructureNavigatorSelectorService NavigatorService { get; set; } 27 | 28 | public IAsyncCompletionSource GetOrCreate(ITextView textView) 29 | { 30 | ITextBuffer buffer = textView.TextBuffer; 31 | var file = GetFileName(buffer); 32 | return textView.Properties.GetOrCreateSingletonProperty( 33 | () => new VsctCompletionSource(buffer, ClassifierService, NavigatorService, file) 34 | ); 35 | } 36 | 37 | public static string GetFileName(ITextBuffer buffer) 38 | { 39 | ThreadHelper.ThrowIfNotOnUIThread(); 40 | 41 | if (!buffer.Properties.TryGetProperty(typeof(IVsTextBuffer), out IVsTextBuffer bufferAdapter)) 42 | { 43 | return null; 44 | } 45 | 46 | string ppzsFilename = null; 47 | var returnCode = -1; 48 | 49 | if (bufferAdapter is IPersistFileFormat persistFileFormat) 50 | { 51 | try 52 | { 53 | returnCode = persistFileFormat.GetCurFile(out ppzsFilename, out var pnFormatIndex); 54 | } 55 | catch (NotImplementedException) 56 | { 57 | return null; 58 | } 59 | } 60 | 61 | if (returnCode != VSConstants.S_OK) 62 | { 63 | return null; 64 | } 65 | 66 | return ppzsFilename; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/ExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Runtime.InteropServices; 3 | using System.Threading.Tasks; 4 | using System.Windows.Media.Imaging; 5 | using Microsoft.VisualStudio; 6 | using Microsoft.VisualStudio.Imaging.Interop; 7 | using Microsoft.VisualStudio.PlatformUI; 8 | using Microsoft.VisualStudio.Shell; 9 | using Microsoft.VisualStudio.Shell.Interop; 10 | 11 | namespace VsctCompletion 12 | { 13 | public static class ExtensionMethods 14 | { 15 | /// 16 | /// Converts an ImageMoniker to a bitmap in the specified size. 17 | /// 18 | /// 19 | /// The background color matches the one in the current Visual Studio theme and changes 20 | /// dynamically with changes to the applied theme. 21 | /// 22 | /// 23 | /// 24 | /// BitmapSource bitmap = await KnownMonikers.Reference.ToBitmapSourceAsync(16); 25 | /// 26 | /// 27 | public static async Task ToBitmapSourceAsync(this ImageMoniker moniker, int size) 28 | { 29 | await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); 30 | 31 | IVsUIObject result = await ToUiObjectAsync(moniker, size); 32 | ErrorHandler.ThrowOnFailure(result.get_Data(out var data)); 33 | 34 | return data as BitmapSource; 35 | } 36 | 37 | /// 38 | /// Converts an ImageMoniker to an IVsUIObject in the specified size. 39 | /// 40 | public static async Task ToUiObjectAsync(this ImageMoniker moniker, int size) 41 | { 42 | await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); 43 | 44 | IVsImageService2 imageService = await AsyncServiceProvider.GlobalProvider.GetServiceAsync(); 45 | Color backColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey); 46 | 47 | var imageAttributes = new ImageAttributes 48 | { 49 | Flags = (uint)_ImageAttributesFlags.IAF_RequiredFlags | unchecked((uint)_ImageAttributesFlags.IAF_Background), 50 | ImageType = (uint)_UIImageType.IT_Bitmap, 51 | Format = (uint)_UIDataFormat.DF_WPF, 52 | Dpi = 96, 53 | LogicalHeight = size, 54 | LogicalWidth = size, 55 | Background = (uint)backColor.ToArgb(), 56 | StructSize = Marshal.SizeOf(typeof(ImageAttributes)) 57 | }; 58 | 59 | return imageService.GetImage(moniker, imageAttributes); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/QuickInfo/IdQuickInfoSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using System.Windows.Controls; 7 | using System.Windows.Media.Imaging; 8 | using Microsoft.VisualStudio.Language.Intellisense; 9 | using Microsoft.VisualStudio.Shell; 10 | using Microsoft.VisualStudio.Text; 11 | using Microsoft.VisualStudio.Text.Classification; 12 | using VsctCompletion.Completion; 13 | 14 | namespace VsctCompletion 15 | { 16 | internal sealed class IdQuickInfoSource(ITextBuffer buffer, IClassifier classifier) : IAsyncQuickInfoSource 17 | { 18 | // Cache for loaded images to avoid reloading 19 | private static readonly ConcurrentDictionary _imageCache = new(); 20 | 21 | // This is called on a background thread. 22 | public async Task GetQuickInfoItemAsync(IAsyncQuickInfoSession session, CancellationToken cancellationToken) 23 | { 24 | SnapshotPoint? triggerPoint = session.GetTriggerPoint(buffer.CurrentSnapshot); 25 | 26 | if (triggerPoint != null) 27 | { 28 | ITextSnapshotLine line = triggerPoint.Value.GetContainingLine(); 29 | // Use a for loop for better performance 30 | IList spans = classifier.GetClassificationSpans(line.Extent); 31 | ClassificationSpan attrValue = null; 32 | for (var i = 0; i < spans.Count; i++) 33 | { 34 | ClassificationSpan s = spans[i]; 35 | if (s.ClassificationType.IsOfType("XML Attribute Value") && s.Span.Contains(triggerPoint.Value.Position)) 36 | { 37 | attrValue = s; 38 | break; 39 | } 40 | } 41 | 42 | if (attrValue != null) 43 | { 44 | ITrackingSpan id = buffer.CurrentSnapshot.CreateTrackingSpan(attrValue.Span, SpanTrackingMode.EdgeInclusive); 45 | 46 | var fileName = VsctCompletionSource.GetFileName(attrValue.Span.GetText()); 47 | 48 | // Image exist 49 | if (!string.IsNullOrEmpty(fileName)) 50 | { 51 | await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); 52 | 53 | // Use cache to avoid reloading images 54 | var img = new Image 55 | { 56 | MaxHeight = 500, 57 | Source = _imageCache.GetOrAdd(fileName, fn => new BitmapImage(new Uri(fn))) 58 | }; 59 | 60 | return new QuickInfoItem(id, img); 61 | } 62 | } 63 | } 64 | 65 | return null; 66 | } 67 | 68 | public void Dispose() 69 | { 70 | // This provider does not perform any cleanup. 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /VsctCompletion.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31416.335 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VsctCompletion2019", "src\VsctCompletion2019\VsctCompletion2019.csproj", "{6C9D0BB1-8B90-4C82-B637-D3A63649F475}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{124DE484-A067-4A30-A80F-7E062D9ED742}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | appveyor.yml = appveyor.yml 12 | README.md = README.md 13 | EndProjectSection 14 | EndProject 15 | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "VsctCompletionShared", "src\VsctCompletionShared\VsctCompletionShared.shproj", "{E022858E-E475-44CE-8CDC-D673ED8D7F2C}" 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VsctCompletion2022", "src\VsctCompletion2022\VsctCompletion2022.csproj", "{6C9D0BB1-8B90-4C82-B637-D3A63649F476}" 18 | EndProject 19 | Global 20 | GlobalSection(SharedMSBuildProjectFiles) = preSolution 21 | src\VsctCompletionShared\VsctCompletionShared.projitems*{6c9d0bb1-8b90-4c82-b637-d3a63649f475}*SharedItemsImports = 4 22 | src\VsctCompletionShared\VsctCompletionShared.projitems*{6c9d0bb1-8b90-4c82-b637-d3a63649f476}*SharedItemsImports = 4 23 | src\VsctCompletionShared\VsctCompletionShared.projitems*{e022858e-e475-44ce-8cdc-d673ed8d7f2c}*SharedItemsImports = 13 24 | EndGlobalSection 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Debug|x86 = Debug|x86 28 | Release|Any CPU = Release|Any CPU 29 | Release|x86 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Debug|x86.ActiveCfg = Debug|x86 35 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Debug|x86.Build.0 = Debug|x86 36 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Release|x86.ActiveCfg = Release|x86 39 | {6C9D0BB1-8B90-4C82-B637-D3A63649F475}.Release|x86.Build.0 = Release|x86 40 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Debug|x86.ActiveCfg = Debug|x86 43 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Debug|x86.Build.0 = Debug|x86 44 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Release|x86.ActiveCfg = Release|x86 47 | {6C9D0BB1-8B90-4C82-B637-D3A63649F476}.Release|x86.Build.0 = Release|x86 48 | EndGlobalSection 49 | GlobalSection(SolutionProperties) = preSolution 50 | HideSolutionNode = FALSE 51 | EndGlobalSection 52 | GlobalSection(ExtensibilityGlobals) = postSolution 53 | SolutionGuid = {486D4C84-88D9-463D-B57A-507DF6C06C44} 54 | EndGlobalSection 55 | EndGlobal 56 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/Providers/GuidSymbolIdProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.Immutable; 4 | using System.Linq; 5 | using System.Xml; 6 | using System.Xml.XPath; 7 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion; 8 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; 9 | using Microsoft.VisualStudio.Text.Adornments; 10 | 11 | namespace VsctCompletion.Completion.Providers 12 | { 13 | public class GuidSymbolIdProvider : ICompletionProvider 14 | { 15 | private readonly IAsyncCompletionSource _source; 16 | private readonly ImageElement _icon; 17 | private static IEnumerable _knownIds, _knownMonikers; 18 | 19 | public GuidSymbolIdProvider(IAsyncCompletionSource source, ImageElement icon) 20 | { 21 | _source = source; 22 | _icon = icon; 23 | } 24 | 25 | public IEnumerable GetCompletions(XmlDocument doc, XPathNavigator navigator, Func CreateItem) 26 | { 27 | var list = new List(); 28 | 29 | var guid = navigator.GetAttribute("guid", ""); 30 | 31 | if (guid == "ImageCatalogGuid") 32 | { 33 | list.AddRange(GetKnownMonikers(_source, _icon)); 34 | } 35 | else if (guid == "guidSHLMainMenu") 36 | { 37 | list.AddRange(GetKnownIds(_source, _icon)); 38 | } 39 | else 40 | { 41 | XmlNodeList ids = doc.SelectNodes("//GuidSymbol[@name='" + guid + "']//IDSymbol"); 42 | 43 | foreach (XmlNode symbol in ids) 44 | { 45 | XmlAttribute name = symbol.Attributes["name"]; 46 | 47 | if (name != null) 48 | { 49 | CompletionItem item; 50 | if (guid.StartsWith("VS", StringComparison.Ordinal)) 51 | { 52 | var isMenu = name.Value.Trim('.').Count(c => c == '.') % 2 == 0; 53 | var typeName = isMenu ? "" : ""; 54 | item = CreateItem(name.Value, typeName); 55 | item.Properties.AddProperty("IsGlobal", true); 56 | } 57 | else { 58 | item = CreateItem(name.Value, ""); 59 | } 60 | 61 | list.Add(item); 62 | } 63 | } 64 | } 65 | 66 | return list; 67 | } 68 | 69 | private IEnumerable GetKnownMonikers(IAsyncCompletionSource source, ImageElement icon) 70 | { 71 | if (_knownMonikers == null) 72 | { 73 | var list = new List(); 74 | 75 | foreach (var name in KnownMonikersList.KnownMonikerNames) 76 | { 77 | var item = new CompletionItem(name, source, icon, ImmutableArray.Create(), "Image"); 78 | item.Properties.AddProperty("knownmoniker", name); 79 | list.Add(item); 80 | } 81 | 82 | _knownMonikers = list; 83 | } 84 | 85 | return _knownMonikers; 86 | } 87 | 88 | private IEnumerable GetKnownIds(IAsyncCompletionSource source, ImageElement icon) 89 | { 90 | if (_knownIds == null) 91 | { 92 | _knownIds = KnownIdList.KnownIds.Select(k => new CompletionItem(k, source, icon, ImmutableArray.Create(), "Group/Menu")); 93 | } 94 | 95 | return _knownIds; 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/VsctCompletionShared/Completion/Providers/GuidSymbolProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml; 4 | using System.Xml.XPath; 5 | using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; 6 | 7 | namespace VsctCompletion.Completion.Providers 8 | { 9 | public class GuidSymbolProvider : ICompletionProvider 10 | { 11 | public IEnumerable GetCompletions(XmlDocument doc, XPathNavigator navigator, Func CreateCompletionItem) 12 | { 13 | XmlNodeList guids = doc.SelectNodes("//GuidSymbol"); 14 | 15 | foreach (XmlNode node in guids) 16 | { 17 | XmlAttribute name = node.Attributes["name"]; 18 | 19 | if (name != null) 20 | { 21 | // Don't show results for VS* in