Following this link I have a set of code snippets.
But the snippet insertion has to be w.r.t the context, viz. if I do ‘Insert Snippet’ before declaring a class, it shouldn’t show ‘method declaration’ snippet.
Also required is to filter snippets as per managed or unmanaged code.
In short I am looking for a mechanism as follows:
if <condition>
{
modify list of snippets visible in the menu
}
Do we have such a mechanism or something similar? Ideas welcome.
I found a solution to my question. Hope it helps someone.
I followed the instructions on the links:
Video on Code Snippets &
Code Element
Got the snippet.xml file to contain the following:
Then called the expansionProvider.DisplayExpansionBrowser in the FilterView class (refer to the video):
Thus the specific snippet will appear in ‘method declaration’ context. Thus other snippets can be done. The xml has to hold the context information.