Skip to content

Commit 609a069

Browse files
committed
Remove some unnecessary code copied from the Syntax Tree command
1 parent db53db8 commit 609a069

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

editors/code/src/commands.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export function syntaxTree(ctx: Ctx): Cmd {
340340
};
341341
}
342342

343-
// Opens the virtual file that will show hir
343+
// Opens the virtual file that will show the HIR of the function containing the cursor position
344344
//
345345
// The contents of the file come from the `TextDocumentContentProvider`
346346
export function viewHir(ctx: Ctx): Cmd {
@@ -384,25 +384,11 @@ export function viewHir(ctx: Ctx): Cmd {
384384
}
385385
};
386386

387-
void new AstInspector(ctx);
388-
389387
ctx.pushCleanup(vscode.workspace.registerTextDocumentContentProvider('rust-analyzer', tdcp));
390-
ctx.pushCleanup(vscode.languages.setLanguageConfiguration("ra_syntax_tree", {
391-
brackets: [["[", ")"]],
392-
}));
393388

394389
return async () => {
395-
const editor = vscode.window.activeTextEditor;
396-
const rangeEnabled = !!editor && !editor.selection.isEmpty;
397-
398-
const uri = rangeEnabled
399-
? vscode.Uri.parse(`${tdcp.uri.toString()}?range=true`)
400-
: tdcp.uri;
401-
402-
const document = await vscode.workspace.openTextDocument(uri);
403-
404-
tdcp.eventEmitter.fire(uri);
405-
390+
const document = await vscode.workspace.openTextDocument(tdcp.uri);
391+
tdcp.eventEmitter.fire(tdcp.uri);
406392
void await vscode.window.showTextDocument(document, {
407393
viewColumn: vscode.ViewColumn.Two,
408394
preserveFocus: true

0 commit comments

Comments
 (0)