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

Asterisk to underscore replacement when organizing imports in Scala 3 #5121

Closed
susliko opened this issue Apr 5, 2023 · 5 comments · Fixed by #5304
Closed

Asterisk to underscore replacement when organizing imports in Scala 3 #5121

susliko opened this issue Apr 5, 2023 · 5 comments · Fixed by #5304
Labels
improvement Not a bug or a feature, but something general we can improve scalafix Relating to the built-in scalafix support
Milestone

Comments

@susliko
Copy link
Contributor

susliko commented Apr 5, 2023

Describe the bug

Invoking "Organize imports" command with the following code

import test.{Foo => Bar, *}
...

results in import statement being refactored:

import test.{Foo => Bar, _}

Expected behavior

Wildcard import with asterisk remains untouched

import test.{Foo => Bar, *}
...

Operating system

macOS

Editor/Extension

Nvim (nvim-metals)

Version of Metals

v0.11.11

Extra context or search terms

No response

@tgodzik
Copy link
Contributor

tgodzik commented Apr 5, 2023

Thanks for reporting! What is the version of Scala that you are using? If it's Scala 3 that might be expected, especially that at some point _ for imports might get removed.

As for where it's being done, the actual code is in https://github.com/liancheng/scalafix-organize-imports so if needed we would have to fix it there.

@susliko
Copy link
Contributor Author

susliko commented Apr 5, 2023

Sorry for forgetting to specify it
I'm using Scala 3.2.2

@tgodzik tgodzik added the improvement Not a bug or a feature, but something general we can improve label Apr 5, 2023
@susliko
Copy link
Contributor Author

susliko commented Apr 6, 2023

Relevant issue: liancheng/scalafix-organize-imports#221

@kasiaMarek
Copy link
Contributor

So it seems this is actually fixed on the master of https://github.com/liancheng/scalafix-organize-imports, however the bug exists on the latest released version v0.6.0, which is the one used by metals.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 13, 2023

Ach, that's related to the migration effort of the rule to be built in. We might need to take a look at it ourselves if the contributor doesn't respond.

@bjaglin bjaglin added the scalafix Relating to the built-in scalafix support label Jun 4, 2023
@tgodzik tgodzik added this to the Metals v1.0.0 milestone Jul 18, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve scalafix Relating to the built-in scalafix support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants