tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts b/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts
index bc1be2b9db3a5ef4bebd9b7392d20b51c8e47aaa..23cdbb59f55cf4fe7ffef755e6f14421a81d8fc2 100644
--- a/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts
+++ b/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts
@@ -20,8 +20,8 @@ import isObject from '../../../util/isObject'
import { cssObjToAst } from '../../util/cssObjToAst'
import dset from 'dset'
import selectorParser from 'postcss-selector-parser'
-import { logFull } from '../../util/logFull'
import { flatten } from '../../../util/array'
+import { getClassNameMeta } from '../../util/getClassNameMeta'
export async function provideInvalidApplyCodeActions(
state: State,
@@ -180,9 +180,10 @@ )
if (!baseClassName) {
return null
}
- const info = dlv(state.classNames.classNames, classNameParts)
- let context = info.__context || []
- let pseudo = info.__pseudo || []
+ const meta = getClassNameMeta(state, classNameParts)
+ if (Array.isArray(meta)) return null
+ let context = meta.context
+ let pseudo = meta.pseudo
const globalContexts = state.classNames.context
let screens = dlv(
state.config,
diff --git a/src/lsp/util/getClassNameMeta.ts b/src/lsp/util/getClassNameMeta.ts
index 9ec86cdfd90a3007964aac4c33fd1d855729e26c..1099a1ab85825f114ad20874f36c5991dfb2866b 100644
--- a/src/lsp/util/getClassNameMeta.ts
+++ b/src/lsp/util/getClassNameMeta.ts
@@ -4,9 +4,11 @@ const dlv = require('dlv')
export function getClassNameMeta(
state: State,
- className: string
+ classNameOrParts: string | string[]
): ClassNameMeta | ClassNameMeta[] {
- const parts = getClassNameParts(state, className)
+ const parts = Array.isArray(classNameOrParts)
+ ? classNameOrParts
+ : getClassNameParts(state, classNameOrParts)
if (!parts) return null
const info = dlv(state.classNames.classNames, parts)