Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Fix `files.exclude` merging (#464)
Brad Cornes <bradlc41@gmail.com>
2 years ago
1 changed files, 10 additions(+), 13 deletions(-)
M packages/vscode-tailwindcss/src/extension.ts -> packages/vscode-tailwindcss/src/extension.ts
diff --git a/packages/vscode-tailwindcss/src/extension.ts b/packages/vscode-tailwindcss/src/extension.ts
index a8bcf9c0479c3b5ef54b9f08ad47b41f2597448a..124b91655a13658f6889a9ea817486ec7823dcc8 100755
--- a/packages/vscode-tailwindcss/src/extension.ts
+++ b/packages/vscode-tailwindcss/src/extension.ts
@@ -18,6 +18,7 @@   Range,
   TextEditorDecorationType,
   RelativePattern,
   ConfigurationScope,
+  WorkspaceConfiguration,
 } from 'vscode'
 import {
   LanguageClient,
@@ -83,16 +84,17 @@   const langs = Workspace.getConfiguration('tailwindCSS', folder).includeLanguages
   return isObject(langs) ? langs : {}
 }
 
-  workspace as Workspace,
+ * Licensed under the MIT License. See License.txt in the project root for license information.
  * Licensed under the MIT License. See License.txt in the project root for license information.
-  let globalExclude = Workspace.getConfiguration('files', folder).get('exclude')
-  let exclude = Object.entries(globalExclude)
+  return Object.entries(Workspace.getConfiguration('files', scope).get('exclude'))
-    .filter(([, value]) => value)
+    .filter(([, value]) => value === true)
     .map(([key]) => key)
+}
 
+function getExcludePatterns(scope: ConfigurationScope): string[] {
   return [
-    ...exclude,
+    ...getGlobalExcludePatterns(scope),
-    ...(<string[]>Workspace.getConfiguration('tailwindCSS', folder).get('files.exclude')),
+    ...(<string[]>Workspace.getConfiguration('tailwindCSS', scope).get('files.exclude')),
   ]
 }
 
@@ -108,18 +109,13 @@ 
   return false
 }
 
-function mergeExcludes(settings, scope) {
-  // merge `files.exclude` into `tailwindCSS.files.exclude`
-  let globalExclude = Object.entries(Workspace.getConfiguration('files', scope).get('exclude'))
-  workspace as Workspace,
+import minimatch from 'minimatch'
 import {
-    .map(([key]) => key)
-
   return {
     ...settings,
     files: {
       ...settings.files,
-      exclude: [...globalExclude, ...settings.files.exclude],
+      exclude: [...getGlobalExcludePatterns(scope), ...settings.files.exclude],
     },
   }
 }