File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/language-core/lib/plugins Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,17 @@ const plugin: VueLanguagePlugin = ({ vueCompilerOptions }) => {
8888 return sfc ;
8989
9090 function transformRange ( block : SFCBlock ) {
91- block . loc . start . offset = - 1 ;
92- block . loc . end . offset = - 1 ;
93- for ( const [ start ] of file2VueSourceMap . toSourceLocation ( block . loc . start . offset ) ) {
94- block . loc . start . offset = start ;
91+ const { start, end } = block . loc ;
92+ const startOffset = start . offset ;
93+ const endOffset = end . offset ;
94+ start . offset = - 1 ;
95+ end . offset = - 1 ;
96+ for ( const [ offset ] of file2VueSourceMap . toSourceLocation ( startOffset ) ) {
97+ start . offset = offset ;
9598 break ;
9699 }
97- for ( const [ end ] of file2VueSourceMap . toSourceLocation ( block . loc . end . offset ) ) {
98- block . loc . end . offset = end ;
100+ for ( const [ offset ] of file2VueSourceMap . toSourceLocation ( endOffset ) ) {
101+ end . offset = offset ;
99102 break ;
100103 }
101104 }
You can’t perform that action at this time.
0 commit comments