@@ -473,10 +473,12 @@ export function viewItemTree(ctx: Ctx): Cmd {
473
473
474
474
function crateGraph ( ctx : Ctx , full : boolean ) : Cmd {
475
475
return async ( ) => {
476
+ let node_modules_path = vscode . Uri . file ( path . join ( ctx . extensionPath , "node_modules" ) ) ;
477
+
476
478
const panel = vscode . window . createWebviewPanel ( "rust-analyzer.crate-graph" , "rust-analyzer crate graph" , vscode . ViewColumn . Two , {
477
479
enableScripts : true ,
478
480
retainContextWhenHidden : true ,
479
- localResourceRoots : [ vscode . Uri . joinPath ( vscode . Uri . parse ( ctx . extensionPath ) , "node_modules" ) ]
481
+ localResourceRoots : [ node_modules_path ]
480
482
} ) ;
481
483
const params = {
482
484
full : full ,
@@ -486,9 +488,9 @@ function crateGraph(ctx: Ctx, full: boolean): Cmd {
486
488
console . log ( dot ) ;
487
489
488
490
let scripts = [
489
- { file : vscode . Uri . file ( path . join ( ctx . extensionPath , 'node_modules' , ' d3', 'dist' , 'd3.min.js' ) ) } ,
490
- { file : vscode . Uri . file ( path . join ( ctx . extensionPath , 'node_modules' , ' @hpcc-js', 'wasm' , 'dist' , 'index.min.js' ) ) , worker : true } ,
491
- { file : vscode . Uri . file ( path . join ( ctx . extensionPath , 'node_modules' , ' d3-graphviz', 'build' , 'd3-graphviz.min.js' ) ) } ,
491
+ { file : vscode . Uri . joinPath ( node_modules_path , 'd3' , 'dist' , 'd3.min.js' ) } ,
492
+ { file : vscode . Uri . joinPath ( node_modules_path , '@hpcc-js' , 'wasm' , 'dist' , 'index.min.js' ) , worker : true } ,
493
+ { file : vscode . Uri . joinPath ( node_modules_path , 'd3-graphviz' , 'build' , 'd3-graphviz.min.js' ) } ,
492
494
]
493
495
console . log ( scripts ) ;
494
496
0 commit comments