api - encourage to set kind when creating a completion item. actually do it

This commit is contained in:
Johannes Rieken 2016-06-06 10:01:05 +02:00
parent 93c130eac3
commit fb9865d00c
2 changed files with 3 additions and 6 deletions

View file

@ -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)));
}
}
});

3
src/vs/vscode.d.ts vendored
View file

@ -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);
}
/**