update class attribute regex (#233)

master
Brad Cornes 2021-01-08 15:53:02 +00:00
parent b3c17cf5c9
commit 0e66dac7b7
2 changed files with 5 additions and 2 deletions

View File

@ -159,7 +159,10 @@ function provideClassAttributeCompletions(
end: position, end: position,
}) })
const match = findLast(/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/gi, str) const match = findLast(
/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/gi,
str
)
if (match === null) { if (match === null) {
return null return null

View File

@ -209,7 +209,7 @@ export function findClassListsInHtmlRange(
): DocumentClassList[] { ): DocumentClassList[] {
const text = doc.getText(range) const text = doc.getText(range)
const matches = findAll( const matches = findAll(
/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/g, /(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/g,
text text
) )
const result: DocumentClassList[] = [] const result: DocumentClassList[] = []