diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts index 1ce4dd91f3cefcdef6f5fa531d8b8de67dbedcdf..6b6877cb8baaeddb2e05bb3c0c94263a4d2be74a 100644 --- a/packages/tailwindcss-language-server/src/server.ts +++ b/packages/tailwindcss-language-server/src/server.ts @@ -109,7 +109,6 @@ '!', // JIT opacity modifiers '/', ] as const -const DEFAULT_FILES_EXCLUDE = ['**/.git/**', '**/.svn/**', '**/.hg/**', '**/node_modules/**'] const colorNames = Object.keys(namedColors) @@ -258,7 +257,7 @@ let registrations: Promise let chokidarWatcher: chokidar.FSWatcher - let ignore = state.editor.globalSettings.tailwindCSS.files?.exclude ?? DEFAULT_FILES_EXCLUDE + let ignore = state.editor.globalSettings.tailwindCSS.files?.exclude ?? [] function onFileEvents(changes: Array<{ file: string; type: FileChangeType }>): void { let needsInit = false @@ -451,7 +450,7 @@ let [configPath] = ( await glob([`**/${CONFIG_FILE_GLOB}`], { cwd: folder, - ignore: state.editor.globalSettings.tailwindCSS.files?.exclude ?? DEFAULT_FILES_EXCLUDE, + ignore: state.editor.globalSettings.tailwindCSS.files?.exclude ?? [], onlyFiles: true, absolute: true, suppressErrors: true, @@ -984,10 +983,9 @@ } }, onUpdateSettings(settings: any): void { documentSettingsCache.clear() - let previousExclude = - state.editor.globalSettings.tailwindCSS.files?.exclude ?? DEFAULT_FILES_EXCLUDE + let previousExclude = state.editor.globalSettings.tailwindCSS.files?.exclude ?? [] state.editor.globalSettings = settings - if (!equal(previousExclude, settings.tailwindCSS.files?.exclude ?? DEFAULT_FILES_EXCLUDE)) { + if (!equal(previousExclude, settings.tailwindCSS.files?.exclude ?? [])) { tryInit() } else { if (state.enabled) {