diff --git a/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts b/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts index 346f2462f95b77ba7635ba884bb65bfaa087a8d3..22c66036db3c9fbb8345ccd33311ca842cf92f77 100644 --- a/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts +++ b/src/lsp/providers/codeActions/provideInvalidApplyCodeActions.ts @@ -22,7 +22,6 @@ import dset from 'dset' import selectorParser from 'postcss-selector-parser' import { flatten } from '../../../util/array' import { getClassNameMeta } from '../../util/getClassNameMeta' -import { validateApply } from '../../util/validateApply' export async function provideInvalidApplyCodeActions( state: State, @@ -174,12 +173,11 @@ classNameParts: string[], selector: string, important: boolean = false ) { - const baseClassName = classNameParts[classNameParts.length - 1] - const validatedBaseClassName = validateApply(state, [baseClassName]) - if ( - validatedBaseClassName === null || - validatedBaseClassName.isApplyable === false - ) { + const baseClassName = dlv( + state.classNames.classNames, + classNameParts[classNameParts.length - 1] + ) + if (!baseClassName) { return null } const meta = getClassNameMeta(state, classNameParts) @@ -218,7 +216,9 @@ if (selector === null) return null let rule = { [selector]: { - [`@apply ${baseClassName}${important ? ' !important' : ''}`]: '', + [`@apply ${classNameParts[classNameParts.length - 1]}${ + important ? ' !important' : '' + }`]: '', }, } if (path.length) {