Hello,
We are making the following change for the next build 402:
Updated the virtual CodeSnippetSelectionSession.OnCompletionSessionInitializing method to perform sorting and be called after items have been added to the session, so that completion items and/or sorting can be customized prior to opening.
The idea is that you can make a custom class that inherits CodeSnippetSelectionSession and override its OnCompletionSessionInitializing method to call session.SortItems(yourcustomcomparer).
To get a custom CodeSnippetSelectionSession class in place, you will have to also make a class that inherits CodeSnippetProvider and override the CreateSelectionSession method. Here's the default implementation:
protected virtual ICodeSnippetSelectionSession CreateSelectionSession(ICodeSnippetFolder rootFolder, CodeSnippetTypes snippetType) {
var session = new CodeSnippetSelectionSession();
session.Label = SR.GetString(snippetType == CodeSnippetTypes.SurroundsWith ?
SRName.UIIntelliPromptCodeSnippetSelectorSurroundWithText : SRName.UIIntelliPromptCodeSnippetSelectorInsertSnippetText);
session.RootFolder = rootFolder;
return session;
}
Your override would need to do the same thing but create your custom CodeSnippetSelectionSession class instead.