@@ -12,6 +12,7 @@ import {
12
12
ShowModuleHierarchy ,
13
13
GenerateDependencyInjectionGraph
14
14
} from '@commands' ;
15
+ import { GraphState } from '@model' ;
15
16
16
17
export function activate ( context : vscode . ExtensionContext ) {
17
18
@@ -48,6 +49,7 @@ export function activate(context: vscode.ExtensionContext) {
48
49
context . subscriptions . push ( componentHierarchyMarkdownDisposable ) ;
49
50
50
51
let componentHierarchyPanel : vscode . WebviewPanel | undefined = undefined ;
52
+ const componentHierarchyGraphState : GraphState = new GraphState ( ) ;
51
53
const showComponentHierarchyDisposable = vscode . commands . registerCommand ( `${ cmdPrefix } .${ ShowComponentHierarchy . commandName } ` , ( ) => {
52
54
if ( componentHierarchyPanel !== undefined ) {
53
55
componentHierarchyPanel . reveal ( vscode . ViewColumn . One ) ;
@@ -64,12 +66,13 @@ export function activate(context: vscode.ExtensionContext) {
64
66
} , null , context . subscriptions ) ;
65
67
}
66
68
componentHierarchyPanel . onDidDispose ( ( ) => componentHierarchyPanel = undefined , undefined , context . subscriptions ) ;
67
- const command = new ShowComponentHierarchy ( context ) ;
69
+ const command = new ShowComponentHierarchy ( context , componentHierarchyGraphState ) ;
68
70
command . execute ( componentHierarchyPanel . webview ) ;
69
71
} ) ;
70
72
context . subscriptions . push ( showComponentHierarchyDisposable ) ;
71
73
72
74
let moduleHierarchyPanel : vscode . WebviewPanel | undefined = undefined ;
75
+ const moduleHierarchyGraphState : GraphState = new GraphState ( ) ;
73
76
const showModuleHierarchyDisposable = vscode . commands . registerCommand ( `${ cmdPrefix } .${ ShowModuleHierarchy . commandName } ` , ( ) => {
74
77
if ( moduleHierarchyPanel !== undefined ) {
75
78
moduleHierarchyPanel . reveal ( vscode . ViewColumn . One ) ;
@@ -86,12 +89,13 @@ export function activate(context: vscode.ExtensionContext) {
86
89
} , null , context . subscriptions ) ;
87
90
}
88
91
moduleHierarchyPanel . onDidDispose ( ( ) => moduleHierarchyPanel = undefined , undefined , context . subscriptions ) ;
89
- const command = new ShowModuleHierarchy ( context ) ;
92
+ const command = new ShowModuleHierarchy ( context , moduleHierarchyGraphState ) ;
90
93
command . execute ( moduleHierarchyPanel . webview ) ;
91
94
} ) ;
92
95
context . subscriptions . push ( showModuleHierarchyDisposable ) ;
93
96
94
97
let dependencyInjectionGraphPanel : vscode . WebviewPanel | undefined = undefined ;
98
+ const dependencyInjectionGraphState : GraphState = new GraphState ( ) ;
95
99
const generateDependencyInjectionGraphDisposable = vscode . commands . registerCommand ( `${ cmdPrefix } .${ GenerateDependencyInjectionGraph . commandName } ` , ( ) => {
96
100
if ( dependencyInjectionGraphPanel !== undefined ) {
97
101
dependencyInjectionGraphPanel . reveal ( vscode . ViewColumn . One ) ;
@@ -108,7 +112,7 @@ export function activate(context: vscode.ExtensionContext) {
108
112
} , null , context . subscriptions ) ;
109
113
}
110
114
dependencyInjectionGraphPanel . onDidDispose ( ( ) => dependencyInjectionGraphPanel = undefined , undefined , context . subscriptions ) ;
111
- const command = new GenerateDependencyInjectionGraph ( context ) ;
115
+ const command = new GenerateDependencyInjectionGraph ( context , dependencyInjectionGraphState ) ;
112
116
command . execute ( dependencyInjectionGraphPanel . webview ) ;
113
117
} ) ;
114
118
context . subscriptions . push ( generateDependencyInjectionGraphDisposable ) ;
0 commit comments