tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/src/extension.ts b/src/extension.ts
index f1a94fe333d818a3ad6d2a7352b7f307ed61255e..427e642c2f25e05636fc1d7f94d64dd3d0eb2be2 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -1,7 +1,7 @@
'use strict'
import * as vscode from 'vscode'
-import { join } from 'path'
+import { join, dirname } from 'path'
const tailwindClassNames = require('tailwind-class-names')
const dlv = require('dlv')
const Color = require('color')
@@ -64,15 +64,20 @@ CONFIG_GLOB,
'**/node_modules/**',
1
)
- if (!files) return null
+
+ if (!files.length) return null
let configPath = files[0].fsPath
- const pluginPath = join(
- vscode.workspace.workspaceFolders[0].uri.fsPath,
- 'node_modules',
- 'tailwindcss'
+ let tailwindPackage = await vscode.workspace.findFiles(
+ '**/node_modules/tailwindcss/package.json',
+ null,
+ 1
)
+
+ if (!tailwindPackage.length) return null
+
+ let pluginPath = dirname(tailwindPackage[0].fsPath)
let tw