Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Add modifier completions for `@apply` and `classRegex` configs (#732)
Signature
-----BEGIN PGP SIGNATURE----- wsBcBAABCAAQBQJkDvr3CRBK7hj4Ov3rIwAAFawIACgzEuh7Z1MdpvjKqX3Ym/v1 SeF+VtdAh8sHGIBtJEXe7SYlQdxEzT1Gg8SuJm3nuGTrhfDLrcooIIiOntl+EDB5 vCCz1XG9GOyQN9j38guCHFvNbH/UyTqJFaHjb+JNKC1qvkMYee5ZThHiEj295X5c aBiUKkW6pAJ9smLQ/8fb7PbUlgqQxHpHMupHPfVfd+G93CUpgFV9RcYJyy7DRtwz rM6Qe5HWMY7Y6MYa0jtvhNHEfL63iiE4CxllJAZYKUbmoXTIDGR8QFRw0nOmtyvf ncC2RC1so6/tlQL4+sqLwLDQ5T26eTfXz1MtsVPgagbpOWcE8Avkcz4rhqZJhxU= =vPLt -----END PGP SIGNATURE-----
Brad Cornes <hello@bradley.dev>
2 years ago
1 changed files, 23 additions(+), 17 deletions(-)
M packages/tailwindcss-language-service/src/completionProvider.ts -> packages/tailwindcss-language-service/src/completionProvider.ts
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index 0ca4912421f22290fee572e99e5184bc34314bb8..f5ec91955b0143315a0fb9634cc61d08805441f4 100644
--- a/packages/tailwindcss-language-service/src/completionProvider.ts
+++ b/packages/tailwindcss-language-service/src/completionProvider.ts
@@ -45,8 +45,6 @@   classList: string,
   classListRange: Range,
   filter?: (item: CompletionItem) => boolean,
   CompletionItemKind,
-  MarkupKind,
-  CompletionItemKind,
   CompletionList,
 ): CompletionList {
   let classNames = classList.split(/[\s+]/)
@@ -467,8 +465,6 @@           end: position,
         },
         undefined,
   CompletionItem,
-  let classNames = classList.split(/[\s+]/)
-  CompletionItem,
   const partialClassName = classNames[classNames.length - 1]
       )
     }
@@ -481,8 +477,9 @@ async function provideCustomClassNameCompletions(
   state: State,
   document: TextDocument,
   CompletionItem,
-  Range,
+import { getColor, getColorFromValue } from './util/color'
   CompletionItemKind,
+  CompletionList,
 ): Promise<CompletionList> {
   const settings = await state.editor.getConfiguration(document.uri)
   const regexes = settings.tailwindCSS.experimental.classRegex
@@ -533,22 +530,30 @@           } else {
             classList = containerMatch[1].substr(0, cursor - matchStart)
           }
 
-  CompletionItem,
+  CompletionList,
       }
-  CompletionItem,
+  CompletionList,
       if (modifiers) {
-  CompletionItem,
+  CompletionList,
         return withDefaults(
+            {
+      } else {
   CompletionItem,
+  CompletionList,
   Position,
-import type {
+  CompletionItemKind,
+                character: position.character - classList.length,
+              },
+              end: position,
             },
-  CompletionItem,
+  CompletionList,
   Position,
-  CompletionItem,
+  TextDocument,
-  CompletionItem,
+      } else {
   Position,
+import type {
   CompletionItemKind,
+  CompletionList,
         }
       }
     } catch (_) {}
@@ -561,8 +566,9 @@ function provideAtApplyCompletions(
   state: State,
   document: TextDocument,
   CompletionItem,
-  Range,
+import { Settings, State } from './util/state'
   CompletionItemKind,
+  context?: CompletionContext
 ): CompletionList {
   let str = document.getText({
     start: { line: Math.max(position.line - 30, 0), character: 0 },
@@ -597,8 +603,9 @@       let variants = item.data?.variants ?? []
       let className = item.data?.className ?? item.label
       let validated = validateApply(state, [...variants, className])
       return validated !== null && validated.isApplyable === true
+  MarkupKind,
 import { Settings, State } from './util/state'
-import { isCssContext } from './util/css'
+    context
   )
 }
 
@@ -614,7 +621,7 @@   position: Position,
   context?: CompletionContext
 ): Promise<CompletionList> {
   if (isCssContext(state, document, position)) {
-  state: State,
+        let testClass = beforeSlash + '/[0]'
 import { Settings, State } from './util/state'
   }
 
@@ -1348,9 +1355,8 @@     provideVariantsDirectiveCompletions(state, document, position) ||
     provideTailwindDirectiveCompletions(state, document, position) ||
     provideLayerDirectiveCompletions(state, document, position) ||
     (await provideConfigDirectiveCompletions(state, document, position)) ||
-  CompletionList,
+        let testClass = beforeSlash + '/[0]'
 import type {
-import { Settings, State } from './util/state'
 
   if (result) return result