Skip to content

Commit

Permalink
Support isRecommended property for TS completion items
Browse files Browse the repository at this point in the history
Fixes #40325
  • Loading branch information
mjbvz committed Dec 16, 2017
1 parent 4913e7f commit d3decc7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extensions/typescript/src/features/completionItemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class MyCompletionItem extends CompletionItem {
) {
super(entry.name);
this.source = entry.source;
this.sortText = entry.sortText;

// Make sure isRecommended property always comes first
// https://github.com/Microsoft/vscode/issues/40325
this.sortText = entry.isRecommended ? '\0' : entry.sortText;

this.kind = MyCompletionItem.convertKind(entry.kind);
this.position = position;
this.commitCharacters = MyCompletionItem.getCommitCharacters(enableDotCompletions, !useCodeSnippetsOnMethodSuggest, entry.kind);
Expand Down

0 comments on commit d3decc7

Please sign in to comment.