Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r--editors/code/src/ctx.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 96dc4f19b8..4248305d5c 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -384,9 +384,7 @@ export class Ctx implements RustAnalyzerExtensionApi {
return;
}
- const start = e.textEditor.document.offsetAt(selection.start);
- const end = e.textEditor.document.offsetAt(selection.end);
- const result = this.syntaxTreeProvider?.getElementByRange(start, end);
+ const result = this.syntaxTreeProvider?.getElementByRange(selection);
if (result !== undefined) {
await this.syntaxTreeView?.reveal(result);
}