diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index aaf41e462da..6fbb9b7fb07 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -849,7 +849,10 @@ export namespace CompletionItem { export function to(suggestion: modes.CompletionItem, converter?: CommandsConverter): types.CompletionItem { const result = new types.CompletionItem(typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name); - result.label2 = suggestion.label; + if (typeof suggestion.label !== 'string') { + result.label2 = suggestion.label; + } + result.insertText = suggestion.insertText; result.kind = CompletionItemKind.to(suggestion.kind); result.tags = suggestion.tags && suggestion.tags.map(CompletionItemTag.to); diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 0bfe0a0c73c..60183d3f41d 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -1386,7 +1386,6 @@ export class CompletionItem implements vscode.CompletionItem { constructor(label: string, kind?: CompletionItemKind) { this.label = label; - this.label2 = { name: label }; this.kind = kind; } diff --git a/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts index 790c393649b..25bf62c4691 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts @@ -451,11 +451,11 @@ suite('ExtHostTypes', function () { command: { command: 'id', title: 'title' } }); - assertToJSON(new types.CompletionItem('complete'), { label: 'complete', label2: { name: 'complete' } }); + assertToJSON(new types.CompletionItem('complete'), { label: 'complete' }); let item = new types.CompletionItem('complete'); item.kind = types.CompletionItemKind.Interface; - assertToJSON(item, { label: 'complete', label2: { name: 'complete' }, kind: 'Interface' }); + assertToJSON(item, { label: 'complete', kind: 'Interface' }); });