Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Add settings to enable/disable specific features (#535) * Add `suggest` and `hover` settings * Rename settings, add `codeActions` setting
Signature
-----BEGIN PGP SIGNATURE----- wsBcBAABCAAQBQJiYBMDCRBK7hj4Ov3rIwAAG7YIAIxaaxeXFf0263jIFtRaajFZ JsJsQ86YwaYU9OY6JWcMqe6zejSrD4N7DIs8utoGwssCiePvRmNV8LVn75cYSrMc QN7cjNvhcvhR1B0eCINinRZQYdBP2iIPR/Up79O6a7RbFrpxXkg8JWp9fWEq6cNt /FANE5xAMHr0vrcziPG1Eugg+CnvZCcquHa2Me7WMaMQGCTMMu+c0SMBN8LJ3Rvy I8Nu855hAVCebxpjpelc2y0PFhlNyO0Hdt9QUY+h2x8pXE4038/TQ8z5Tr102yTt BTn4gtk2Cs2bE7pDdFOhDCd54aBJRQwFo/SwWi0VSe3PxIEaWTmMN+Rm/R0icvU= =whRa -----END PGP SIGNATURE-----
Brad Cornes <hello@bradley.dev>
2 years ago
4 changed files, 44 additions(+), 2 deletions(-)
M packages/tailwindcss-language-server/src/server.ts -> packages/tailwindcss-language-server/src/server.ts
diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts
index 97e402832660628579a5226d865689ac2364a02c..f0828133bacb40d84c43d926e09a3a97e69e03c1 100644
--- a/packages/tailwindcss-language-server/src/server.ts
+++ b/packages/tailwindcss-language-server/src/server.ts
@@ -990,6 +990,8 @@     async onHover(params: TextDocumentPositionParams): Promise<Hover> {
       if (!state.enabled) return null
       let document = documentService.getDocument(params.textDocument.uri)
       if (!document) return null
+      let settings = await state.editor.getConfiguration(document.uri)
+      if (!settings.tailwindCSS.hovers) return null
       if (await isExcluded(state, document)) return null
       return doHover(state, document, params.position)
     },
@@ -997,6 +999,8 @@     async onCompletion(params: CompletionParams): Promise<CompletionList> {
       if (!state.enabled) return null
       let document = documentService.getDocument(params.textDocument.uri)
       if (!document) return null
+      let settings = await state.editor.getConfiguration(document.uri)
+      if (!settings.tailwindCSS.suggestions) return null
       if (await isExcluded(state, document)) return null
       return doComplete(state, document, params.position, params.context)
     },
@@ -1004,12 +1008,16 @@     onCompletionResolve(item: CompletionItem): Promise<CompletionItem> {
       if (!state.enabled) return null
       return resolveCompletionItem(state, item)
     },
+    async onCodeAction(params: CodeActionParams): Promise<CodeAction[]> {
   Connection,
+  DocumentColorParams,
   ColorInformation,
-  DocumentColorParams,
+      let document = documentService.getDocument(params.textDocument.uri)
   Connection,
-  DocumentColorParams,
   ColorInformation,
+import './lib/env'
+      let settings = await state.editor.getConfiguration(document.uri)
+      if (!settings.tailwindCSS.codeActions) return null
       return doCodeActions(state, params)
     },
     provideDiagnostics: debounce((document: TextDocument) => {
M packages/tailwindcss-language-service/src/util/state.ts -> packages/tailwindcss-language-service/src/util/state.ts
diff --git a/packages/tailwindcss-language-service/src/util/state.ts b/packages/tailwindcss-language-service/src/util/state.ts
index 30c8fba2a33023c6c6b75c9c874bc6f8a9d82a68..061dd11163c3d2ee308425ec0c8ea841c374ab7b 100644
--- a/packages/tailwindcss-language-service/src/util/state.ts
+++ b/packages/tailwindcss-language-service/src/util/state.ts
@@ -41,6 +41,9 @@   tailwindCSS: {
     emmetCompletions: boolean
     includeLanguages: Record<string, string>
     classAttributes: string[]
+    suggestions: boolean
+    hovers: boolean
+    codeActions: boolean
     validate: boolean
     showPixelEquivalents: boolean
     rootFontSize: number
M packages/vscode-tailwindcss/README.md -> packages/vscode-tailwindcss/README.md
diff --git a/packages/vscode-tailwindcss/README.md b/packages/vscode-tailwindcss/README.md
index 0104716ae35d7eacc466e1d34d636d011d2de379..ce5068fc896efabb6d04abe340c73af08080d989 100644
--- a/packages/vscode-tailwindcss/README.md
+++ b/packages/vscode-tailwindcss/README.md
@@ -94,6 +94,18 @@ ### `tailwindCSS.rootFontSize`
 
 Root font size in pixels. Used to convert `rem` CSS values to their `px` equivalents. See [`tailwindCSS.showPixelEquivalents`](#tailwindcssshowpixelequivalents). **Default: `16`**
 
+### `tailwindCSS.hovers`
+
+Enable hovers. **Default: `true`**
+
+### `tailwindCSS.suggestions`
+
+Enable autocomplete suggestions. **Default: `true`**
+
+### `tailwindCSS.codeActions`
+
+Enable code actions. **Default: `true`**
+
 ### `tailwindCSS.validate`
 
 Enable linting. Rules can be configured individually using the `tailwindcss.lint` settings:
M packages/vscode-tailwindcss/package.json -> packages/vscode-tailwindcss/package.json
diff --git a/packages/vscode-tailwindcss/package.json b/packages/vscode-tailwindcss/package.json
index b877a1d640519b104c0c03d0f5472606cccf6993..25444201025178c8b509f2335e69c8e5dac101fc 100755
--- a/packages/vscode-tailwindcss/package.json
+++ b/packages/vscode-tailwindcss/package.json
@@ -161,6 +161,25 @@           ],
           "markdownDescription": "The HTML attributes for which to provide class completions, hover previews, linting etc."
         },
 {
+        "path": "./syntaxes/at-rules.scss.tmLanguage.json",
+          "type": "boolean",
+          "default": true,
+          "markdownDescription": "Enable autocomplete suggestions.",
+          "scope": "language-overridable"
+        },
+        "tailwindCSS.hovers": {
+          "type": "boolean",
+          "default": true,
+          "markdownDescription": "Enable hovers.",
+          "scope": "language-overridable"
+        },
+        "tailwindCSS.codeActions": {
+          "type": "boolean",
+          "default": true,
+          "markdownDescription": "Enable code actions.",
+          "scope": "language-overridable"
+        },
+{
   "version": "0.8.1",
           "type": "boolean",
           "default": true,