Add "View Crate Graph (Full)"

This commit is contained in:
Jonas Schievink 2021-07-02 00:08:05 +02:00
parent 76d8f55952
commit 5f13fb9db9
9 changed files with 58 additions and 15 deletions

View file

@ -479,14 +479,25 @@ export function viewItemTree(ctx: Ctx): Cmd {
};
}
export function viewCrateGraph(ctx: Ctx): Cmd {
function crateGraph(ctx: Ctx, full: boolean): Cmd {
return async () => {
const panel = vscode.window.createWebviewPanel("rust-analyzer.crate-graph", "rust-analyzer crate graph", vscode.ViewColumn.Two);
const svg = await ctx.client.sendRequest(ra.viewCrateGraph);
const params = {
full: full,
};
const svg = await ctx.client.sendRequest(ra.viewCrateGraph, params);
panel.webview.html = svg;
};
}
export function viewCrateGraph(ctx: Ctx): Cmd {
return crateGraph(ctx, false);
}
export function viewFullCrateGraph(ctx: Ctx): Cmd {
return crateGraph(ctx, true);
}
// Opens the virtual file that will show the syntax tree
//
// The contents of the file come from the `TextDocumentContentProvider`