diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts index b1fdad385d51da2d4ad79265f1da5eebda636dfd..1269a1bfaed4f036aeb260ba0fddd8beccd11e84 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts @@ -23,6 +23,7 @@ export class FileIconThemeData implements IFileIconTheme { isLoaded: boolean; location?: URI; extensionData?: ExtensionData; + watch: boolean; styleSheetContent?: string; @@ -59,6 +60,7 @@ export class FileIconThemeData implements IFileIconTheme { themeData.description = iconTheme.description; themeData.location = iconThemeLocation; themeData.extensionData = extensionData; + themeData.watch = iconTheme._watch; themeData.isLoaded = false; return themeData; } @@ -77,6 +79,7 @@ export class FileIconThemeData implements IFileIconTheme { themeData.hidesExplorerArrows = false; themeData.isLoaded = true; themeData.extensionData = undefined; + themeData.watch = false; } return themeData; } @@ -91,6 +94,7 @@ export class FileIconThemeData implements IFileIconTheme { themeData.hasFolderIcons = false; themeData.hidesExplorerArrows = false; themeData.extensionData = undefined; + themeData.watch = false; return themeData; } @@ -109,6 +113,7 @@ export class FileIconThemeData implements IFileIconTheme { case 'hasFileIcons': case 'hidesExplorerArrows': case 'hasFolderIcons': + case 'watch': theme[key] = data[key]; break; case 'location': @@ -132,7 +137,8 @@ export class FileIconThemeData implements IFileIconTheme { styleSheetContent: this.styleSheetContent, hasFileIcons: this.hasFileIcons, hasFolderIcons: this.hasFolderIcons, - hidesExplorerArrows: this.hidesExplorerArrows + hidesExplorerArrows: this.hidesExplorerArrows, + watch: this.watch }); } } diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index a4c951165a81fd99cf86f5b812e62647f311a06c..73235fecc2f3762a706c618c78b91ce24f5a5a99 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -355,6 +355,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { if (this.fileService && !resources.isEqual(newTheme.location, this.watchedColorThemeLocation)) { if (this.watchedColorThemeLocation) { this.fileService.unwatchFileChanges(this.watchedColorThemeLocation); + this.watchedColorThemeLocation = null; } if (newTheme.location && (newTheme.watch || !!this.environmentService.extensionDevelopmentLocationURI)) { this.watchedColorThemeLocation = newTheme.location; @@ -459,9 +460,10 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { if (this.fileService && !resources.isEqual(iconThemeData.location, this.watchedIconThemeLocation)) { if (this.watchedIconThemeLocation) { this.fileService.unwatchFileChanges(this.watchedIconThemeLocation); + this.watchedIconThemeLocation = null; } - this.watchedIconThemeLocation = iconThemeData.location; - if (this.watchedIconThemeLocation) { + if (iconThemeData.location && (iconThemeData.watch || !!this.environmentService.extensionDevelopmentLocationURI)) { + this.watchedIconThemeLocation = iconThemeData.location; this.fileService.watchFileChanges(this.watchedIconThemeLocation); } }