vscode: postrefactor variable names

This commit is contained in:
veetaha 2020-04-02 03:24:45 +03:00
parent d453281bb2
commit e763b279a8

View file

@ -189,18 +189,18 @@ class AstInspector implements vscode.HoverProvider, Disposable {
provideHover(doc: vscode.TextDocument, hoverPosition: vscode.Position): vscode.ProviderResult<vscode.Hover> { provideHover(doc: vscode.TextDocument, hoverPosition: vscode.Position): vscode.ProviderResult<vscode.Hover> {
if (!this.rustEditor) return; if (!this.rustEditor) return;
const astTextLine = doc.lineAt(hoverPosition.line); const astFileLine = doc.lineAt(hoverPosition.line);
const rustTextRange = this.parseRustTextRange(this.rustEditor.document, astTextLine.text); const rustFileRange = this.parseRustTextRange(this.rustEditor.document, astFileLine.text);
if (!rustTextRange) return; if (!rustFileRange) return;
this.rustEditor.setDecorations(this.astDecorationType, [rustTextRange]); this.rustEditor.setDecorations(this.astDecorationType, [rustFileRange]);
this.rustEditor.revealRange(rustTextRange); this.rustEditor.revealRange(rustFileRange);
const rustSourceCode = this.rustEditor.document.getText(rustTextRange); const rustSourceCode = this.rustEditor.document.getText(rustFileRange);
const astTextRange = this.findAstRange(astTextLine); const astFileRange = this.findAstRange(astFileLine);
return new vscode.Hover(["```rust\n" + rustSourceCode + "\n```"], astTextRange); return new vscode.Hover(["```rust\n" + rustSourceCode + "\n```"], astFileRange);
} }
private findAstRange(astLine: vscode.TextLine) { private findAstRange(astLine: vscode.TextLine) {