@@ -2365,6 +2365,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
23652365 */
23662366 public onDidChangeActiveTextEditor ( editor : vscode . TextEditor ) {
23672367 const ME = this ;
2368+ const CFG = ME . config ;
23682369
23692370 const PREVIOUS_EDITOR = ME . _currentTextEditor ;
23702371 ME . _currentTextEditor = editor ;
@@ -2390,7 +2391,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
23902391 if ( newFolder ) {
23912392 deploy_workspace . setWorkspace ( newFolder ) ;
23922393
2393- ME . onDidChangeConfiguration ( ) ;
2394+ ME . reloadConfiguration ( ) ;
23942395 }
23952396 }
23962397 catch ( e ) {
@@ -2399,7 +2400,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
23992400 } ;
24002401
24012402 if ( editor ) {
2402- if ( deploy_helpers . toBooleanSafe ( ME . config . autoSelectWorkspace ) ) {
2403+ if ( CFG && deploy_helpers . toBooleanSafe ( CFG . autoSelectWorkspace ) ) {
24032404 const DOC = editor . document ;
24042405
24052406 if ( DOC ) {
@@ -2465,7 +2466,11 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
24652466 /**
24662467 * Event after configuration changed.
24672468 */
2468- public onDidChangeConfiguration ( ) {
2469+ public onDidChangeConfiguration ( e : vscode . ConfigurationChangeEvent ) {
2470+ if ( ! e . affectsConfiguration ( 'deploy' , vscode . Uri . file ( this . settingsFile ) ) ) {
2471+ return ;
2472+ }
2473+
24692474 this . reloadConfiguration ( ) ;
24702475 }
24712476
@@ -4107,10 +4112,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
41074112 } ;
41084113
41094114 try {
4110- const SETTINGS_FILE = Path . join (
4111- deploy_workspace . getRootPath ( ) ,
4112- './.vscode/settings.json' ,
4113- ) ;
4115+ const SETTINGS_FILE = ME . settingsFile ;
41144116
41154117 const LOADED_CFG : deploy_contracts . DeployConfiguration = vscode . workspace . getConfiguration ( 'deploy' ,
41164118 vscode . Uri . file ( SETTINGS_FILE ) ) || < any > { } ;
@@ -4780,6 +4782,18 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
47804782 return deploy_values . replaceWithValues ( this . getValues ( ) , val ) ;
47814783 }
47824784
4785+ /**
4786+ * Gets the underlying settings file.
4787+ */
4788+ public get settingsFile ( ) {
4789+ return Path . resolve (
4790+ Path . join (
4791+ deploy_workspace . getRootPath ( ) ,
4792+ './.vscode/settings.json'
4793+ )
4794+ ) ;
4795+ }
4796+
47834797 /**
47844798 * Set ups the file system watcher.
47854799 */
0 commit comments