From be0bc4d9b76492c9cffd822b59827097de355a9e Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Tue, 2 May 2023 03:55:33 +0800 Subject: [PATCH] chore: pretty fix for #3101 --- packages/vue-language-core/src/sourceFile.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vue-language-core/src/sourceFile.ts b/packages/vue-language-core/src/sourceFile.ts index 01c80ee0b..97d4621d6 100644 --- a/packages/vue-language-core/src/sourceFile.ts +++ b/packages/vue-language-core/src/sourceFile.ts @@ -468,7 +468,7 @@ export class VueFile implements VirtualFile { const newData: Sfc['template'] | null = block ? { name: 'template', - start: this.snapshot.getText(0, block.loc.start.offset).lastIndexOf('') + 1, startTagEnd: block.loc.start.offset, endTagStart: block.loc.end.offset, @@ -488,7 +488,7 @@ export class VueFile implements VirtualFile { const newData: Sfc['script'] | null = block ? { name: 'script', - start: this.snapshot.getText(0, block.loc.start.offset).lastIndexOf('') + 1, startTagEnd: block.loc.start.offset, endTagStart: block.loc.end.offset, @@ -510,7 +510,7 @@ export class VueFile implements VirtualFile { const newData: Sfc['scriptSetup'] | null = block ? { name: 'scriptSetup', - start: this.snapshot.getText(0, block.loc.start.offset).lastIndexOf('') + 1, startTagEnd: block.loc.start.offset, endTagStart: block.loc.end.offset, @@ -534,7 +534,7 @@ export class VueFile implements VirtualFile { const block = blocks[i]; const newData: Sfc['styles'][number] = { name: 'style_' + i, - start: this.snapshot.getText(0, block.loc.start.offset).lastIndexOf('') + 1, startTagEnd: block.loc.start.offset, endTagStart: block.loc.end.offset, @@ -562,7 +562,7 @@ export class VueFile implements VirtualFile { const block = blocks[i]; const newData: Sfc['customBlocks'][number] = { name: 'customBlock_' + i, - start: this.snapshot.getText(0, block.loc.start.offset).lastIndexOf('<'), + start: this.snapshot.getText(0, block.loc.start.offset).lastIndexOf('<' + block.type), end: block.loc.end.offset + this.snapshot.getText(block.loc.end.offset, this.snapshot.getLength()).indexOf('>') + 1, startTagEnd: block.loc.start.offset, endTagStart: block.loc.end.offset,