File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/tailwindcss-language-service/src Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -158,14 +158,14 @@ function provideClassAttributeCompletions(
158158 end : position ,
159159 } )
160160
161- const match = findLast ( / (?: \s | : ) c l a s s (?: N a m e ) ? = [ ' " ` { ] / gi, str )
161+ const match = findLast ( / (?: \s | : ) (?: c l a s s (?: N a m e ) ? | \[ n g C l a s s \] ) = [ ' " ` { ] / gi, str )
162162
163163 if ( match === null ) {
164164 return null
165165 }
166166
167167 const lexer =
168- match [ 0 ] [ 0 ] === ':'
168+ match [ 0 ] [ 0 ] === ':' || match [ 0 ] . trim ( ) . startsWith ( '[ngClass]' )
169169 ? getComputedClassAttributeLexer ( )
170170 : getClassAttributeLexer ( )
171171 lexer . reset ( str . substr ( match . index + match [ 0 ] . length - 1 ) )
Original file line number Diff line number Diff line change @@ -135,14 +135,14 @@ export function findClassListsInHtmlRange(
135135 range ?: Range
136136) : DocumentClassList [ ] {
137137 const text = doc . getText ( range )
138- const matches = findAll ( / (?: \s | : ) c l a s s (?: N a m e ) ? = [ ' " ` { ] / g, text )
138+ const matches = findAll ( / (?: \s | : ) (?: c l a s s (?: N a m e ) ? | \[ n g C l a s s \] ) = [ ' " ` { ] / g, text )
139139 const result : DocumentClassList [ ] = [ ]
140140
141141 matches . forEach ( ( match ) => {
142142 const subtext = text . substr ( match . index + match [ 0 ] . length - 1 )
143143
144144 let lexer =
145- match [ 0 ] [ 0 ] === ':'
145+ match [ 0 ] [ 0 ] === ':' || match [ 0 ] . trim ( ) . startsWith ( '[ngClass]' )
146146 ? getComputedClassAttributeLexer ( )
147147 : getClassAttributeLexer ( )
148148 lexer . reset ( subtext )
You can’t perform that action at this time.
0 commit comments