Skip to content

Commit

Permalink
Always use TS's sort text in TS 5+
Browse files Browse the repository at this point in the history
Fixes #174628
  • Loading branch information
mjbvz committed Mar 6, 2023
1 parent 797291f commit 5cb8573
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ class MyCompletionItem extends vscode.CompletionItem {
) {
super(tsEntry.name, MyCompletionItem.convertKind(tsEntry.kind));

if (tsEntry.source && tsEntry.hasAction) {
if (tsEntry.source && tsEntry.hasAction && client.apiVersion.lt(API.v500)) {
// De-prioritze auto-imports
// https://github.com/microsoft/vscode/issues/40311
this.sortText = '\uffff' + tsEntry.sortText;
} else {
this.sortText = tsEntry.sortText;
}

if (tsEntry.source && tsEntry.hasAction) {
// Render "fancy" when source is a workspace path
const qualifierCandidate = vscode.workspace.asRelativePath(tsEntry.source);
if (qualifierCandidate !== tsEntry.source) {
Expand Down

0 comments on commit 5cb8573

Please sign in to comment.