Skip to content

Commit 0e66dac

Browse files
committed
update class attribute regex (#233)
1 parent b3c17cf commit 0e66dac

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/tailwindcss-language-service/src/completionProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ function provideClassAttributeCompletions(
159159
end: position,
160160
})
161161

162-
const match = findLast(/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/gi, str)
162+
const match = findLast(
163+
/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/gi,
164+
str
165+
)
163166

164167
if (match === null) {
165168
return null

packages/tailwindcss-language-service/src/util/find.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export function findClassListsInHtmlRange(
209209
): DocumentClassList[] {
210210
const text = doc.getText(range)
211211
const matches = findAll(
212-
/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/g,
212+
/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/g,
213213
text
214214
)
215215
const result: DocumentClassList[] = []

0 commit comments

Comments
 (0)