-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow auto imports of type members #378
Comments
@tgodzik |
This is related to indexing which is a bit of a complex subject but you're welcome to give it a try! It all depends on ScalaToplevelMtags, which uses only a tokenizer to find potential import candidates. Some recent PR that touched the subject is https://github.com/scalameta/metals/pull/6648/files or scalameta/metals#5623 Especially useful in that case is ToplevelLibrarySuite and ScalaToplevelSuite |
Thanks! |
You can try adding a test with zio to |
I modified test in But as far as I understand this test assumes that all package object members are indexed. Am I wrong? @tgodzik |
That should be it, but workspace search does some further logic and the compiler also, so somewhere in between this getting lost. You can check the WorkspaceSymbolProvider's search method and CompilerSearchVisitor in the presentation compiler part. |
I looked at your code, but I am not sure what you are trying to do, Wouldn't we need to add another case:
to emitMember? We already look into package object correctly, but type is ommited. |
Is your feature request related to a problem? Please describe.
Currently some libraries such as ZIO have a number of useful types contained in a package object, but those types cannot be imported automatically. It would be possible to enable that.
Describe the solution you'd like
Index types that are contained at toplevel of objects and/or package objects
Describe alternatives you've considered
Import manually
Additional context
This would require making sure that indexing is as effective as it is now and also that we don't gather types, which are not useful for anyone.
Search terms
auto import type zio
The text was updated successfully, but these errors were encountered: