aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/commands/syntax_tree.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts
index c1af7122f..7b58cf788 100644
--- a/editors/code/src/commands/syntax_tree.ts
+++ b/editors/code/src/commands/syntax_tree.ts
@@ -189,18 +189,18 @@ class AstInspector implements vscode.HoverProvider, Disposable {
189 provideHover(doc: vscode.TextDocument, hoverPosition: vscode.Position): vscode.ProviderResult<vscode.Hover> { 189 provideHover(doc: vscode.TextDocument, hoverPosition: vscode.Position): vscode.ProviderResult<vscode.Hover> {
190 if (!this.rustEditor) return; 190 if (!this.rustEditor) return;
191 191
192 const astTextLine = doc.lineAt(hoverPosition.line); 192 const astFileLine = doc.lineAt(hoverPosition.line);
193 193
194 const rustTextRange = this.parseRustTextRange(this.rustEditor.document, astTextLine.text); 194 const rustFileRange = this.parseRustTextRange(this.rustEditor.document, astFileLine.text);
195 if (!rustTextRange) return; 195 if (!rustFileRange) return;
196 196
197 this.rustEditor.setDecorations(this.astDecorationType, [rustTextRange]); 197 this.rustEditor.setDecorations(this.astDecorationType, [rustFileRange]);
198 this.rustEditor.revealRange(rustTextRange); 198 this.rustEditor.revealRange(rustFileRange);
199 199
200 const rustSourceCode = this.rustEditor.document.getText(rustTextRange); 200 const rustSourceCode = this.rustEditor.document.getText(rustFileRange);
201 const astTextRange = this.findAstRange(astTextLine); 201 const astFileRange = this.findAstRange(astFileLine);
202 202
203 return new vscode.Hover(["```rust\n" + rustSourceCode + "\n```"], astTextRange); 203 return new vscode.Hover(["```rust\n" + rustSourceCode + "\n```"], astFileRange);
204 } 204 }
205 205
206 private findAstRange(astLine: vscode.TextLine) { 206 private findAstRange(astLine: vscode.TextLine) {