Is your feature request related to a problem? Please describe.
In vscode, when I intend to type super.postStop(), but for example a variable called supervisorStrategy is also in scope, super. will expand to supervisorStrategy..
Describe the solution you'd like
If super would be present in the list of auto-completions, I could just select that (or keep typing).
Describe alternatives you've considered
An alternative solution to my immediate frustration could be to change vscode not to expand the first autocomplete option when a '.' is typed. That would probably be ~both harder to achieve and~ less convenient for the user compared to making sure 'super' can also be autocompleted, though.
Thanks for reporting! I agree this behavior can be quite annoying and I think it applies to all keywords, not only super.
An alternative solution to my immediate frustration could be to change vscode not to expand the first autocomplete option when a '.' is typed.
This is actually easy to implement since Metals explicitly registers . as a "commit character". We could either
I've caught myself trying to complete keywords like extends so I'm personally leaning towards the second solution 馃
A (not so great) workaround is to type a space character to avoid the commit character, then backspace and write .
implement completions for keywords, harder to implement but results in hopefully better user experience
Perhaps a primitive implementation could just add completions for all common keywords regardless of context?
This approach would produce noisy results, for example case and finally would appear everywhere. We already have the syntax tree and can filter out which keywords are valid there, it's not a major challenge, just takes a bit of time to implement and test 馃槈
Me and @markus1189 took a stab at this issue at the flatMap(Oslo) spree and I'm hopeful we'll have this fixed for the next release.
Fixed in #712
Most helpful comment
Me and @markus1189 took a stab at this issue at the flatMap(Oslo) spree and I'm hopeful we'll have this fixed for the next release.