Skip to content

Commit 91456a8

Browse files
committed
fix: Attr completion is not displayed at the first class
1 parent c6c79a7 commit 91456a8

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/lib/completions.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ export function registerCompletions(ctx: ExtensionContext, core: Core): Disposab
169169
provideCompletionItems(document, position) {
170170
const text = document.getText(new Range(new Position(0, 0), position));
171171
if (text.match(/(<\w+\s*)[^>]*$/) !== null) {
172-
const key = text.match(/<\w+\s*\S+(?=\s*=\s*["']?[^"']*$)/)?.[0];
173-
console.log(key);
174-
if (!key) {
172+
if (!text.match(/\S+(?=\s*=\s*["']?[^"']*$)/) || text.match(/<\w+\s+$/)) {
175173
let completions: CompletionItem[] = [];
176174
if (getConfig('windicss.enableAttrUtilityCompletion')) completions = completions.concat(Object.keys(attrs).map((name) => {
177175
const item = new CompletionItem(name, CompletionItemKind.Field);

0 commit comments

Comments
 (0)