File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed
packages/tailwindcss-language-server/src Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -815,5 +815,12 @@ export async function calculateDocumentSelectors(
815
815
documentSelectors . findIndex ( ( { pattern : p } ) => p === pattern ) === index ,
816
816
)
817
817
818
+ // Move all the negated patterns to the front
819
+ selectors = selectors . sort ( ( a , z ) => {
820
+ if ( a . pattern . startsWith ( '!' ) && ! z . pattern . startsWith ( '!' ) ) return - 1
821
+ if ( ! a . pattern . startsWith ( '!' ) && z . pattern . startsWith ( '!' ) ) return 1
822
+ return 0
823
+ } )
824
+
818
825
return selectors
819
826
}
Original file line number Diff line number Diff line change @@ -984,21 +984,7 @@ export class TW {
984
984
continue
985
985
}
986
986
987
- let documentSelector = project
988
- . documentSelector ( )
989
- . concat ( )
990
- // move all the negated patterns to the front
991
- . sort ( ( a , z ) => {
992
- if ( a . pattern . startsWith ( '!' ) && ! z . pattern . startsWith ( '!' ) ) {
993
- return - 1
994
- }
995
- if ( ! a . pattern . startsWith ( '!' ) && z . pattern . startsWith ( '!' ) ) {
996
- return 1
997
- }
998
- return 0
999
- } )
1000
-
1001
- for ( let selector of documentSelector ) {
987
+ for ( let selector of project . documentSelector ( ) ) {
1002
988
let pattern = selector . pattern . replace ( / [ \[ \] { } ( ) ] / g, ( m ) => `\\${ m } ` )
1003
989
1004
990
if ( pattern . startsWith ( '!' ) ) {
You can’t perform that action at this time.
0 commit comments