@@ -100,25 +100,25 @@ export interface Settings extends PluginSettings {
100
100
/**
101
101
* Maps string-based CompletionEntry::kind to enum-based CompletionItemKind
102
102
*/
103
- const completionKinds : { [ name : string ] : CompletionItemKind } = {
104
- class : CompletionItemKind . Class ,
105
- constructor : CompletionItemKind . Constructor ,
106
- enum : CompletionItemKind . Enum ,
107
- field : CompletionItemKind . Field ,
108
- file : CompletionItemKind . File ,
109
- function : CompletionItemKind . Function ,
110
- interface : CompletionItemKind . Interface ,
111
- keyword : CompletionItemKind . Keyword ,
112
- method : CompletionItemKind . Method ,
113
- module : CompletionItemKind . Module ,
114
- property : CompletionItemKind . Property ,
115
- reference : CompletionItemKind . Reference ,
116
- snippet : CompletionItemKind . Snippet ,
117
- text : CompletionItemKind . Text ,
118
- unit : CompletionItemKind . Unit ,
119
- value : CompletionItemKind . Value ,
120
- variable : CompletionItemKind . Variable ,
121
- }
103
+ const completionKinds = new Map < string , CompletionItemKind > ( [
104
+ [ ` class` , CompletionItemKind . Class ] ,
105
+ [ ` constructor` , CompletionItemKind . Constructor ] ,
106
+ [ ` enum` , CompletionItemKind . Enum ] ,
107
+ [ ` field` , CompletionItemKind . Field ] ,
108
+ [ ` file` , CompletionItemKind . File ] ,
109
+ [ ` function` , CompletionItemKind . Function ] ,
110
+ [ ` interface` , CompletionItemKind . Interface ] ,
111
+ [ ` keyword` , CompletionItemKind . Keyword ] ,
112
+ [ ` method` , CompletionItemKind . Method ] ,
113
+ [ ` module` , CompletionItemKind . Module ] ,
114
+ [ ` property` , CompletionItemKind . Property ] ,
115
+ [ ` reference` , CompletionItemKind . Reference ] ,
116
+ [ ` snippet` , CompletionItemKind . Snippet ] ,
117
+ [ ` text` , CompletionItemKind . Text ] ,
118
+ [ ` unit` , CompletionItemKind . Unit ] ,
119
+ [ ` value` , CompletionItemKind . Value ] ,
120
+ [ ` variable` , CompletionItemKind . Variable ] ,
121
+ ] )
122
122
123
123
/**
124
124
* Handles incoming requests and return responses. There is a one-to-one-to-one
@@ -1182,7 +1182,7 @@ export class TypeScriptService {
1182
1182
params . position . line ,
1183
1183
params . position . character
1184
1184
)
1185
- const completions = configuration . getService ( ) . getCompletionsAtPosition ( fileName , offset )
1185
+ const completions = configuration . getService ( ) . getCompletionsAtPosition ( fileName , offset , undefined )
1186
1186
1187
1187
if ( ! completions ) {
1188
1188
return [ ]
@@ -1192,7 +1192,7 @@ export class TypeScriptService {
1192
1192
. map ( entry => {
1193
1193
const item : CompletionItem = { label : entry . name }
1194
1194
1195
- const kind = completionKinds [ entry . kind ]
1195
+ const kind = completionKinds . get ( entry . kind )
1196
1196
if ( kind ) {
1197
1197
item . kind = kind
1198
1198
}
@@ -1233,7 +1233,10 @@ export class TypeScriptService {
1233
1233
const configuration = this . projectManager . getConfiguration ( fileName )
1234
1234
configuration . ensureBasicFiles ( span )
1235
1235
1236
- const details = configuration . getService ( ) . getCompletionEntryDetails ( fileName , offset , entryName )
1236
+ const details = configuration
1237
+ . getService ( )
1238
+ . getCompletionEntryDetails ( fileName , offset , entryName , undefined , undefined )
1239
+
1237
1240
if ( details ) {
1238
1241
item . documentation = ts . displayPartsToString ( details . documentation )
1239
1242
item . detail = ts . displayPartsToString ( details . displayParts )
0 commit comments