Skip to content

Commit 4e9a919

Browse files
committed
Support for custom class prefixes on auto completion
1 parent 52a3136 commit 4e9a919

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function cache(): Promise<void> {
7474
});
7575
}
7676

77-
function provideCompletionItemsGenerator(languageSelector: string, classMatchRegex: RegExp) {
77+
function provideCompletionItemsGenerator(languageSelector: string, classMatchRegex: RegExp, classPrefix: string = '') {
7878
return vscode.languages.registerCompletionItemProvider(languageSelector, {
7979
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position): vscode.CompletionItem[] {
8080
const start: vscode.Position = new vscode.Position(position.line, 0);
@@ -92,7 +92,7 @@ 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(definition.className, vscode.CompletionItemKind.Variable);
95+
return new vscode.CompletionItem(`${classPrefix}${definition.className}`, vscode.CompletionItemKind.Variable);
9696
});
9797

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

0 commit comments

Comments
 (0)