-
Notifications
You must be signed in to change notification settings - Fork 102
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 opening a specific member reference in Go To File #1733
Conversation
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.
Left one small suggestion. Code looks pretty good otherwise!
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.
Only one real issue with casing, other than that it works as expected now!
src/instantiate.ts
Outdated
vscode.window.showInformationMessage(`Cleared list.`); | ||
quickPick.hide() | ||
} else { | ||
const selectionSplit = selection.split('/') |
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.
Looks like selectionSplit
doesn't account for case, so if a lowercase value is provided, the rest of this code fails because it expects members in uppercase for the SQL statement.
const selectionSplit = selection.split('/') | |
const selectionSplit = selection.toUpperCase().split('/'); |
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.
The selection will always be in uppercase, if it's a member:
- if the member is entered by the user, the value is put in the list in uppercase
- if the member is from a search, it is in uppercase by SQL
So it should not be necessary to convert to uppercase. We also don't want to convert streamfiles to uppercase.
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.
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.
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.
Looks like it's this line of code storing the values, including as lowercase when that option is enabled: https://github.com/chrjorgensen/code-for-ibmi/blob/d863157505d93b76388c9c9092fee9c398375394/src/views/objectBrowser.ts#L216
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.
The uppercase issue has been fixed.
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.
- My lowercase cache works now
- Search/filter still working as expected
Beautiful work @chrjorgensen!
Changes
This PR will fix issue #1732 by (re)adding the entered value to the list, thus allowing it to be selected (accepted).
This was a regression from the new member search in function Go To file.
Additional fixes are included:
Checklist
console.log
s I added