From fb9865d00cf8f308f589170cc55cf9481f54f2d2 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 6 Jun 2016 10:01:05 +0200 Subject: [PATCH] api - encourage to set kind when creating a completion item. actually do it --- extensions/configuration-editing/src/extension.ts | 6 +----- src/vs/vscode.d.ts | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/extensions/configuration-editing/src/extension.ts b/extensions/configuration-editing/src/extension.ts index 71a11ba355f..78114b106ba 100644 --- a/extensions/configuration-editing/src/extension.ts +++ b/extensions/configuration-editing/src/extension.ts @@ -18,11 +18,7 @@ export function activate(context) { provideCompletionItems(document, position, token) { const location = getLocation(document.getText(), document.offsetAt(position)); if (location.path[1] === 'command') { - return commands.then(ids => ids.map(id => { - let item = new vscode.CompletionItem(id); - item.kind = vscode.CompletionItemKind.Value; - return item; - })); + return commands.then(ids => ids.map(id => new vscode.CompletionItem(id, vscode.CompletionItemKind.Value))); } } }); diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 054b29ea634..8af068cf3e7 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2138,8 +2138,9 @@ declare namespace vscode { * will be used as insert text as well as for sorting and filtering. * * @param label The label of the completion. + * @param kind The [kind](#CompletionItemKind) of the completion. */ - constructor(label: string); + constructor(label: string, kind?: CompletionItemKind); } /**