Skip to content

Commit 6971c83

Browse files
authored
add option to calculate CompletionItemKind for keywords (#1499)
1 parent 75aa73e commit 6971c83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/langium/src/lsp/completion/completion-provider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,16 @@ export class DefaultCompletionProvider implements CompletionProvider {
472472
}
473473
acceptor(context, {
474474
label: keyword.value,
475-
kind: CompletionItemKind.Keyword,
475+
kind: this.getKeywordCompletionItemKind(keyword),
476476
detail: 'Keyword',
477477
sortText: '1'
478478
});
479479
}
480480

481+
protected getKeywordCompletionItemKind(_keyword: ast.Keyword): CompletionItemKind {
482+
return CompletionItemKind.Keyword;
483+
}
484+
481485
protected filterKeyword(context: CompletionContext, keyword: ast.Keyword): boolean {
482486
// Filter out keywords that do not contain any word character
483487
return /\p{L}/u.test(keyword.value);

0 commit comments

Comments
 (0)