1
1
import * as vscode from 'vscode' ;
2
2
import * as fs from 'fs' ;
3
3
import * as path from 'path' ;
4
- import { FileSystemUtils } from "../filesystemUtils" ;
4
+ import { FileSystemUtils } from "../../ filesystemUtils" ;
5
5
6
6
class Component {
7
7
@@ -95,10 +95,10 @@ export class ShowComponentHierarchy {
95
95
96
96
try {
97
97
const jsContent = this . generateJavascriptContent ( nodesJson , rootNodesJson , edgesJson ) ;
98
- const outputJsFilename = 'showComponentHierarchy.js' ;
98
+ const outputJsFilename = 'showComponentHierarchy/showComponentHierarchy .js' ;
99
99
let htmlContent = this . generateHtmlContent ( webview , outputJsFilename ) ;
100
100
101
- // fsUtils.writeFile(this.extensionContext?.asAbsolutePath(path.join('src', 'commands', 'showComponentHierarchy.html')), htmlContent, () => { } ); // For debugging
101
+ fsUtils . writeFile ( this . extensionContext ?. asAbsolutePath ( path . join ( 'src' , 'commands' , 'showComponentHierarchy/ showComponentHierarchy.html' ) ) , htmlContent , ( ) => { } ) ; // For debugging
102
102
fsUtils . writeFile (
103
103
this . extensionContext ?. asAbsolutePath ( path . join ( 'src' , 'commands' , outputJsFilename ) ) ,
104
104
jsContent ,
@@ -222,7 +222,7 @@ export class ShowComponentHierarchy {
222
222
}
223
223
224
224
private generateJavascriptContent ( nodesJson : string , rootNodesJson : string , edgesJson : string ) : string {
225
- const templateJsFilename = 'showComponentHierarchy_Template.js' ;
225
+ const templateJsFilename = 'showComponentHierarchy/ showComponentHierarchy_Template.js' ;
226
226
let template = fs . readFileSync ( this . extensionContext ?. asAbsolutePath ( path . join ( 'src' , 'commands' , templateJsFilename ) ) , 'utf8' ) ;
227
227
let jsContent = template . replace ( 'var nodes = new vis.DataSet([]);' , `var nodes = new vis.DataSet([${ nodesJson } ]);` ) ;
228
228
jsContent = jsContent . replace ( 'var rootNodes = [];' , `var rootNodes = [${ rootNodesJson } ];` ) ;
@@ -231,14 +231,14 @@ export class ShowComponentHierarchy {
231
231
}
232
232
233
233
private generateHtmlContent ( webview : vscode . Webview , outputJsFilename : string ) : string {
234
- const templateHtmlFilename = 'showComponentHierarchy_Template.html' ;
234
+ const templateHtmlFilename = 'showComponentHierarchy/ showComponentHierarchy_Template.html' ;
235
235
let htmlContent = fs . readFileSync ( this . extensionContext ?. asAbsolutePath ( path . join ( 'src' , 'commands' , templateHtmlFilename ) ) , 'utf8' ) ;
236
236
237
- const visPath = vscode . Uri . joinPath ( this . extensionContext . extensionUri , 'src' , 'commands' , 'vis-network.min.js' ) ;
237
+ const visPath = vscode . Uri . joinPath ( this . extensionContext . extensionUri , 'src' , 'commands' , 'showComponentHierarchy/ vis-network.min.js' ) ;
238
238
const visUri = webview . asWebviewUri ( visPath ) ;
239
239
htmlContent = htmlContent . replace ( 'vis-network.min.js' , visUri . toString ( ) ) ;
240
240
241
- const cssPath = vscode . Uri . joinPath ( this . extensionContext . extensionUri , 'src' , 'commands' , 'showComponentHierarchy.css' ) ;
241
+ const cssPath = vscode . Uri . joinPath ( this . extensionContext . extensionUri , 'src' , 'commands' , 'showComponentHierarchy/showComponentHierarchy .css' ) ;
242
242
const cssUri = webview . asWebviewUri ( cssPath ) ;
243
243
htmlContent = htmlContent . replace ( 'showComponentHierarchy.css' , cssUri . toString ( ) ) ;
244
244
0 commit comments