Skip to content

Commit

Permalink
fix: vue blocks document symbols range incorrect
Browse files Browse the repository at this point in the history
close #2118
  • Loading branch information
johnsoncodehk committed Nov 29, 2022
1 parent 0ae6ef6 commit 6ab3722
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vue-language-tools/vue-language-service/src/plugins/vue.ts
Expand Up @@ -199,8 +199,8 @@ export default function (options: {
name: 'template',
kind: vscode.SymbolKind.Module,
location: vscode.Location.create(document.uri, vscode.Range.create(
document.positionAt(descriptor.template.startTagEnd),
document.positionAt(descriptor.template.startTagEnd + descriptor.template.content.length),
document.positionAt(descriptor.template.start),
document.positionAt(descriptor.template.end),
)),
});
}
Expand All @@ -209,8 +209,8 @@ export default function (options: {
name: 'script',
kind: vscode.SymbolKind.Module,
location: vscode.Location.create(document.uri, vscode.Range.create(
document.positionAt(descriptor.script.startTagEnd),
document.positionAt(descriptor.script.startTagEnd + descriptor.script.content.length),
document.positionAt(descriptor.script.start),
document.positionAt(descriptor.script.end),
)),
});
}
Expand All @@ -219,8 +219,8 @@ export default function (options: {
name: 'script setup',
kind: vscode.SymbolKind.Module,
location: vscode.Location.create(document.uri, vscode.Range.create(
document.positionAt(descriptor.scriptSetup.startTagEnd),
document.positionAt(descriptor.scriptSetup.startTagEnd + descriptor.scriptSetup.content.length),
document.positionAt(descriptor.scriptSetup.start),
document.positionAt(descriptor.scriptSetup.end),
)),
});
}
Expand All @@ -229,8 +229,8 @@ export default function (options: {
name: `${['style', style.scoped ? 'scoped' : undefined, style.module ? 'module' : undefined].filter(shared.notEmpty).join(' ')}`,
kind: vscode.SymbolKind.Module,
location: vscode.Location.create(document.uri, vscode.Range.create(
document.positionAt(style.startTagEnd),
document.positionAt(style.startTagEnd + style.content.length),
document.positionAt(style.start),
document.positionAt(style.end),
)),
});
}
Expand All @@ -239,8 +239,8 @@ export default function (options: {
name: `${customBlock.type}`,
kind: vscode.SymbolKind.Module,
location: vscode.Location.create(document.uri, vscode.Range.create(
document.positionAt(customBlock.startTagEnd),
document.positionAt(customBlock.startTagEnd + customBlock.content.length),
document.positionAt(customBlock.start),
document.positionAt(customBlock.end),
)),
});
}
Expand Down

0 comments on commit 6ab3722

Please sign in to comment.