BSP: Detect and recover from changed mill versions
The current BSP server implementation depends on the exact Mill version. Each version change may result in a changed classpath, hence we currently require to re-run the install command mill mill.bsp.BSP/install. Unfortunately, this is something easily to forget, so we should better handle it, even if that means, the first start after a version change is a bit slower.
Background:
When installing, we generate a resource file which contains the extended classpath containing the BSP server implementation (worker).
After a version change, this resource file is not present and Mill fails to start the server.
Solution:
Start in some light mode, resolve and reinstall the resource file and restart the server.
If necessary, start with old server version first and speak with BSP client.
The BSP spec allows a BSP server to update the BSP connection file at any time, so it is probably ok and a good idea to re-generate it and then re-start the server.