mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 11:49:38 +00:00
Always use TS's sort text in TS 5+ (#176322)
* Always use TS's sort text in TS 5+ Fixes #174628 * Add missing file
This commit is contained in:
@@ -63,19 +63,21 @@ 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.v490)) {
|
||||
// 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) {
|
||||
this.label = { label: tsEntry.name, description: qualifierCandidate };
|
||||
}
|
||||
|
||||
} else {
|
||||
this.sortText = tsEntry.sortText;
|
||||
}
|
||||
|
||||
const { sourceDisplay, isSnippet } = tsEntry;
|
||||
|
||||
Reference in New Issue
Block a user