mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
api - encourage to set kind when creating a completion item
This commit is contained in:
parent
9afa1307d4
commit
640f516f37
|
@ -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)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue