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
Fix error showing when opening a job file for extenders #1701
Conversation
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to recreate the issue in CRW with the marketplace version and tested with this branch and the issue is fixed. Thanks @rudyflores for your work on this
merged in next and rebased the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fix that will quickly remove the error message, but the solution is not very robust as it just looks for an English substring of the error message.
We can merge it for a quick fix, but a the same time we should fix the root cause of the problem to avoid these errors all together.
One suspicion I have is that the format of the URI might work with VS Code, but causes issues in Theia/Che because it is not a regular URI. When I serialize one in the debugger it looks like this:
zosspool:DBB.STC00021.JESMSGLG?["zosdevtestexp22.rseapi",{"id":2,"ddname":"JESMSGLG","procstep":"","record-count":"2","stepname":"JES2","jobid":"STC00021","jobname":"DBB"}]#1651622167209
Perhaps the solution is to revise the uri schema used for spool files?
const isTextDocActive = | ||
vscode.window.activeTextEditor.document.uri?.path === `${spool.jobname}.${spool.jobid}.${spool.ddname}`; | ||
|
||
if (String(error.message).includes("Failed to show text document") && isTextDocActive) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work if the user works in a different language (as Theia is now localized)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a good point here, might have to look into how I could fetch that error localized and check for it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if vscode api defines that error as an error code and then check against that code. The message string will likely change in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After checking it seems like VS Code does not have error codes specific to this issue :/
Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thanks @rudyflores, I don't see any errors opening job files with the workaround
Signed-off-by: Rudy Flores 68666202+rudyflores@users.noreply.github.com
Proposed changes
Fix an issue where a job file is open and an error is shown mentioning the text document was not able to be shown even though it is open successfully for extenders.
Release Notes
Milestone:
Changelog: Fix error displayed when opening a job file for extenders
Types of changes
What types of changes does your code introduce to Zowe Explorer?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the revieweryarn workspace vscode-extension-for-zowe vscode:prepublish
has been executedReminder
After a PR is merged into the
master
branch, create a PR frommaster
to thenext
branch resolving any conflicts.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...