diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index 9db95948d2430..78495217dc32b 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -481,6 +481,7 @@ export interface CompletionItem { export interface CompletionList { suggestions: CompletionItem[]; incomplete?: boolean; + isDetailsResolved?: boolean; dispose?(): void; } diff --git a/src/vs/editor/contrib/suggest/suggest.ts b/src/vs/editor/contrib/suggest/suggest.ts index d28423e1602f1..c2d3185ce7d52 100644 --- a/src/vs/editor/contrib/suggest/suggest.ts +++ b/src/vs/editor/contrib/suggest/suggest.ts @@ -47,6 +47,9 @@ export class CompletionItem { idx?: number; word?: string; + // + readonly isDetailsResolved: boolean; + constructor( readonly position: IPosition, readonly completion: modes.CompletionItem, @@ -70,6 +73,8 @@ export class CompletionItem { this.editReplaceEnd = new Position(completion.range.replace.endLineNumber, completion.range.replace.endColumn); } + this.isDetailsResolved = container.isDetailsResolved || typeof provider.resolveCompletionItem === 'undefined'; + // create the suggestion resolver const { resolveCompletionItem } = provider; if (typeof resolveCompletionItem !== 'function') { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 32a3f131d6bfe..38597bc5d3b76 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4854,6 +4854,7 @@ declare namespace monaco.languages { export interface CompletionList { suggestions: CompletionItem[]; incomplete?: boolean; + isDetailsResolved?: boolean; dispose?(): void; } diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 15d667e14fc66..27a17629b1339 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1504,4 +1504,15 @@ declare module 'vscode' { export const onDidChangeActiveColorTheme: Event; } + //#endregion + + + //#region https://github.com/microsoft/vscode/issues/39441 + + export interface CompletionList { + isDetailsResolved?: boolean; + } + + //#endregion + } diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 0ae9f98745040..da77e770f4e09 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -367,6 +367,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return { suggestions: result.b.map(d => MainThreadLanguageFeatures._inflateSuggestDto(result.a, d)), incomplete: result.c, + isDetailsResolved: result.d, dispose: () => typeof result.x === 'number' && this._proxy.$releaseCompletionItems(handle, result.x) }; }); diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 076f847e2f6b8..227a885f876f5 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1012,6 +1012,7 @@ export interface ISuggestResultDto { a: { insert: IRange, replace: IRange; }; b: ISuggestDataDto[]; c?: boolean; + d?: boolean; } export interface ISignatureHelpDto { diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index ba0f638fefdf8..737ed4be71402 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -787,7 +787,8 @@ class SuggestAdapter { x: pid, b: [], a: { replace: typeConvert.Range.from(replaceRange), insert: typeConvert.Range.from(insertRange) }, - c: list.isIncomplete || undefined + c: list.isIncomplete || undefined, + d: list.isDetailsResolved || undefined }; for (let i = 0; i < list.items.length; i++) { diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 19819497a1e2d..5239da9499b21 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1395,7 +1395,7 @@ export class CompletionItem implements vscode.CompletionItem { export class CompletionList { isIncomplete?: boolean; - + isDetailsResolved?: boolean; items: vscode.CompletionItem[]; constructor(items: vscode.CompletionItem[] = [], isIncomplete: boolean = false) {