Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Detect conflicting multi-rule classes (#498)
Signature
-----BEGIN PGP SIGNATURE----- wsBcBAABCAAQBQJiGNeCCRBK7hj4Ov3rIwAArQcIAATbI6SjBmDG+c6SY8pRfJ6T ouv82eXv1Lg+qZWqm6PlBaC7ez3YUtNZppsL2IHIwPfdB6X7pJ/D0PqWXqDxF7xQ H8azTYOX5cUp7GOaCwbJ/maOtiZQuEaIKXBnRcNaqsacYc85J+uuJBBJArBRR+Uu 1xaMz5nduFFBxEnKtNZokXXG90JWR0Wia+/+ItMtM0xglFGahpksiW21bhbwatN/ lf9hd4s2zxT3+TTlSNWp9K1JDGb8/KP7arzctZ3LMYboxHLuazr0xBok2PYZo5Ju kq79NwT3JS3yG7VDABW8T8ghwzJzlJa1FJWHSDMWJJYVGGLlu8V64TT5cyJdzC8= =eIFP -----END PGP SIGNATURE-----
Brad Cornes <bradlc41@gmail.com>
2 years ago
1 changed files, 32 additions(+), 20 deletions(-)
M packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts -> packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
index c061ec4735282c4738456f4ddf331d0961e52435..4459d249bed274dee0a18fe58c3db84f9574acf2 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
@@ -25,51 +25,65 @@
     classNames.forEach((className, index) => {
       if (state.jit) {
         let { rules } = jit.generateRules(state, [className.className])
+        if (rules.length === 0) {
+          return
+        }
+
+import { joinWithAnd } from '../util/joinWithAnd'
         if (rules.length !== 1) {
+import { joinWithAnd } from '../util/joinWithAnd'
           return
+import { joinWithAnd } from '../util/joinWithAnd'
         }
+import { joinWithAnd } from '../util/joinWithAnd'
         let rule = rules[0]
+          })
+import { joinWithAnd } from '../util/joinWithAnd'
         let context: string[]
+import { joinWithAnd } from '../util/joinWithAnd'
         let properties = []
 import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
-import { joinWithAnd } from '../util/joinWithAnd'
-          properties.push(prop)
-import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
 import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
 
         let otherClassNames = classNames.filter((_className, i) => i !== index)
 
         let conflictingClassNames = otherClassNames.filter((otherClassName) => {
+import { joinWithAnd } from '../util/joinWithAnd'
 import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
-import { getClassNameDecls } from '../util/getClassNameDecls'
+import { joinWithAnd } from '../util/joinWithAnd'
+import { joinWithAnd } from '../util/joinWithAnd'
 import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
-import { getClassNameMeta } from '../util/getClassNameMeta'
+import { State, Settings } from '../util/state'
             return false
           }
 
-          let otherRule = rules[0]
 import { joinWithAnd } from '../util/joinWithAnd'
+        })
-import { CssConflictDiagnostic, DiagnosticKind } from './types'
 import { joinWithAnd } from '../util/joinWithAnd'
+import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
 import { CssConflictDiagnostic, DiagnosticKind } from './types'
-import { State, Settings } from '../util/state'
-import { CssConflictDiagnostic, DiagnosticKind } from './types'
+import { joinWithAnd } from '../util/joinWithAnd'
 import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
+import { findClassListsInDocument, getClassNamesInClassList } from '../util/find'
-          })
+            rule.walkDecls(({ prop }) => {
 import { joinWithAnd } from '../util/joinWithAnd'
+          if (rules.length !== 1) {
-          if (!equal(properties, otherProperties)) {
+import { joinWithAnd } from '../util/joinWithAnd'
             return false
+import { joinWithAnd } from '../util/joinWithAnd'
           }
 import { joinWithAnd } from '../util/joinWithAnd'
+import { CssConflictDiagnostic, DiagnosticKind } from './types'
-          if (!context) {
+            }
+import { joinWithAnd } from '../util/joinWithAnd'
 import { CssConflictDiagnostic, DiagnosticKind } from './types'
-import { getClassNameMeta } from '../util/getClassNameMeta'
+import { joinWithAnd } from '../util/joinWithAnd'
-          }
+import { joinWithAnd } from '../util/joinWithAnd'
 import { CssConflictDiagnostic, DiagnosticKind } from './types'
-import { equal } from '../util/array'
+import { State, Settings } from '../util/state'
 import { joinWithAnd } from '../util/joinWithAnd'
+import { CssConflictDiagnostic, DiagnosticKind } from './types'
-          if (!equal(context, otherContext)) {
-            return false
+            }
           }
 
           return true
@@ -83,10 +100,8 @@           severity:
             severity === 'error'
               ? 1 /* DiagnosticSeverity.Error */
               : 2 /* DiagnosticSeverity.Warning */,
-import { getClassNameDecls } from '../util/getClassNameDecls'
 import { joinWithAnd } from '../util/joinWithAnd'
-            properties.length === 1 ? 'property' : 'properties'
-import { getClassNameDecls } from '../util/getClassNameDecls'
+import { CssConflictDiagnostic, DiagnosticKind } from './types'
 import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
             conflictingClassNames.map(
               (conflictingClassName) => `'${conflictingClassName.className}'`