Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Code Snippets Not Working In VS 2012

$
0
0

I'm developing a language service that supports code snippets.  I can insert snippets without any problems in VS 2010, but when I try to insert snippets in VS 2012, it comes up with an empty expansion browser.  I do see the snippets listed in the Code Snippets Manager on the Tools menu, so Visual Studio is clearly finding the snippet files but possibly not associating them with my language service.  My code to invoke the expansion browser is as follows:

// Handle the Insert Snippet command by showing the UI to insert a snippet.
ExpansionProvider ep = GetExpansionProvider();
if (ep != null && TextView != null)
{
    ep.DisplayExpansionBrowser(TextView, "CMake Snippet", null,
        false, null, false);
}

My code to associate the code snippets with the language service is as follows:

[ProvideLanguageCodeExpansion(typeof(CMakeLanguageService), "CMake", 102, "CMake",
    @"%InstallRoot%\CMake\Snippets\%LCID%\SnippetsIndex.xml",
    SearchPaths = @"%InstallRoot%\CMake\Snippets\%LCID%\Snippets\")]

Does anyone know what might be causing this?  Thank you very much.

Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>