11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33
4- import { commands , ConfigurationChangeEvent , ExtensionContext , workspace , WorkspaceConfiguration } from "vscode" ;
4+ import { commands , ConfigurationChangeEvent , ExtensionContext , workspace , WorkspaceConfiguration , window , DocumentHighlight , Disposable } from "vscode" ;
55import { instrumentOperation } from "vscode-extension-telemetry-wrapper" ;
66import { Commands } from "./commands" ;
7+ import { SyncHandler } from "./fileWather" ;
78
89export class Settings {
910
@@ -20,9 +21,13 @@ export class Settings {
2021 this . _dependencyConfig = updatedConfig ;
2122 commands . executeCommand ( Commands . VIEW_PACKAGE_REFRESH ) ;
2223 } else {
24+ if ( updatedConfig . autoRefresh !== this . _dependencyConfig . autoRefresh ) {
25+ SyncHandler . updateFileWatcher ( updatedConfig . autoRefresh ) ;
26+ }
2327 this . _dependencyConfig = updatedConfig ;
2428 }
2529 } ) ) ;
30+ SyncHandler . updateFileWatcher ( Settings . autoRefresh ( ) ) ;
2631
2732 context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_LINKWITHFOLDER ,
2833 instrumentOperation ( Commands . VIEW_PACKAGE_LINKWITHFOLDER , Settings . linkWithFolderCommand ) ) ) ;
@@ -57,6 +62,10 @@ export class Settings {
5762 return this . _dependencyConfig . get ( "showOutline" ) ;
5863 }
5964
65+ public static autoRefresh ( ) : boolean {
66+ return this . _dependencyConfig . get ( "autoRefresh" ) ;
67+ }
68+
6069 public static syncWithFolderExplorer ( ) : boolean {
6170 return this . _dependencyConfig . get ( "syncWithFolderExplorer" ) ;
6271 }
0 commit comments