-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Required parameter autocomplete #1258
Conversation
Just realised this now: back in the days we chose explicitly to not do this because of optional parameters. When autocompleting Do you have any experience with these use cases? It does seem that this does not occur that often compared to just required parameters? |
Indeed, I've noticed this, too. However, after using this for a while I'd say that it's not a big deal. Yes, it's annoying when you have to go back for an optional parameter, but it happens far more often that you don't need the optional parameter and can Tab to the next required parameter without having to type any braces. In my experience this definitely outweighs the optional parameter annoyance. The only command (in my experience) where it is really annoying is I do feel like, if we're going to give this command a special treatment, why not all commands? Just because this is one we use a lot doesn't mean that's the same for other users... So in that sense a live template might be better, so users can remove and edit it and/or add their own for other commands. |
Can we provide autocomplete for both versions of the command, with and without optional parameters? So then this appears in the autocomplete:
if I'm not mistaken then IJ will learn if you always use the second. |
Sounds promising. I'd love to see a prototype of this to see if it works. Because if it does, I think you have found a very nice solution. One problem with this still might be commands that you rarely use in a new project, and then you don't necessarily select the right option because the autocomple hasn't adapted yet? |
I suppose that makes sense. I'll have a go at it :)
I think that that will not be too much of a problem. I guess it's similar to what we currently have: after selecting the wrong option you have to go back to fix an optional parameter (delete or add it). What I'm afraid of is that the autocomplete list will be cluttered with a lot of double (or even more) commands, but we'll see if that turns out to actually be annoying. |
For a prototype, try out 9f4a289. For now, this only shows the additional elements in the autocomplete (don't expect anything when inserting), which is enough to try out how quick the autocompletion adapts to your preferences. I've found that you have to select your favourite command twice, then the third time it has already adapted. I think that's quick enough, even for commands you rarely use. Some screenshots of the new completion list: Currently, this shows the power set of optional parameters (including the empty set, which is only the required parameters), which lead to seemingly double results (see the @HannahSchellekens any thoughts/ideas/suggestions before I continue with the insertion handler? |
Adds live templates to insert placeholders for all required parameters.
Summary of additions and changes
{}
when completing a command that has required parameters.frac
live template since we don't need it anymore.How to test this pull request
Wiki