Skip to content

Commit

Permalink
Auto merge of rust-lang#14560 - Veykril:view-crate-graph, r=Veykril
Browse files Browse the repository at this point in the history
fix: Fix view crate graph being broken due to webworker usage

Fixes rust-lang/rust-analyzer#14457
  • Loading branch information
bors committed Apr 13, 2023
2 parents 05a6286 + 7a6d5c6 commit 1605911
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"anser": "^2.1.1",
"d3": "^7.6.1",
"d3-graphviz": "^5.0.2",
"vscode-languageclient": "^8.0.2"
"vscode-languageclient": "^8.0.2",
"@hpcc-js/wasm": "2.5.0"
},
"devDependencies": {
"@types/node": "~16.11.7",
Expand Down
4 changes: 2 additions & 2 deletions editors/code/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,12 +663,12 @@ function crateGraph(ctx: CtxInit, full: boolean): Cmd {
</head>
<body>
<script type="text/javascript" src="${uri}/d3/dist/d3.min.js"></script>
<script type="text/javascript" src="${uri}/@hpcc-js/wasm/dist/index.min.js"></script>
<script type="text/javascript" src="${uri}/@hpcc-js/wasm/dist/graphviz.umd.js"></script>
<script type="text/javascript" src="${uri}/d3-graphviz/build/d3-graphviz.min.js"></script>
<div id="graph"></div>
<script>
let graph = d3.select("#graph")
.graphviz()
.graphviz({ useWorker: false, useSharedWorker: false })
.fit(true)
.zoomScaleExtent([0.1, Infinity])
.renderDot(\`${dot}\`);
Expand Down

0 comments on commit 1605911

Please sign in to comment.