@@ -58,7 +58,8 @@ class MyCompletionItem extends vscode.CompletionItem {
58
58
public readonly metadata : any | undefined ,
59
59
client : ITypeScriptServiceClient ,
60
60
) {
61
- super ( tsEntry . name , MyCompletionItem . convertKind ( tsEntry . kind ) ) ;
61
+ const label = tsEntry . name || ( tsEntry . insertText ?? '' ) ;
62
+ super ( label , MyCompletionItem . convertKind ( tsEntry . kind ) ) ;
62
63
63
64
if ( tsEntry . source && tsEntry . hasAction && client . apiVersion . lt ( API . v490 ) ) {
64
65
// De-prioritze auto-imports
@@ -72,18 +73,18 @@ class MyCompletionItem extends vscode.CompletionItem {
72
73
// Render "fancy" when source is a workspace path
73
74
const qualifierCandidate = vscode . workspace . asRelativePath ( tsEntry . source ) ;
74
75
if ( qualifierCandidate !== tsEntry . source ) {
75
- this . label = { label : tsEntry . name , description : qualifierCandidate } ;
76
+ this . label = { label, description : qualifierCandidate } ;
76
77
}
77
78
78
79
}
79
80
80
81
const { sourceDisplay, isSnippet } = tsEntry ;
81
82
if ( sourceDisplay ) {
82
- this . label = { label : tsEntry . name , description : Previewer . asPlainTextWithLinks ( sourceDisplay , client ) } ;
83
+ this . label = { label, description : Previewer . asPlainTextWithLinks ( sourceDisplay , client ) } ;
83
84
}
84
85
85
86
if ( tsEntry . labelDetails ) {
86
- this . label = { label : tsEntry . name , ...tsEntry . labelDetails } ;
87
+ this . label = { label, ...tsEntry . labelDetails } ;
87
88
}
88
89
89
90
this . preselect = tsEntry . isRecommended ;
0 commit comments