Description
Following #241, I've been working on some other improvements regarding UX. Most of them have been in my TODO list since I've moved from Atom to VS Code. Before I send a PR, I'd like to get some feedback in order to avoid wasting my time in something that might not please everyone. So here it goes.
1. Improve readability of signature info
Currently, the documentation summary and the spec showed are not recognized as markdown and elixir code respectively. Example:
Suggestion:
- recognize them as markdown/code
- add an empty line between them
- invert the order so the summary comes before the spec
- format the spec using the elixir formatter
Example:
2. Improve readability of auto-complete info
Currently, the information showed for auto-complete is too noisy. Example:
The most important thing to see should be the signature. But most of them are clipped so we need to look at the spec, which is much more verbose, to figure out the arguments. Also, having the signature in the list makes it harder to read the function name.
Suggestion:
- show only the function name/arity on the list
- add information about the type (function or macro) and the module where the function/macro is defined
- show the signature in the side box (instead of in the list)
- add the formatted spec at the end (as suggested for the signature info)
Example:
Here's another example with a larger spec:
Before:
After:
Although the user might eventually need to scroll down to see the formatted spec, the information will be much more readable as we can see here:
3. Do not add arguments to the snippet when auto-completing
One of the main reasons I implemented the signature help feature in ElixirSense was to be able to get rid of this behaviour as 99% of the time we need to delete all the arguments suggested since the suggestions are just the name of the arguments, not the name of the variables you have in the scope.
Example:
As you can see, there's no variable enumerable
and I might not even need the second argument. So I'll have to delete both of them. That's just extra unnecessary work.
Suggestion:
- Do not add arguments to the snippet
- trigger the signature help right after confirming the suggestion
Here's an example from a Java extension:
And here is VS Code showing our signature info after completion:
4. Remove keyword completion
I think we need to start thinking about removing some of the suggestions as they mostly just add noise to the list. One example is the keyword completions. As the comment in the source code states, this is really not useful and it interferes with the auto-indentation for some cases.
Note: Another one we should probably remove in the future is the list of operators or maybe only keeping them when explicitly using
Kernel.
.
@axelson and @lukaszsamson I'd love to hear your thoughts about those suggestions.
Cheers.