-
Notifications
You must be signed in to change notification settings - Fork 137
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
Consider the auto-completion model used in elixir_ls #772
Comments
Yes please. I always delete the arguments, because for some reason autocomplete doesn't trigger. But that might be a bug in VS Code, and I prefer to choose arity on the fly (if I want to add some options for example). |
Hi @alanz since the description points to the whole changelog, may I ask you to formalize in this ticket the exact requirements? |
@robertoaloi I agree. IIRC one of my colleagues suggested that we look at this, without anything specific. I am happy to close it if no-one else has anything concrete to put in here. |
Instead of auto-completing with a snippet where the arguments are prefilled, leave empty places and let the user rely on auto-complete for the arguments. Also, always go for the highest arity since it easy to remove extra arguments, and at least I kinda forget which functions have an optional options argument. Better? |
Hi @maxnordlund , during auto-completion, if multiple arities are available for the same function name, all of them are proposed to the user. Arguments get expanded only after a specific arity is selected. I can see why the part about the function arguments can be annoying, I will check what I can do. |
Actually, I double checked and the completions already use the snippet format. This means that the arguments can be navigated via TAB and the user can just type over, so no need to remove them. They are just placeholders. |
I will close this for now as a won't do from my side, but please feel free to contribute if you'd like to change how the auto-completion model works. |
At least for me auto-completion doesn't trigger when overwriting snippet placeholders. Only if I exit the snippet mode (marked with an grey background for me) it starts working. That's why I would prefer to avoid using snippets if possible. About suggesting multiple arities, the problem is that tabbing, in VS Code at least, selects the first alternative and switches to the snippet placeholders. Thus I can't actually select some other arity with tab, and must use arrow keys. Since lower arity goes first, I don't get the version with optional arguments. By listing all arities one by one, it fills up/clutters the auto-complete list. I would prefer it to list each function name once, and indicate which arities are available, and prefer the highest arity when pressing tab. If there were an option for disabling snippets, or perhaps not have placeholder names, just empty spaces I've tried to read through the source, but it's all a bit too much for me. Otherwise I would have made a PR 🙂 |
This commit prevents the completion provider from providing arguments for functions/macros when an editor does not enable snippets. With snippet support, arguments are useful because they can be tabbed between, but for an editor which does not implement snippets, the generated arguments are mostly a hassle: you have to move back to replace the arguments.
This commit prevents the completion provider from providing arguments for functions/macros when an editor does not enable snippets. With snippet support, arguments are useful because they can be tabbed between, but for an editor which does not implement snippets, the generated arguments are mostly a hassle: you have to move back to replace the arguments.
See the description here
The text was updated successfully, but these errors were encountered: