From a110202b90b84b38feb923d367d8b9d96c9c15fd Mon Sep 17 00:00:00 2001 From: Vinayak Mohanty Date: Tue, 19 May 2026 00:17:00 +0530 Subject: [PATCH 1/3] fix: update extension inference logic Signed-off-by: Vinayak Mohanty --- .../trees/dataset/DatasetUtils.unit.test.ts | 8 ++--- .../src/trees/dataset/DatasetUtils.ts | 30 +------------------ 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetUtils.unit.test.ts index e813f58c94..5a4fe273b7 100644 --- a/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/trees/dataset/DatasetUtils.unit.test.ts @@ -139,15 +139,15 @@ describe("Dataset utils unit tests - function getExtensionMap", () => { } as any; } - it("should return extension map based on member names", async () => { + it("should not infer extensions from member names", async () => { const mockNode = createMockNode("TEST.PDS", [{ label: "MEMBER1" }, { label: "COBOL" }, { label: "XML" }]); const result = await DatasetUtils.getExtensionMap(mockNode, false); expect(result).toEqual({ member1: "txt", - cobol: "cbl", - xml: "xml", + cobol: "txt", + xml: "txt", }); }); @@ -158,7 +158,7 @@ describe("Dataset utils unit tests - function getExtensionMap", () => { expect(result).toEqual({ MEMBER1: "txt", - COBOL: "cbl", + COBOL: "txt", ".f@K3": "txt", }); }); diff --git a/packages/zowe-explorer/src/trees/dataset/DatasetUtils.ts b/packages/zowe-explorer/src/trees/dataset/DatasetUtils.ts index 20513e6eb9..fc93f650bd 100644 --- a/packages/zowe-explorer/src/trees/dataset/DatasetUtils.ts +++ b/packages/zowe-explorer/src/trees/dataset/DatasetUtils.ts @@ -176,39 +176,11 @@ export class DatasetUtils { ): Promise<{ [key: string]: string }> { const extensionMap: { [key: string]: string } = {}; const children = await node.getChildren(); + const extension = overrideExtension ?? DatasetUtils.getExtension(node.label as string) ?? ".txt"; for (const child of children) { - let extension; let label = child.label as string; - if (overrideExtension) { - extension = overrideExtension; - } else { - for (const [ext, matches] of DS_EXTENSION_MAP.entries()) { - if (ext === ".c") { - // Special case for ".c" extension, skip the following logic - // As it's not unique enough and would otherwise match on anything containing "C" - // TODO: rrevisit later if this can be handled better while still allowing c files - continue; - } - if (matches.some((match) => (match instanceof RegExp ? match.test(label) : label.includes(match)))) { - extension = ext; - break; - } - } - - // If no extension found, fall back to using the PDS name as extension - if (!extension) { - const parentExtension = DatasetUtils.getExtension(node.label as string); - if (parentExtension) { - extension = parentExtension; - } else { - // Use default extension if nothing else matches - extension = ".txt"; - } - } - } - if (!uppercaseNames) { label = label.toLowerCase(); } From 03bb20b18bc927f759746e024f0fdfeb0f04e1d3 Mon Sep 17 00:00:00 2001 From: Vinayak Mohanty Date: Tue, 19 May 2026 18:50:14 +0530 Subject: [PATCH 2/3] updated chanelog.md Signed-off-by: Vinayak Mohanty --- packages/zowe-explorer/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 3e7402adcc..15c63b1127 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes +- Fixed an issue where downloaded PDS members could receive file extensions inferred from member names instead of the parent PDS name. - Fixed an issue where saving contents to a data set or USS file could trigger built-in conflict detection, specifically when the API does not include a timestamp for that resource. Now, the modification time of a data set or USS file in Zowe Explorer's filesystem is kept as-is if the API does not provide a timestamp. Users can continue to use the "Pull from Mainframe" context-menu option to fetch the latest contents of a data set or USS file in an opened editor. [#4206](https://github.com/zowe/zowe-explorer-vscode/issues/4206) - Updated USS and data set file system providers to generate notifications based on remote system changes rather than local file system cache updates. [#4162](https://github.com/zowe/zowe-explorer-vscode/pull/4162) - Fixed an issue where file system calls incorrectly threw a FileNotFound error for existing files, ensuring they are now fetched correctly. [#3554](https://github.com/zowe/zowe-explorer-vscode/issues/3554) From 613edb852c5d9c548adf6210fd72255b4a2a49e8 Mon Sep 17 00:00:00 2001 From: Vinayak Mohanty Date: Tue, 19 May 2026 19:08:44 +0530 Subject: [PATCH 3/3] Undo changelog.md change Signed-off-by: Vinayak Mohanty --- packages/zowe-explorer/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 15c63b1127..3e7402adcc 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -19,7 +19,6 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes -- Fixed an issue where downloaded PDS members could receive file extensions inferred from member names instead of the parent PDS name. - Fixed an issue where saving contents to a data set or USS file could trigger built-in conflict detection, specifically when the API does not include a timestamp for that resource. Now, the modification time of a data set or USS file in Zowe Explorer's filesystem is kept as-is if the API does not provide a timestamp. Users can continue to use the "Pull from Mainframe" context-menu option to fetch the latest contents of a data set or USS file in an opened editor. [#4206](https://github.com/zowe/zowe-explorer-vscode/issues/4206) - Updated USS and data set file system providers to generate notifications based on remote system changes rather than local file system cache updates. [#4162](https://github.com/zowe/zowe-explorer-vscode/pull/4162) - Fixed an issue where file system calls incorrectly threw a FileNotFound error for existing files, ensuring they are now fetched correctly. [#3554](https://github.com/zowe/zowe-explorer-vscode/issues/3554)