-
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
feat(Go to file): Autotype suggestions typing path #1680
feat(Go to file): Autotype suggestions typing path #1680
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.
I think there is a lot of logic being handled in the wrong file.
I am thinking code-for-ibmi.goToFile
(and code-for-ibmi.goToFileReadOnly
) should likely go into a separate file.
Secondly, I think we need to be careful about using onDidChangeValue
because a fast typing user is resulting in spamming the server. We need to look into using some kind of timeout to slow down the requests to the server.
Something like this perhaps?
quickPick.onDidChangeValue(async () => {
clearTimeout(timeout);
timeout = setTimeout(() => {
// Do something with quickPick.value
}, 500);
});
Ah - I didn't understand your comment until I realized that I have also fixed some other small issues - can I make you test it one more time and see if it's better now? I'm fine with the code being extracted into a separate file - but can we do that in 2.4.1? I will make an issue about this, if you are okay with this. |
@worksofliam Also note that there's a limit of 30 members retrieved from the server, in order to not delay the list unnecessary... |
Perfect. Thank you! I will have another review for you today 💯 |
src/instantiate.ts
Outdated
FROM qsys2.SYSPARTITIONSTAT | ||
WHERE TABLE_SCHEMA = '${selectionSplit[0]}' | ||
AND table_name = '${selectionSplit[1]}' | ||
AND TABLE_PARTITION like '${filterText}%' |
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.
Consider not adding this condition against TABLE_PARTITION
when filterText
is blank. It's evaluating to: TABLE_PARITION like '%'
.
QSYSINC/H/*
src/instantiate.ts
Outdated
FROM QSYS2.SYSTABLES | ||
WHERE TABLE_SCHEMA = '${selectionSplit[0]}' | ||
AND FILE_TYPE = 'S' | ||
AND SYSTEM_TABLE_NAME like '${filterText}%' |
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.
Same here about filterText
being blank.
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.
Functionally works good. I left some comments about the where
clause being used for the filter. I also think we need an improved UX to show that it is loading data, perhaps with something like this before the SQL statements are executed?
quickPick.items = [
{
label: 'Searching',
alwaysShow: true,
description: 'Please wait..',
},
]
@chrjorgensen Here is a summary of my changes, which are quite a lot.
This is obviously a lot of changes, but think I did what you would think is right. If not, I am happy to back out my changes. |
@worksofliam Your changes worked great - but there were some old errors and other stuff, that I changed:
Please have a go. If you're pleased with it, let's make the release - we can always fix any small errors later... 😃 |
Ok. This is soooo cool. I love this feature!!! Excellent work @chrjorgensen - thanks for your awesome work on this. Let's merge and I will release. Things I want to do in the future:
|
just got to try this new feature. This is so awesome!!! this was my biggest complaint with Code for i, such a great enhancements. Thanks to all who contributed! |
Changes
This pull request is a squashed version of PR #1242 and must be used instead to make a cleaner git history.
The original author @sebCIL is kept on the commit.