mirror of
https://github.com/Microsoft/vscode
synced 2024-09-12 21:24:38 +00:00
parent
23fe76631c
commit
ab8ed4b717
|
@ -58,7 +58,8 @@ class MyCompletionItem extends vscode.CompletionItem {
|
|||
public readonly metadata: any | undefined,
|
||||
client: ITypeScriptServiceClient,
|
||||
) {
|
||||
super(tsEntry.name, MyCompletionItem.convertKind(tsEntry.kind));
|
||||
const label = tsEntry.name || (tsEntry.insertText ?? '');
|
||||
super(label, MyCompletionItem.convertKind(tsEntry.kind));
|
||||
|
||||
if (tsEntry.source && tsEntry.hasAction && client.apiVersion.lt(API.v490)) {
|
||||
// De-prioritze auto-imports
|
||||
|
@ -72,18 +73,18 @@ class MyCompletionItem extends vscode.CompletionItem {
|
|||
// 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 };
|
||||
this.label = { label, description: qualifierCandidate };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const { sourceDisplay, isSnippet } = tsEntry;
|
||||
if (sourceDisplay) {
|
||||
this.label = { label: tsEntry.name, description: Previewer.asPlainTextWithLinks(sourceDisplay, client) };
|
||||
this.label = { label, description: Previewer.asPlainTextWithLinks(sourceDisplay, client) };
|
||||
}
|
||||
|
||||
if (tsEntry.labelDetails) {
|
||||
this.label = { label: tsEntry.name, ...tsEntry.labelDetails };
|
||||
this.label = { label, ...tsEntry.labelDetails };
|
||||
}
|
||||
|
||||
this.preselect = tsEntry.isRecommended;
|
||||
|
|
Loading…
Reference in a new issue