Skip to content

Commit

Permalink
chore: pretty fix for #3101
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed May 1, 2023
1 parent 8b34cd0 commit be0bc4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vue-language-core/src/sourceFile.ts
Expand Up @@ -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('<template'),
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,
Expand All @@ -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('<script'),
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,
Expand All @@ -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('<script'),
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,
Expand All @@ -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('<style'),
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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit be0bc4d

Please sign in to comment.