Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.0.0 File extension detection misidentifies types #3181

Closed
JPeake42 opened this issue Oct 4, 2024 · 4 comments · Fixed by #3182
Closed

V3.0.0 File extension detection misidentifies types #3181

JPeake42 opened this issue Oct 4, 2024 · 4 comments · Fixed by #3182
Labels
bug Something isn't working
Milestone

Comments

@JPeake42
Copy link

JPeake42 commented Oct 4, 2024

Describe the bug

Some datasets are misidentified as file types they are not. E.g 'USERID.A.OUTPUT' being detected as '.ASM'. This leads to VS Code setting the language mode according to the incorrect file type.

To Reproduce

  1. Open a dataset with a single character qualifier, but without an obvious type identifier, e.g USERID.A.OUTPUT, USERID.J.TEST
  2. File type will be appended to dataset, e.g "USERID.A.OUTPUT" becomes "USERID.A.OUTPUT.asm", "USERID.J.TEST" becomes "USERID.J.TEST.jcl".

Expected behavior

File extensions would only be appended to obviously named data sets, e.g "USERID.SOMETHING.JCL" or "USERID.SOMETHING.COBOL".

Desktop (please complete the following information):

  • OS: Windows 10
  • Zowe Explorer Version: v3.0.0

Additional context

I think this is due to changes to the DatasetUtils.ts file in eb06448. The getExtension function is checking if any qualifier is present in each 'match' instead of in the 'matches' array. Before, only qualifiers such as 'JCL' or 'COBOL' would be picked up, but now if a qualifier contains a subset of either, they would be considered.

Additionally, in previous versions, VS Codes "files.associations" setting could be used to allow users to finetune what datasets should be considered what types, though with changes in v3.0.0, this seems to not work anymore for members (Though this may be a separate issue I suppose).

Apologies if I'm missing anything, I don't frequent github / projects, so I hope the above is sufficient context.

@JPeake42 JPeake42 added the bug Something isn't working label Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@traeok
Copy link
Member

traeok commented Oct 4, 2024

Hi @JPeake42,

Thanks for bringing this to our attention and my apologies for the oversight. @t1m0thyj implemented a fix for this and it should be available in v3.0.1.

Regarding the files.associations change in behavior: this is likely due to the change in path structure for PDS members. Before, we had inserted the member name into the file in parentheses (ex: TEST.COBOL(MEMB1)) vs. the new path structure TEST.COBOL/MEMB1. For v3, you'll need to adjust your associations so that they also support PDS members. Here are some example globs for reference:

**/*COBOL*{,/*} - matches /lpar.zosmf/TEST.COBOL.PS and /lpar.zosmf/TEST.COBOL.PDS/MEMBER
**/*JCL*{,/*} - matches /lpar.zosmf/TEST.JCL.PS and /lpar.zosmf/TEST.JCL.PDS/EXAMPLE

We'll make sure our documentation is updated so others are aware of this change.

@phaumer
Copy link
Member

phaumer commented Oct 4, 2024

I don't think Zowe Explorer should make any assumptions about languages content. This should be the job of language VS Code extensions that are typically installed on top of Zowe Explorer. If Zowe Explorer already intercepts this and guess wrong then it leads to a bad user experience.

I am looking for upvotes on my issue #3131 @JPeake42

@JPeake42
Copy link
Author

JPeake42 commented Oct 6, 2024

Thank you both for the quick response and fix @traeok / @t1m0thyj! That formatting for the files.associations setting works like a charm as well.

I hope I've upvoted your issue correctly @phaumer, I agree that it seems sensible that Zowe leaves it to the language extensions to figure out what a file is. The files.associations settings let users manage it a bit anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

4 participants