Skip to content

Commit

Permalink
Merge pull request #3082 from zowe/fix/v2/config-watcher
Browse files Browse the repository at this point in the history
fix(v2): `onProfilesUpdate` does not always fire for extenders
  • Loading branch information
zFernand0 authored Sep 3, 2024
2 parents dbf9a74 + c1bddf0 commit db3e26b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Fixed issue where creating a new team configuration file could cause Zowe Explorer to crash, resulting in all sessions disappearing from trees. [#2906](https://github.com/zowe/zowe-explorer-vscode/issues/2906)
- Fixed data set not opening when the token has expired. [#3001](https://github.com/zowe/zowe-explorer-vscode/issues/3001)
- Fixed JSON errors being ignored when `zowe.config.json` files change on disk and are reloaded. [#3066](https://github.com/zowe/zowe-explorer-vscode/issues/3066) [#3074](https://github.com/zowe/zowe-explorer-vscode/issues/3074)
- Resolved an issue where extender event callbacks were not always fired when the team configuration file was created, updated or deleted. [#3078](https://github.com/zowe/zowe-explorer-vscode/issues/3078)

## `2.17.0`

Expand Down
10 changes: 5 additions & 5 deletions packages/zowe-explorer/src/shared/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ export function watchConfigProfile(context: vscode.ExtensionContext): void {
context.subscriptions.push(...watchers);

watchers.forEach((watcher) => {
watcher.onDidCreate(async () => {
watcher.onDidCreate(() => {
ZoweLogger.info(localize("watchConfigProfile.create", "Team config file created, refreshing Zowe Explorer."));
await refreshActions.refreshAll();
void refreshActions.refreshAll();
ZoweExplorerApiRegister.getInstance().onProfilesUpdateEmitter.fire(EventTypes.CREATE);
});
watcher.onDidDelete(async () => {
watcher.onDidDelete(() => {
ZoweLogger.info(localize("watchConfigProfile.delete", "Team config file deleted, refreshing Zowe Explorer."));
await refreshActions.refreshAll();
void refreshActions.refreshAll();
ZoweExplorerApiRegister.getInstance().onProfilesUpdateEmitter.fire(EventTypes.DELETE);
});
watcher.onDidChange(async (uri: vscode.Uri) => {
Expand All @@ -260,7 +260,7 @@ export function watchConfigProfile(context: vscode.ExtensionContext): void {
return;
}
globals.setSavedProfileContents(newProfileContents);
await refreshActions.refreshAll();
void refreshActions.refreshAll();
ZoweExplorerApiRegister.getInstance().onProfilesUpdateEmitter.fire(EventTypes.UPDATE);
});
});
Expand Down

0 comments on commit db3e26b

Please sign in to comment.