File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
import * as vscode from 'vscode'
4
- import { join } from 'path'
4
+ import { join , dirname } from 'path'
5
5
const tailwindClassNames = require ( 'tailwind-class-names' )
6
6
const dlv = require ( 'dlv' )
7
7
const Color = require ( 'color' )
@@ -64,16 +64,21 @@ async function getTailwind() {
64
64
'**/node_modules/**' ,
65
65
1
66
66
)
67
- if ( ! files ) return null
67
+
68
+ if ( ! files . length ) return null
68
69
69
70
let configPath = files [ 0 ] . fsPath
70
71
71
- const pluginPath = join (
72
- vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath ,
73
- 'node_modules' ,
74
- 'tailwindcss'
72
+ let tailwindPackage = await vscode . workspace . findFiles (
73
+ '**/node_modules/tailwindcss/package.json' ,
74
+ null ,
75
+ 1
75
76
)
76
77
78
+ if ( ! tailwindPackage . length ) return null
79
+
80
+ let pluginPath = dirname ( tailwindPackage [ 0 ] . fsPath )
81
+
77
82
let tw
78
83
79
84
try {
You can’t perform that action at this time.
0 commit comments