@@ -80,7 +80,7 @@ import {
80
80
normalizeDriveLetter ,
81
81
} from './utils'
82
82
import type { DocumentService } from './documents'
83
- import type { ProjectConfig } from './project-locator'
83
+ import { calculateDocumnetSelectors , type ProjectConfig } from './project-locator'
84
84
import { supportedFeatures } from '@tailwindcss/language-service/src/features'
85
85
import { loadDesignSystem } from './util/v4'
86
86
import { readCssFile } from './util/css'
@@ -286,7 +286,9 @@ export async function createProjectService(
286
286
)
287
287
}
288
288
289
- function onFileEvents ( changes : Array < { file : string ; type : FileChangeType } > ) : void {
289
+ async function onFileEvents (
290
+ changes : Array < { file : string ; type : FileChangeType } > ,
291
+ ) : Promise < void > {
290
292
let needsInit = false
291
293
let needsRebuild = false
292
294
@@ -307,16 +309,12 @@ export async function createProjectService(
307
309
projectConfig . configPath &&
308
310
( isConfigFile || isDependency )
309
311
) {
310
- documentSelector = [
311
- ...documentSelector . filter (
312
- ( { priority } ) => priority !== DocumentSelectorPriority . CONTENT_FILE ,
313
- ) ,
314
- ...getContentDocumentSelectorFromConfigFile (
315
- projectConfig . configPath ,
316
- initialTailwindVersion ,
317
- projectConfig . folder ,
318
- ) ,
319
- ]
312
+ documentSelector = await calculateDocumnetSelectors (
313
+ projectConfig . config ,
314
+ state . features ,
315
+ resolver ,
316
+ documentSelector ,
317
+ )
320
318
321
319
checkOpenDocuments ( )
322
320
}
@@ -963,17 +961,13 @@ export async function createProjectService(
963
961
964
962
/////////////////////
965
963
if ( ! projectConfig . isUserConfigured ) {
966
- documentSelector = [
967
- ...documentSelector . filter (
968
- ( { priority } ) => priority !== DocumentSelectorPriority . CONTENT_FILE ,
969
- ) ,
970
- ...getContentDocumentSelectorFromConfigFile (
971
- state . configPath ,
972
- tailwindcss . version ,
973
- projectConfig . folder ,
974
- originalConfig ,
975
- ) ,
976
- ]
964
+ documentSelector = await calculateDocumnetSelectors (
965
+ projectConfig . config ,
966
+ state . features ,
967
+ resolver ,
968
+ documentSelector ,
969
+ originalConfig ,
970
+ )
977
971
}
978
972
//////////////////////
979
973
0 commit comments