aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands.ts
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-05-11 15:15:31 +0100
committerJonas Schievink <[email protected]>2021-05-11 15:15:31 +0100
commita85a2c4d151d9d2e8fb016d76aad99a6ca88bc75 (patch)
tree636c0727298fd9d60a7b2a639c49dca8ba73d813 /editors/code/src/commands.ts
parent9fa9d166d8141bb9ca4fcf0544c49b903fb85e09 (diff)
Allow viewing the crate graph in a webview
Diffstat (limited to 'editors/code/src/commands.ts')
-rw-r--r--editors/code/src/commands.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index 4092435db..8ab259af2 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -429,6 +429,14 @@ export function viewHir(ctx: Ctx): Cmd {
429 }; 429 };
430} 430}
431 431
432export function viewCrateGraph(ctx: Ctx): Cmd {
433 return async () => {
434 const panel = vscode.window.createWebviewPanel("rust-analyzer.crate-graph", "rust-analyzer crate graph", vscode.ViewColumn.Two);
435 const svg = await ctx.client.sendRequest(ra.viewCrateGraph);
436 panel.webview.html = svg;
437 };
438}
439
432// Opens the virtual file that will show the syntax tree 440// Opens the virtual file that will show the syntax tree
433// 441//
434// The contents of the file come from the `TextDocumentContentProvider` 442// The contents of the file come from the `TextDocumentContentProvider`