-
Notifications
You must be signed in to change notification settings - Fork 337
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
Class renaming is broken when you have other tab opened with import #6478
Comments
Getting back to it think the issue here is that sometimes the newly renamed class is not compiled and I see old classfiles together with new semanticdb, which contains old information. Not sure yet if the problem is Bloop or Zinc. But the workaround is to force the compilation for the file again by adding some lines etc. |
Previously, we would ask zinc to compile even a file that was removed and I think this was causing scalameta/metals#6478 Now, we invalidated all changed sources, but only compile new ones.
Looks like scalacenter/bloop#2490 could help from my testing. |
@tgodzik thanks for your reply! |
Also, I have a question: Does renaming a class produce the same effect as moving it to another folder? Because I have the same experience for both cases, if I make one or another change (renaming or repackaging) in the |
Previously, we would ask zinc to compile even a file that was removed and I think this was causing scalameta/metals#6478 Now, we invalidated all changed sources, but only compile new ones.
Previously, we would ask zinc to compile even a file that was removed and I think this was causing scalameta/metals#6478 Now, we invalidated all changed sources, but only compile new ones.
You would need to checkout my branch, do
I think so, but might be worth checking out. If we try to compile a file that no longer exist then something weird might happen. My hope is that this is the cause of many weird metals bugs, but I will need to see. |
Previously, we would ask zinc to compile even a file that was removed and I think this was causing scalameta/metals#6478 Now, we invalidated all changed sources, but only compile new ones.
renaming_file.mp4I didn't work for me :( You can reproduce my case by opening CreateArticle and CreateArticleSpec classes and then renaming (o moving to another folder) CreateArticle class. I gave you an access to |
That looks like another issue than the one I found. It would stop renaming altogether for me after a couple of renames, here it looks like it looses a couple of references. I might have misunderstood the issue in your first video then. I will take a look at what you posted now. |
Curiously, I see a different problem in my case: Screencast.from.2024-11-01.18-52-58.mp4Things are correctly renamed, but badly recompiled and it take several tries for it to compiled correctly. I will see what that is about, but we might need to revisit this once the full release it out. |
Yeah, sometimes it happens too - class is renamed, bad badly recompiled. But normally it's not renamed and badly recompiled. PS: I've tried renaming several times and can confirm that both cases happen. Correct renaming with bad recompilation and incorrect renaming with bad recompilation. |
Describe the bug
https://github.com/scalameta/metals/assets/21007364/49fe71de-7583-4ee9-b2a1-0cc7aaffa339
Maybe related to: #5759
Expected behavior
No response
Operating system
macOS
Editor/Extension
VS Code
Version of Metals
v1.3.1
Extra context or search terms
No response
The text was updated successfully, but these errors were encountered: