api - encourage to set kind when creating a completion item

This commit is contained in:
Johannes Rieken 2016-06-03 15:44:47 +02:00
parent 9afa1307d4
commit 640f516f37
2 changed files with 3 additions and 8 deletions

View file

@ -18,13 +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 => {
return 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)));
}
}
});

View file

@ -717,8 +717,9 @@ export class CompletionItem {
insertText: string;
textEdit: TextEdit;
constructor(label: string) {
constructor(label: string, kind?: CompletionItemKind) {
this.label = label;
this.kind = kind;
}
toJSON(): any {