mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Formatting issues
This commit is contained in:
parent
5e571a375b
commit
11bbaecca0
@ -3,7 +3,7 @@
|
||||
//! `ide` crate.
|
||||
|
||||
use std::{
|
||||
io::{Write as _},
|
||||
io::Write as _,
|
||||
process::{self, Stdio},
|
||||
};
|
||||
|
||||
|
@ -473,12 +473,12 @@ export function viewItemTree(ctx: Ctx): Cmd {
|
||||
|
||||
function crateGraph(ctx: Ctx, full: boolean): Cmd {
|
||||
return async () => {
|
||||
const node_modules_path = vscode.Uri.file(path.join(ctx.extensionPath, "node_modules"));
|
||||
const nodeModulesPath = vscode.Uri.file(path.join(ctx.extensionPath, "node_modules"));
|
||||
|
||||
const panel = vscode.window.createWebviewPanel("rust-analyzer.crate-graph", "rust-analyzer crate graph", vscode.ViewColumn.Two, {
|
||||
enableScripts: true,
|
||||
retainContextWhenHidden: true,
|
||||
localResourceRoots: [node_modules_path]
|
||||
localResourceRoots: [nodeModulesPath]
|
||||
});
|
||||
const params = {
|
||||
full: full,
|
||||
@ -487,15 +487,15 @@ function crateGraph(ctx: Ctx, full: boolean): Cmd {
|
||||
const dot = await ctx.client.sendRequest(ra.viewCrateGraph, params);
|
||||
|
||||
const scripts = [
|
||||
{ file: vscode.Uri.joinPath(node_modules_path, 'd3', 'dist', 'd3.min.js') },
|
||||
{ file: vscode.Uri.joinPath(node_modules_path, '@hpcc-js', 'wasm', 'dist', 'index.min.js'), worker: true },
|
||||
{ file: vscode.Uri.joinPath(node_modules_path, 'd3-graphviz', 'build', 'd3-graphviz.min.js') },
|
||||
]
|
||||
{ file: vscode.Uri.joinPath(nodeModulesPath, 'd3', 'dist', 'd3.min.js') },
|
||||
{ file: vscode.Uri.joinPath(nodeModulesPath, '@hpcc-js', 'wasm', 'dist', 'index.min.js'), worker: true },
|
||||
{ file: vscode.Uri.joinPath(nodeModulesPath, 'd3-graphviz', 'build', 'd3-graphviz.min.js') },
|
||||
];
|
||||
|
||||
const scripts_html = scripts.map(({ file, worker }) => {
|
||||
let uri = panel.webview.asWebviewUri(file);
|
||||
return `<script type="${worker ? "javascript/worker" : "text/javascript"}" src="${uri}"></script>`
|
||||
}).join("\n")
|
||||
const scriptsHtml = scripts.map(({ file, worker }) => {
|
||||
const uri = panel.webview.asWebviewUri(file);
|
||||
return `<script type="${worker ? "javascript/worker" : "text/javascript"}" src="${uri}"></script>`;
|
||||
}).join("\n");
|
||||
|
||||
const html = `
|
||||
<!DOCTYPE html>
|
||||
@ -515,7 +515,7 @@ function crateGraph(ctx: Ctx, full: boolean): Cmd {
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${scripts_html}
|
||||
${scriptsHtml}
|
||||
<div id="graph"></div>
|
||||
<script>
|
||||
let graph = d3.select("#graph")
|
||||
|
Loading…
Reference in New Issue
Block a user