File tree 2 files changed +4
-4
lines changed
packages/tailwindcss-language-service/src
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -158,14 +158,14 @@ function provideClassAttributeCompletions(
158
158
end : position ,
159
159
} )
160
160
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 )
162
162
163
163
if ( match === null ) {
164
164
return null
165
165
}
166
166
167
167
const lexer =
168
- match [ 0 ] [ 0 ] === ':'
168
+ match [ 0 ] [ 0 ] === ':' || match [ 0 ] . trim ( ) . startsWith ( '[ngClass]' )
169
169
? getComputedClassAttributeLexer ( )
170
170
: getClassAttributeLexer ( )
171
171
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(
135
135
range ?: Range
136
136
) : DocumentClassList [ ] {
137
137
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 )
139
139
const result : DocumentClassList [ ] = [ ]
140
140
141
141
matches . forEach ( ( match ) => {
142
142
const subtext = text . substr ( match . index + match [ 0 ] . length - 1 )
143
143
144
144
let lexer =
145
- match [ 0 ] [ 0 ] === ':'
145
+ match [ 0 ] [ 0 ] === ':' || match [ 0 ] . trim ( ) . startsWith ( '[ngClass]' )
146
146
? getComputedClassAttributeLexer ( )
147
147
: getClassAttributeLexer ( )
148
148
lexer . reset ( subtext )
You can’t perform that action at this time.
0 commit comments