@@ -16,23 +16,26 @@ export class Settings {
16
16
if ( ! e . affectsConfiguration ( "java.dependency" ) ) {
17
17
return ;
18
18
}
19
- const updatedConfig = workspace . getConfiguration ( "java.dependency" ) ;
19
+ const oldConfig = this . _dependencyConfig ;
20
+ this . _dependencyConfig = workspace . getConfiguration ( "java.dependency" ) ;
20
21
for ( const listener of this . _configurationListeners ) {
21
- listener ( updatedConfig , this . _dependencyConfig ) ;
22
+ listener ( this . _dependencyConfig , oldConfig ) ;
22
23
}
23
- if ( updatedConfig . showOutline !== this . _dependencyConfig . showOutline
24
- || updatedConfig . packagePresentation !== this . _dependencyConfig . packagePresentation
25
- || ( updatedConfig . syncWithFolderExplorer !== this . _dependencyConfig . syncWithFolderExplorer
24
+ } ) ) ;
25
+ this . registerConfigurationListener ( ( updatedConfig , oldConfig ) => {
26
+ if ( updatedConfig . showOutline !== oldConfig . showOutline
27
+ || updatedConfig . packagePresentation !== oldConfig . packagePresentation
28
+ || ( updatedConfig . syncWithFolderExplorer !== oldConfig . syncWithFolderExplorer
26
29
&& updatedConfig . syncWithFolderExplorer ) ) {
27
- this . _dependencyConfig = updatedConfig ;
28
30
commands . executeCommand ( Commands . VIEW_PACKAGE_REFRESH ) ;
29
- } else {
30
- if ( updatedConfig . autoRefresh !== this . _dependencyConfig . autoRefresh ) {
31
- SyncHandler . updateFileWatcher ( updatedConfig . autoRefresh ) ;
32
- }
33
- this . _dependencyConfig = updatedConfig ;
34
31
}
35
- } ) ) ;
32
+ } ) ;
33
+ this . registerConfigurationListener ( ( updatedConfig , oldConfig ) => {
34
+ if ( updatedConfig . autoRefresh !== oldConfig . autoRefresh ) {
35
+ SyncHandler . updateFileWatcher ( updatedConfig . autoRefresh ) ;
36
+ }
37
+ } ) ;
38
+
36
39
SyncHandler . updateFileWatcher ( Settings . autoRefresh ( ) ) ;
37
40
38
41
context . subscriptions . push ( { dispose : ( ) => { this . _configurationListeners = [ ] ; } } ) ;
@@ -100,4 +103,4 @@ enum PackagePresentation {
100
103
Hierarchical = "hierarchical" ,
101
104
}
102
105
103
- type Listener = ( updatedConfig : WorkspaceConfiguration , dependencyConfig : WorkspaceConfiguration ) => void ;
106
+ type Listener = ( updatedConfig : WorkspaceConfiguration , oldConfig : WorkspaceConfiguration ) => void ;
0 commit comments