File tree 1 file changed +24
-10
lines changed 1 file changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -486,16 +486,30 @@ class TailwindIntellisense {
486
486
: strEnd
487
487
} )
488
488
}
489
- let toFade = classNames
490
- . filter ( x => {
491
- return ! (
492
- position . isAfterOrEqual ( x . start ) &&
493
- position . isBeforeOrEqual ( x . end )
494
- )
495
- } )
496
- . map ( x => ( { range : new vscode . Range ( x . start , x . end ) } ) )
497
- vscode . window . activeTextEditor . setDecorations ( fade , toFade )
498
- return true
489
+ let activeClassName = classNames . filter ( x => {
490
+ return (
491
+ position . isAfterOrEqual ( x . start ) &&
492
+ position . isBeforeOrEqual ( x . end )
493
+ )
494
+ } )
495
+ if (
496
+ activeClassName . length &&
497
+ activeClassName [ 0 ] . className . trim ( ) !== ''
498
+ ) {
499
+ let parts = activeClassName [ 0 ] . className . split ( ':' )
500
+ if ( parts . length === 1 ) return false
501
+ let toFade = classNames
502
+ . filter ( x => {
503
+ return ! (
504
+ position . isAfterOrEqual ( x . start ) &&
505
+ position . isBeforeOrEqual ( x . end )
506
+ )
507
+ } )
508
+ . filter ( x => x . className . indexOf ( `${ parts [ 0 ] } :` ) !== 0 )
509
+ . map ( x => ( { range : new vscode . Range ( x . start , x . end ) } ) )
510
+ vscode . window . activeTextEditor . setDecorations ( fade , toFade )
511
+ return true
512
+ }
499
513
}
500
514
return false
501
515
} )
You can’t perform that action at this time.
0 commit comments