import stuck in a loop
Describe the bug
https://github.com/NPCRUS/reproductions/tree/bsp-import-loop
- open project in visual studio code
- switch to mill-bsp
- import project
- extends
packagewith extra non existent traitBase-objectpackageextends RootModule with Base - import again
note: auto-import setting is switched off the mill.build is compiling with error, but metals(I guess) keep trying to import again and again
error from metals log: https://github.com/NPCRUS/reproductions/blob/bsp-import-loop/error
https://github.com/user-attachments/assets/601cde38-3406-41db-bad7-61d33a37d7fa
Expected behavior
- some sort of notification of failed import
- no looping
- error diagnostics present I want to emphasize here that error is expected, what is not expected is looping and zero notifications
Operating system
macOS
Editor/Extension
VS Code
Version of Metals
1.5.2+7-0651fd6b-SNAPSHOT
Extra context or search terms
No response
Thanks for reporting! @kasiaMarek could it be connected to your recent changes?
could it be connected to your recent changes?
Maybe, though I don't see right away how. I'd have to dig into this.
On a tooling spree with @jkciesluk and @AlterEgo7 we have found following:
- as a part of import process metals send command to mill-bsp to compile
mill.buildfile - compilation fails and mill-bsp kills itself
- metals
reconnectlogic kicks in and restarts the mill-bsp, then to step 1
Expected result - either of two:
- metals should track the fact the the last command was to compile mill own file and in case of compilation error do not restart mill-bsp server, instead waits for the next change in mill file and only then resarts mill-bsp
- mill-bsp shouldn't kill itself on unsuccessful compilation and instead should keep connection alive. This I will stress out in a mill repo
Additionally we were able to make a test case that reproduce this issue in MillServerSuite, I'll make a draft PR for it asap
looks like guys over at mill are planning to revamp bsp server, and it suppose to fix this issue as well. I'll monitor and close this issue when it's there