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. actually do it
This commit is contained in:
parent
93c130eac3
commit
fb9865d00c
|
@ -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
3
src/vs/vscode.d.ts
vendored
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue