metals
metals copied to clipboard
Provide extension method code completions when typing `xxx.@@`
Describe the bug
Define an extension method like
package a
extension (num: Int)
def increment: Int = ???
Try to use the extension method in another package
package b
1.i@@
if we type 1.i
we will have an auto-completion for increment
extension method. However, if we type 1.@@
we don't get the completion for increment
Expected behavior
It would be ideal if it were allowed to search even with an empty query. Then, the user will be able to discover extension method by autocompleting
https://github.com/scalameta/metals/pull/4183#discussion_r934249157
Operating system
No response
Editor/Extension
VS Code
Version of Metals
0.11.7+79-d2ab7248-SNAPSHOT
Extra context or search terms
Follow up from https://github.com/scalameta/metals/pull/4183
extension method
- It doesn't work because we guard for an empty query here, we have to remove this guard
- However, just removing
if query.nonEmpty
doesn't work- it calls MetalsSymbolSearch.searchMethods and empty query may fail inside of it, we have to workaround it.
I'll give this one a go
Great to hear! Let us know if you encounter any difficulties!