tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index 40f3dee6bfaca9e8263688f28a47d878594f2a51..0ba869c889e75e4ebfd6c23c17698c104fdd3475 100644
--- a/packages/tailwindcss-language-service/src/completionProvider.ts
+++ b/packages/tailwindcss-language-service/src/completionProvider.ts
@@ -158,14 +158,14 @@ start: { line: Math.max(position.line - 10, 0), character: 0 },
end: position,
})
- const match = findLast(/(?:\s|:)class(?:Name)?=['"`{]/gi, str)
+ const match = findLast(/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/gi, str)
if (match === null) {
return null
}
const lexer =
- match[0][0] === ':'
+ match[0][0] === ':' || match[0].trim().startsWith('[ngClass]')
? getComputedClassAttributeLexer()
: getClassAttributeLexer()
lexer.reset(str.substr(match.index + match[0].length - 1))
diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts
index e80dfb2f6fdbf94b923edaaf561b0fd7b8da6bdb..15bb694425d1774166afce91396511166266fc2d 100644
--- a/packages/tailwindcss-language-service/src/util/find.ts
+++ b/packages/tailwindcss-language-service/src/util/find.ts
@@ -135,14 +135,14 @@ doc: TextDocument,
range?: Range
): DocumentClassList[] {
const text = doc.getText(range)
- const matches = findAll(/(?:\s|:)class(?:Name)?=['"`{]/g, text)
+ const matches = findAll(/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/g, text)
const result: DocumentClassList[] = []
matches.forEach((match) => {
const subtext = text.substr(match.index + match[0].length - 1)
let lexer =
- match[0][0] === ':'
+ match[0][0] === ':' || match[0].trim().startsWith('[ngClass]')
? getComputedClassAttributeLexer()
: getClassAttributeLexer()
lexer.reset(subtext)