How to use the Visual Studio 2022 snippet index files?
Hello,
I am trying to create some snippets for a language for which there is no VS 2022 Language Service registered. I am using the following steps:
In the VS 2022 extension *pkgdef file I include the following entry where I point to the snippet index file:
[$RootKey$\Languages\CodeExpansions\Lang-Java]
@="{JavaSnippets-GUID}"
"Package"="{Package-GUID}"
"DisplayName"="0"
"LangStringID"="Java"
"IndexPath"="$PackageFolder$\TestVsix\Snippets\Java\Snippets.xml"
"ShowRoots"=dword:00000000
The "Snippets.xml" file looks like:
<?xml version="1.0" encoding="utf-8" ?>
<SnippetCollection>
<Language Lang="Test-Java" Guid="{JavaSnippets-GUID}">
<SnippetDir>
<OnOff>On</OnOff>
<Installed>true</Installed>
<Locale>1033</Locale>
<DirPath>TestSnippets\</DirPath>
<LocalizedName>Test</LocalizedName>
</SnippetDir>
</Language>
</SnippetCollection>
I was expecting that my snippets that exist in the $PackageFolder$\TestVsix\Snippets\Java\TestSnippets
directory to be automatically picked by Visual Studio 2022, but that does not happen until I add the following entry to the *.pkgdef file:
[$RootKey$\Languages\CodeExpansions\Lang-Java\Paths]
"Test"="$PackageFolder$\TestVsix\Snippets\Java\TestSnippets\"
What needs to be done for the snippets to be registered with Visual Studio 2022 just by using the snippets index file and by removing the above entry?