-
Notifications
You must be signed in to change notification settings - Fork 28
Code Hinting Window #119
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
base: main
Are you sure you want to change the base?
Code Hinting Window #119
Conversation
when already fully typed out, for consistency. Previous when typing COLOR_RED the suggestion for COLOR_RED would show, but once COLOR_RED was fully typed out the suggestion box would vanish. This was intended, but I think was the wrong choice - it's better to still allow the user to hit enter and not suddenly end up on a newline.
- Shows when typing - Ctrl-Space can trigger manually, Escape hides it - Some other small related UI adjustments
|
Oliver-Quail
left a comment
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.
Overall a very good new feature.
Please see comments for some suggested changes regarding best practice
| flexDirection: "column" | ||
| }}); | ||
|
|
||
| let functionHint = elem("div", {class: "sk-contents sk-notification sk-function-hint sk-contents-focusable", tabindex: "10"}, [ |
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.
Just out of interest why is tabindex set to 10?
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.
Honestly this is just to get the sk-contents-focusable focus-within outline working 😅, any tabindex will do. Better suggestions welcome there!
Description
This PR adds a code hinting window that automatically pops up when typing. It shows the parameters for the current function, and other overloads can be switched between with the arrows on the side. It can be triggered to show up using Ctrl-Space, and hidden using Escape.
The bulk of the logic is in
codeHinter.js. It handles the following:It also includes some other minor changes:
waitcursorKnown issues:
Thanks if you can take a look at this! I'd definitely appreciate any feedback on how the code could be improved, any aspects that seem like they could cause issues longer term, or if there are any remaining UI issues with it that I overlooked haha.
I'm also wondering if perhaps it could get in the way at times - maybe there should be a way to permanently toggle it on/off? It'd also be cool to consider how it could be further expanded - I know VS Code can show function/parameter descriptions as well, perhaps that could be future work from this. So hoping to make sure the code is reasonably readable haha.
Thanks! 😃
Type of change
How Has This Been Tested?
Testing Checklist
Checklist