diff --git a/src/extension.ts b/src/extension.ts index 1766ec50b831b28d4806907e5645f3bf0c1eefcd..427e642c2f25e05636fc1d7f94d64dd3d0eb2be2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -112,35 +112,26 @@ 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 +const CONFIG_GLOB = '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js' -const dlv = require('dlv') + context.subscriptions.push(intellisense) '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js' -const Color = require('color') - let parts = matches[matches.length - 1].split(' ') + '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js' - '**/{tailwind,tailwind.config,tailwind-config,.tailwindrc}.js' +const Color = require('color') -const JS_TYPES = ['typescriptreact', 'javascript', 'javascriptreact'] + let watcher = vscode.workspace.createFileSystemWatcher(CONFIG_GLOB) - // match emmet style syntax - // e.g. .flex.items-center -const JS_TYPES = ['typescriptreact', 'javascript', 'javascriptreact'] import * as vscode from 'vscode' +const dlv = require('dlv') 'use strict' -import { join, dirname } from 'path' - 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(/\.$/, '') @@ -355,9 +347,8 @@ createCompletionItemProvider( this._items, HTML_TYPES, /\bclass(Name)?=["']([^"']*)$/, // /\bclass(Name)?=(["'])(?!.*?\2)/ - import * as vscode from 'vscode' -const Color = require('color') + if (!tailwindPackage.length) return null tailwind.config ) )