Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export function createBracketCompletionItem (className: string, position: Positi
completionItem.detail = `['${className}']`;
completionItem.documentation = "kebab-casing may cause unexpected behavior when trying to access style.class-name as a dot notation. You can still work around kebab-case with bracket notation (eg. style['class-name']) but style.className is cleaner.";
completionItem.insertText = `['${className}']`;
completionItem.additionalTextEdits = [new TextEdit(new Range(new Position(position.line, position.character - 1),
new Position(position.line, position.character)), '')];
// .className -> ['className']
// set filterText to match .className
// https://github.com/microsoft/vscode/issues/113551#issuecomment-754158355
completionItem.filterText = `.${className}`
completionItem.range = new Range(new Position(position.line, position.character - 1), position);
return completionItem;
}