@@ -66,12 +66,12 @@ export class IntellisenseProvider
66
66
return promise . promise ;
67
67
}
68
68
69
- public resolveCompletionItem (
69
+ public async resolveCompletionItem (
70
70
model : monacoEditor . editor . ITextModel ,
71
71
position : monacoEditor . Position ,
72
72
item : monacoEditor . languages . CompletionItem ,
73
73
token : monacoEditor . CancellationToken
74
- ) : monacoEditor . languages . ProviderResult < monacoEditor . languages . CompletionItem > {
74
+ ) : Promise < monacoEditor . languages . CompletionItem > {
75
75
// If the item has already resolved documentation (as with MS LS) we don't need to do this
76
76
if ( ! item . documentation ) {
77
77
// Emit a new request
@@ -86,7 +86,11 @@ export class IntellisenseProvider
86
86
this . resolveCompletionRequests . set ( requestId , { promise, cancelDisposable } ) ;
87
87
this . sendMessage ( InteractiveWindowMessages . ResolveCompletionItemRequest , { position, item, requestId, cellId : this . getCellId ( model . id ) } ) ;
88
88
89
- return promise . promise ;
89
+ const newItem = await promise . promise ;
90
+ // Our code strips out _documentPosition and possibly other items that are too large to send
91
+ // so instead of returning the new resolve completion item, just return the old item with documentation added in
92
+ // which is what we are resolving the item to get
93
+ return Promise . resolve ( { ...item , documentation : newItem . documentation } ) ;
90
94
} else {
91
95
return Promise . resolve ( item ) ;
92
96
}
0 commit comments