@@ -65,7 +65,7 @@ export function generate(
65
65
allowTypeNarrowingInEventExpressions : boolean ,
66
66
hasScriptSetup : boolean ,
67
67
cssScopedClasses : string [ ] = [ ] ,
68
- htmlToTemplate : ( htmlStart : number , htmlEnd : number ) => { start : number , end : number ; } | undefined ,
68
+ htmlToTemplate : ( htmlRange : { start : number , end : number ; } ) => { start : number , end : number ; } | undefined ,
69
69
searchTexts : {
70
70
getEmitCompletion ( tag : string ) : string ,
71
71
getPropsCompletion ( tag : string ) : string ,
@@ -228,7 +228,7 @@ export function generate(
228
228
tagResolves [ tagName ] = {
229
229
component : var_rawComponent ,
230
230
emit : var_emit ,
231
- offsets : tagOffsets . map ( offset => htmlToTemplate ( offset , offset ) ?. start ) . filter ( notEmpty ) ,
231
+ offsets : tagOffsets . map ( offset => htmlToTemplate ( { start : offset , end : offset } ) ?. start ) . filter ( notEmpty ) ,
232
232
} ;
233
233
}
234
234
@@ -1182,7 +1182,7 @@ export function generate(
1182
1182
end : prop . arg . loc . start . offset + end ,
1183
1183
} ;
1184
1184
1185
- const newStart = htmlToTemplate ( sourceRange . start , sourceRange . end ) ?. start ;
1185
+ const newStart = htmlToTemplate ( { start : sourceRange . start , end : sourceRange . end } ) ?. start ;
1186
1186
if ( newStart === undefined ) continue ;
1187
1187
const offset = newStart - sourceRange . start ;
1188
1188
sourceRange . start += offset ;
@@ -1847,7 +1847,7 @@ export function generate(
1847
1847
function addMapping ( gen : typeof tsCodeGen , mapping : SourceMaps . Mapping < EmbeddedFileMappingData > ) {
1848
1848
const newMapping = { ...mapping } ;
1849
1849
1850
- const templateStart = htmlToTemplate ( mapping . sourceRange . start , mapping . sourceRange . end ) ?. start ;
1850
+ const templateStart = htmlToTemplate ( mapping . sourceRange ) ?. start ;
1851
1851
if ( templateStart === undefined ) return ; // not found
1852
1852
const offset = templateStart - mapping . sourceRange . start ;
1853
1853
newMapping . sourceRange = {
@@ -1858,7 +1858,7 @@ export function generate(
1858
1858
if ( mapping . additional ) {
1859
1859
newMapping . additional = [ ] ;
1860
1860
for ( const other of mapping . additional ) {
1861
- let otherTemplateStart = htmlToTemplate ( other . sourceRange . start , other . sourceRange . end ) ?. start ;
1861
+ let otherTemplateStart = htmlToTemplate ( other . sourceRange ) ?. start ;
1862
1862
if ( otherTemplateStart === undefined ) continue ;
1863
1863
const otherOffset = otherTemplateStart - other . sourceRange . start ;
1864
1864
newMapping . additional . push ( {
0 commit comments