mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add "View Crate Graph (Full)"
This commit is contained in:
parent
76d8f55952
commit
5f13fb9db9
9 changed files with 58 additions and 15 deletions
|
@ -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`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue