diff options
-rw-r--r-- | editors/code/src/commands/syntax_tree.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts index eba511193..e443c5e54 100644 --- a/editors/code/src/commands/syntax_tree.ts +++ b/editors/code/src/commands/syntax_tree.ts | |||
@@ -127,6 +127,7 @@ class AstInspector implements vscode.HoverProvider, Disposable { | |||
127 | if (!rustTextRange) return; | 127 | if (!rustTextRange) return; |
128 | 128 | ||
129 | this.rustEditor.setDecorations(AstInspector.astDecorationType, [rustTextRange]); | 129 | this.rustEditor.setDecorations(AstInspector.astDecorationType, [rustTextRange]); |
130 | this.rustEditor.revealRange(rustTextRange); | ||
130 | 131 | ||
131 | const rustSourceCode = this.rustEditor.document.getText(rustTextRange); | 132 | const rustSourceCode = this.rustEditor.document.getText(rustTextRange); |
132 | const astTextRange = this.findAstRange(astTextLine); | 133 | const astTextRange = this.findAstRange(astTextLine); |
@@ -145,7 +146,7 @@ class AstInspector implements vscode.HoverProvider, Disposable { | |||
145 | const parsedRange = /\[(\d+); (\d+)\)/.exec(astLine); | 146 | const parsedRange = /\[(\d+); (\d+)\)/.exec(astLine); |
146 | if (!parsedRange) return; | 147 | if (!parsedRange) return; |
147 | 148 | ||
148 | const [, begin, end] = parsedRange.map(off => doc.positionAt(+off)); | 149 | const [begin, end] = parsedRange.slice(1).map(off => doc.positionAt(+off)); |
149 | 150 | ||
150 | return new vscode.Range(begin, end); | 151 | return new vscode.Range(begin, end); |
151 | } | 152 | } |