File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ import isObject from '../../../util/isObject'
20
20
import { cssObjToAst } from '../../util/cssObjToAst'
21
21
import dset from 'dset'
22
22
import selectorParser from 'postcss-selector-parser'
23
- import { logFull } from '../../util/logFull'
24
23
import { flatten } from '../../../util/array'
24
+ import { getClassNameMeta } from '../../util/getClassNameMeta'
25
25
26
26
export async function provideInvalidApplyCodeActions (
27
27
state : State ,
@@ -180,9 +180,10 @@ function classNameToAst(
180
180
if ( ! baseClassName ) {
181
181
return null
182
182
}
183
- const info = dlv ( state . classNames . classNames , classNameParts )
184
- let context = info . __context || [ ]
185
- let pseudo = info . __pseudo || [ ]
183
+ const meta = getClassNameMeta ( state , classNameParts )
184
+ if ( Array . isArray ( meta ) ) return null
185
+ let context = meta . context
186
+ let pseudo = meta . pseudo
186
187
const globalContexts = state . classNames . context
187
188
let screens = dlv (
188
189
state . config ,
Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ const dlv = require('dlv')
4
4
5
5
export function getClassNameMeta (
6
6
state : State ,
7
- className : string
7
+ classNameOrParts : string | string [ ]
8
8
) : ClassNameMeta | ClassNameMeta [ ] {
9
- const parts = getClassNameParts ( state , className )
9
+ const parts = Array . isArray ( classNameOrParts )
10
+ ? classNameOrParts
11
+ : getClassNameParts ( state , classNameOrParts )
10
12
if ( ! parts ) return null
11
13
const info = dlv ( state . classNames . classNames , parts )
12
14
You can’t perform that action at this time.
0 commit comments