@@ -45,12 +45,11 @@ export function parseScriptSetupRanges(
45
45
inheritAttrs ?: string ;
46
46
} = { } ;
47
47
const cssModules : {
48
- exp : TextRange ;
49
- arg ?: TextRange ;
48
+ define : ReturnType < typeof parseDefineFunction > ;
50
49
} [ ] = [ ] ;
51
50
const templateRefs : {
52
51
name ?: string ;
53
- define ? : ReturnType < typeof parseDefineFunction > ;
52
+ define : ReturnType < typeof parseDefineFunction > ;
54
53
} [ ] = [ ] ;
55
54
const definePropProposalA = vueCompilerOptions . experimentalDefinePropProposal === 'kevinEdition' || ast . text . trimStart ( ) . startsWith ( '// @experimentalDefinePropProposal=kevinEdition' ) ;
56
55
const definePropProposalB = vueCompilerOptions . experimentalDefinePropProposal === 'johnsonEdition' || ast . text . trimStart ( ) . startsWith ( '// @experimentalDefinePropProposal=johnsonEdition' ) ;
@@ -130,11 +129,13 @@ export function parseScriptSetupRanges(
130
129
}
131
130
132
131
function parseDefineFunction ( node : ts . CallExpression ) : TextRange & {
132
+ exp : TextRange ;
133
133
arg ?: TextRange ;
134
134
typeArg ?: TextRange ;
135
135
} {
136
136
return {
137
137
..._getStartEnd ( node ) ,
138
+ exp : _getStartEnd ( node . expression ) ,
138
139
arg : node . arguments . length ? _getStartEnd ( node . arguments [ 0 ] ) : undefined ,
139
140
typeArg : node . typeArguments ?. length ? _getStartEnd ( node . typeArguments [ 0 ] ) : undefined ,
140
141
} ;
@@ -371,7 +372,6 @@ export function parseScriptSetupRanges(
371
372
}
372
373
} else if ( vueCompilerOptions . composibles . useTemplateRef . includes ( callText ) && node . arguments . length && ! node . typeArguments ?. length ) {
373
374
const define = parseDefineFunction ( node ) ;
374
- define . arg = _getStartEnd ( node . arguments [ 0 ] ) ;
375
375
let name ;
376
376
if ( ts . isVariableDeclaration ( parent ) ) {
377
377
name = getNodeText ( ts , parent . name , ast ) ;
@@ -382,13 +382,10 @@ export function parseScriptSetupRanges(
382
382
} ) ;
383
383
}
384
384
else if ( vueCompilerOptions . composibles . useCssModule . includes ( callText ) ) {
385
- const module : ( typeof cssModules ) [ number ] = {
386
- exp : _getStartEnd ( node )
387
- } ;
388
- if ( node . arguments . length ) {
389
- module . arg = _getStartEnd ( node . arguments [ 0 ] ) ;
390
- }
391
- cssModules . push ( module ) ;
385
+ const define = parseDefineFunction ( node ) ;
386
+ cssModules . push ( {
387
+ define
388
+ } ) ;
392
389
}
393
390
}
394
391
ts . forEachChild ( node , child => {
0 commit comments