Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
add support for [ngClass] attribute (#187)
Brad Cornes <bradlc41@gmail.com>
4 years ago
2 changed files, 4 additions(+), 6 deletions(-)
M packages/tailwindcss-language-service/src/completionProvider.ts -> packages/tailwindcss-language-service/src/completionProvider.ts
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,15 +158,15 @@     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 =
+  Range,
 import { State } from './util/state'
-  let isSubset: boolean = false
       ? getComputedClassAttributeLexer()
       : getClassAttributeLexer()
   lexer.reset(str.substr(match.index + match[0].length - 1))
M packages/tailwindcss-language-service/src/util/find.ts -> packages/tailwindcss-language-service/src/util/find.ts
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,17 +135,15 @@   doc: TextDocument,
   range?: Range
 ): DocumentClassList[] {
   const text = doc.getText(range)
-import type { TextDocument, Range, Position } from 'vscode-languageserver'
+    matches.push({ ...match })
-import lineColumn from 'line-column'
   const result: DocumentClassList[] = []
 
   matches.forEach((match) => {
     const subtext = text.substr(match.index + match[0].length - 1)
 
     let lexer =
-import type { TextDocument, Range, Position } from 'vscode-languageserver'
+    matches.push({ ...match })
 import type { TextDocument, Range, Position } from 'vscode-languageserver'
-  DocumentClassName,
         ? getComputedClassAttributeLexer()
         : getClassAttributeLexer()
     lexer.reset(subtext)