about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhil Ellison <phil.j.ellison@gmail.com>2021-01-01 19:35:10 +0000
committerPhil Ellison <phil.j.ellison@gmail.com>2021-01-01 19:35:10 +0000
commit609a069757aa071c377c0e02d7b18b4ff7b32631 (patch)
treeedc2b964bc5e3a00a02e68cadc43f4626505f269
parentdb53db804604574337f80a614565fb964403a654 (diff)
downloadrust-609a069757aa071c377c0e02d7b18b4ff7b32631.tar.gz
rust-609a069757aa071c377c0e02d7b18b4ff7b32631.zip
Remove some unnecessary code copied from the Syntax Tree command
-rw-r--r--editors/code/src/commands.ts20
1 files changed, 3 insertions, 17 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index 21b0c27f30d..2911bccd5e4 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -340,7 +340,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
     };
 }
 
-// Opens the virtual file that will show hir
+// Opens the virtual file that will show the HIR of the function containing the cursor position
 //
 // The contents of the file come from the `TextDocumentContentProvider`
 export function viewHir(ctx: Ctx): Cmd {
@@ -384,25 +384,11 @@ export function viewHir(ctx: Ctx): Cmd {
         }
     };
 
-    void new AstInspector(ctx);
-
     ctx.pushCleanup(vscode.workspace.registerTextDocumentContentProvider('rust-analyzer', tdcp));
-    ctx.pushCleanup(vscode.languages.setLanguageConfiguration("ra_syntax_tree", {
-        brackets: [["[", ")"]],
-    }));
 
     return async () => {
-        const editor = vscode.window.activeTextEditor;
-        const rangeEnabled = !!editor && !editor.selection.isEmpty;
-
-        const uri = rangeEnabled
-            ? vscode.Uri.parse(`${tdcp.uri.toString()}?range=true`)
-            : tdcp.uri;
-
-        const document = await vscode.workspace.openTextDocument(uri);
-
-        tdcp.eventEmitter.fire(uri);
-
+        const document = await vscode.workspace.openTextDocument(tdcp.uri);
+        tdcp.eventEmitter.fire(tdcp.uri);
         void await vscode.window.showTextDocument(document, {
             viewColumn: vscode.ViewColumn.Two,
             preserveFocus: true