File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/tailwindcss-language-service/src Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ function provideCssHelperCompletions(
614
614
615
615
const match = text
616
616
. substr ( 0 , text . length - 1 ) // don't include that extra character from earlier
617
- . match ( / \b (?< helper > c o n f i g | t h e m e ) \( \s * [ ' " ] ? (?< path > [ ^ ) ' " ] * ) $ / )
617
+ . match ( / [ \s : ; / * ( ) { } ] (?< helper > c o n f i g | t h e m e ) \( \s * [ ' " ] ? (?< path > [ ^ ) ' " ] * ) $ / )
618
618
619
619
if ( match === null ) {
620
620
return null
Original file line number Diff line number Diff line change @@ -350,7 +350,10 @@ export function findHelperFunctionsInRange(
350
350
range ?: Range
351
351
) : DocumentHelperFunction [ ] {
352
352
const text = getTextWithoutComments ( doc , 'css' , range )
353
- let matches = findAll ( / \b (?< helper > c o n f i g | t h e m e ) (?< innerPrefix > \( \s * ) (?< path > [ ^ ) ] * ?) \s * \) / g, text )
353
+ let matches = findAll (
354
+ / (?< prefix > [ \s : ; / * ( ) { } ] ) (?< helper > c o n f i g | t h e m e ) (?< innerPrefix > \( \s * ) (?< path > [ ^ ) ] * ?) \s * \) / g,
355
+ text
356
+ )
354
357
355
358
return matches . map ( ( match ) => {
356
359
let quotesBefore = ''
@@ -364,7 +367,11 @@ export function findHelperFunctionsInRange(
364
367
}
365
368
path = path . replace ( / [ ' " ] * \s * $ / , '' )
366
369
367
- let startIndex = match . index + match . groups . helper . length + match . groups . innerPrefix . length
370
+ let startIndex =
371
+ match . index +
372
+ match . groups . prefix . length +
373
+ match . groups . helper . length +
374
+ match . groups . innerPrefix . length
368
375
369
376
return {
370
377
helper : match . groups . helper === 'theme' ? 'theme' : 'config' ,
You can’t perform that action at this time.
0 commit comments