Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
support emmet style syntax in html-based file types
Brad Cornes <bradlc41@gmail.com>
6 years ago
1 changed files, 18 additions(+), 8 deletions(-)
M src/extension.ts -> src/extension.ts
diff --git a/src/extension.ts b/src/extension.ts
index 427e642c2f25e05636fc1d7f94d64dd3d0eb2be2..1766ec50b831b28d4806907e5645f3bf0c1eefcd 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -112,26 +112,36 @@       provideCompletionItems(
         document: vscode.TextDocument,
         position: vscode.Position
       ): vscode.CompletionItem[] {
+        const separator = config.options.separator || ':'
+        let str
+
         const range: vscode.Range = new vscode.Range(
           new vscode.Position(Math.max(position.line - 5, 0), 0),
           position
         )
         const text: string = document.getText(range)
 
-        let p = prefix
-  '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js'
+import * as vscode from 'vscode'
 const tailwindClassNames = require('tailwind-class-names')
+
 
   '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js'
-const dlv = require('dlv')
+const Color = require('color')
-
+          let parts = matches[matches.length - 1].split(' ')
-  '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js'
+          str = parts[parts.length - 1]
+        } else if (languages.indexOf('html') !== -1) {
+          // match emmet style syntax
+  context.subscriptions.push(intellisense)
 const Color = require('color')
-  '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js'
+  context.subscriptions.push(intellisense)
 const CONFIG_GLOB =
+  context.subscriptions.push(intellisense)
   '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js'
-  '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js'
+          let parts = matches[matches.length - 1].split('.')
+          str = parts[parts.length - 1]
+        }
 
+        if (typeof str !== 'undefined') {
           const pth = str
             .replace(new RegExp(`${separator}`, 'g'), '.')
             .replace(/\.$/, '')
@@ -347,8 +357,8 @@       createCompletionItemProvider(
         this._items,
         HTML_TYPES,
         /\bclass(Name)?=["']([^"']*)$/, // /\bclass(Name)?=(["'])(?!.*?\2)/
-
 import * as vscode from 'vscode'
+  if (!tailwindPackage.length) return null
         tailwind.config
       )
     )