Skip to content
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

Some import suggestions from ZIO don't appear #6284

Closed
brndt opened this issue Apr 4, 2024 · 6 comments
Closed

Some import suggestions from ZIO don't appear #6284

brndt opened this issue Apr 4, 2024 · 6 comments

Comments

@brndt
Copy link

brndt commented Apr 4, 2024

Describe the bug

  1. Try to type "IO" or "ULayer" type (as an example) from zio package

  2. VS Code doesn't suggest to import these types

Expected behavior

VS Code should suggest to import these types as well as it does for other zio-related stuff

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.2.2

Extra context or search terms

No response

@tgodzik
Copy link
Contributor

tgodzik commented Apr 5, 2024

Thanks for reporting! Do you perhaps have a snippet that this doesn't work in? That would be super useful. Also, which version of zio you are using just in case

@brndt
Copy link
Author

brndt commented Apr 5, 2024

Thanks for reporting! Do you perhaps have a snippet that this doesn't work in? That would be super useful. Also, which version of zio you are using just in case

Try to execute this code in VS Code and you'll see it doesn't suggest to import IO from zio, neither handler from zio-http:
https://scastie.scala-lang.org/vPVpOnCcTBWbG09PR4xmDg

@kasiaMarek
Copy link
Contributor

Currently for library dependencies Metals only suggests auto-imports for class/object/trait, and can't handle methods like handler or type aliases like IO.

@brndt
Copy link
Author

brndt commented Apr 8, 2024

I think it would be great to suggest them too.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 8, 2024

Maybe if we only did it for toplevel object or package objects that would be fine? Though it would be needed to check the implications and whether the indexing wouldn't get much worse.

It's a feature request though at this point, so will open up as a follow up.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 8, 2024

@tgodzik tgodzik closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
@tgodzik tgodzik moved this to Done in Metals Issue Board Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants