Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Commit 4242830

Browse files
committed
Optionally prefix the inserted item
This update uses the prefix when the item is being inserted instead of showing it within the auto-complete selection.
1 parent da05017 commit 4242830

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extension.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ function provideCompletionItemsGenerator(languageSelector: string, classMatchReg
9292

9393
// Creates a collection of CompletionItem based on the classes already cached
9494
let completionItems = uniqueDefinitions.map(definition => {
95-
return new vscode.CompletionItem(`${classPrefix}${definition.className}`, vscode.CompletionItemKind.Variable);
95+
const completionItem = new vscode.CompletionItem(definition.className, vscode.CompletionItemKind.Variable);
96+
const completionClassName = `${classPrefix}${definition.className}`;
97+
98+
completionItem.filterText = completionClassName;
99+
completionItem.insertText = completionClassName;
100+
101+
return completionItem;
96102
});
97103

98104
// Removes from the collection the classes already specified on the class attribute

0 commit comments

Comments
 (0)