You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Extension methods are awesome, but their usage tends to break the flow of writing code as they require imports before auto-completion kicks in.
val map : java.util.List[Int]
map.asSca // doesn't offer the "asScala" completion as the necessary import is not there `scala.jdk.CollectionConverters._`
Describe the solution you'd like
I'd like a way to configure a list of completion elements that metals could use even when the information it relies on (presentation compiler/semanticdb) is not sufficient to find what the user is looking for.
For instance
[
"scala.jdk.CollectionConverters._"
]
would allow metals to look for completions as if "CollectionConverters" was imported in the current file, and offer what it contains as an additional completion item, that would result in the import being actually added to the list if the user selected asScala for completion.
Metals could come pre-configured with such items (jdk converters and duration come to mind), and users could add/remove to the list based on their personal preferences (json libraries, pure-fp libraries, etc)
Describe alternatives you've considered
No alternative came to mind, besides changing the predef which is highly intrusive and cannot be configured globally.
Additional context
No response
Search terms
completion, scope
The text was updated successfully, but these errors were encountered:
Thanks for reporting! We currently suggest extension methods inside the workspace, but not the ones from dependencies, which is a limitation we have. I think we could possibly index some subset of extension methods inside objects that are easy to import 🤔
We could potentially index extension methods that were used in the workspace, so that the next time you write it it would be used automatically. Plus maybe a list of well known ones? But that would be problematic if the standard library ever changed.
Is your feature request related to a problem? Please describe.
Extension methods are awesome, but their usage tends to break the flow of writing code as they require imports before auto-completion kicks in.
Describe the solution you'd like
I'd like a way to configure a list of completion elements that metals could use even when the information it relies on (presentation compiler/semanticdb) is not sufficient to find what the user is looking for.
For instance
would allow metals to look for completions as if "CollectionConverters" was imported in the current file, and offer what it contains as an additional completion item, that would result in the import being actually added to the list if the user selected
asScala
for completion.Metals could come pre-configured with such items (jdk converters and duration come to mind), and users could add/remove to the list based on their personal preferences (json libraries, pure-fp libraries, etc)
Describe alternatives you've considered
No alternative came to mind, besides changing the predef which is highly intrusive and cannot be configured globally.
Additional context
No response
Search terms
completion, scope
The text was updated successfully, but these errors were encountered: