1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Licensed under the MIT license.
3
3
4
- import { commands , ConfigurationChangeEvent , ExtensionContext , workspace , WorkspaceConfiguration } from "vscode" ;
4
+ import { commands , ConfigurationChangeEvent , ExtensionContext , workspace , WorkspaceConfiguration , window , DocumentHighlight , Disposable } from "vscode" ;
5
5
import { instrumentOperation } from "vscode-extension-telemetry-wrapper" ;
6
6
import { Commands } from "./commands" ;
7
+ import { SyncHandler } from "./fileWather" ;
7
8
8
9
export class Settings {
9
10
@@ -20,9 +21,13 @@ export class Settings {
20
21
this . _dependencyConfig = updatedConfig ;
21
22
commands . executeCommand ( Commands . VIEW_PACKAGE_REFRESH ) ;
22
23
} else {
24
+ if ( updatedConfig . autoRefresh !== this . _dependencyConfig . autoRefresh ) {
25
+ SyncHandler . updateFileWatcher ( updatedConfig . autoRefresh ) ;
26
+ }
23
27
this . _dependencyConfig = updatedConfig ;
24
28
}
25
29
} ) ) ;
30
+ SyncHandler . updateFileWatcher ( Settings . autoRefresh ( ) ) ;
26
31
27
32
context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_LINKWITHFOLDER ,
28
33
instrumentOperation ( Commands . VIEW_PACKAGE_LINKWITHFOLDER , Settings . linkWithFolderCommand ) ) ) ;
@@ -57,6 +62,10 @@ export class Settings {
57
62
return this . _dependencyConfig . get ( "showOutline" ) ;
58
63
}
59
64
65
+ public static autoRefresh ( ) : boolean {
66
+ return this . _dependencyConfig . get ( "autoRefresh" ) ;
67
+ }
68
+
60
69
public static syncWithFolderExplorer ( ) : boolean {
61
70
return this . _dependencyConfig . get ( "syncWithFolderExplorer" ) ;
62
71
}
0 commit comments