@@ -24,7 +24,6 @@ import { URI } from 'vscode-uri'
24
24
import { showError , showWarning , SilentError } from './util/error'
25
25
import * as path from 'node:path'
26
26
import * as fs from 'node:fs'
27
- import * as fsPromises from 'node:fs/promises'
28
27
import findUp from 'find-up'
29
28
import picomatch from 'picomatch'
30
29
import { resolveFrom , setPnpApi } from './util/resolveFrom'
@@ -57,7 +56,6 @@ import { doCodeActions } from '@tailwindcss/language-service/src/codeActions/cod
57
56
import { getDocumentColors } from '@tailwindcss/language-service/src/documentColorProvider'
58
57
import { getDocumentLinks } from '@tailwindcss/language-service/src/documentLinksProvider'
59
58
import { debounce } from 'debounce'
60
- import { scanCssFilesForCustomClasses } from '@tailwindcss/language-service/src/util/css-class-scanner'
61
59
import { getModuleDependencies } from './util/getModuleDependencies'
62
60
import assert from 'node:assert'
63
61
// import postcssLoadConfig from 'postcss-load-config'
@@ -1071,40 +1069,6 @@ export async function createProjectService(
1071
1069
}
1072
1070
state . variants = getVariants ( state )
1073
1071
1074
- // Scan CSS files for custom classes (v3 projects)
1075
- const cssFiles = Array . from ( state . dependencies ?? [ ] ) . filter ( ( dep ) => dep . endsWith ( '.css' ) )
1076
-
1077
- // Also scan the main CSS file if it's a CSS config
1078
- if ( state . isCssConfig && state . configPath ) {
1079
- cssFiles . push ( state . configPath )
1080
- }
1081
-
1082
- // Also scan CSS files in the project directory for custom classes
1083
- try {
1084
- const projectDir = path . dirname ( state . configPath )
1085
- const projectFiles = await fsPromises . readdir ( projectDir )
1086
- const projectCssFiles = projectFiles
1087
- . filter ( ( file ) => file . endsWith ( '.css' ) )
1088
- . map ( ( file ) => path . join ( projectDir , file ) )
1089
-
1090
- // Add project CSS files that aren't already in dependencies
1091
- for ( const cssFile of projectCssFiles ) {
1092
- if ( ! cssFiles . includes ( cssFile ) ) {
1093
- cssFiles . push ( cssFile )
1094
- }
1095
- }
1096
- } catch ( error ) {
1097
- console . error ( 'Error scanning project directory for CSS files:' , error )
1098
- }
1099
-
1100
- if ( cssFiles . length > 0 ) {
1101
- try {
1102
- await scanCssFilesForCustomClasses ( state , cssFiles )
1103
- } catch ( error ) {
1104
- console . error ( 'Error scanning CSS files for custom classes:' , error )
1105
- }
1106
- }
1107
-
1108
1072
let screens = dlv ( state . config , 'theme.screens' , dlv ( state . config , 'screens' , { } ) )
1109
1073
state . screens = isObject ( screens ) ? Object . keys ( screens ) : [ ]
1110
1074
@@ -1186,20 +1150,7 @@ export async function createProjectService(
1186
1150
state . variants = getVariants ( state )
1187
1151
state . blocklist = Array . from ( designSystem . invalidCandidates ?? [ ] )
1188
1152
1189
- // Scan CSS files for custom classes
1190
1153
let deps = designSystem . dependencies ( )
1191
- const cssFiles = Array . from ( deps ) . filter ( ( dep ) => dep . endsWith ( '.css' ) )
1192
-
1193
- // Also scan the main CSS file
1194
- cssFiles . push ( state . configPath )
1195
-
1196
- if ( cssFiles . length > 0 ) {
1197
- try {
1198
- await scanCssFilesForCustomClasses ( state , cssFiles )
1199
- } catch ( error ) {
1200
- console . error ( 'Error scanning CSS files for custom classes:' , error )
1201
- }
1202
- }
1203
1154
1204
1155
for ( let dep of deps ) {
1205
1156
dependencies . add ( dep )
0 commit comments