Skip to content

Commit cfd4e4f

Browse files
committed
update class attribute regex (#125)
1 parent cd444ab commit cfd4e4f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lsp/providers/completionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function provideClassAttributeCompletions(
126126
end: position,
127127
})
128128

129-
const match = findLast(/[\s:]class(?:Name)?=['"`{]/gi, str)
129+
const match = findLast(/(?:\b|:)class(?:Name)?=['"`{]/gi, str)
130130

131131
if (match === null) {
132132
return null

src/lsp/util/find.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function findClassListsInHtmlRange(
101101
range: Range
102102
): DocumentClassList[] {
103103
const text = doc.getText(range)
104-
const matches = findAll(/[\s:]class(?:Name)?=['"`{]/g, text)
104+
const matches = findAll(/(?:\b|:)class(?:Name)?=['"`{]/g, text)
105105
const result: DocumentClassList[] = []
106106

107107
matches.forEach((match) => {

0 commit comments

Comments
 (0)