-
Notifications
You must be signed in to change notification settings - Fork 346
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
Ability to start sbt session before Metals connects using sbt -bsp #2152
Comments
Thanks for reporting! I think we could ask an additional question whether you would like to start a bsp session when an sbt build is detected. Though, I am not sure how best to run the terminal, which would work in all the possible editors 🤔 |
I think it is a good idea! I would like to have something like:
The good thing is that it lets you the opportunity to start the sbt shell by yourself inside Metals before clicking that you want Metals to connect to sbt.
It may seem a bit convoluted but it is the best user experience I can think of because it handles all the case I have personally experienced:
|
I'm going to hijack this a bit, and then make follow-up tickets more than likely in the extension repos for actually opening sbt in another tab/window/etc depending on the client. However, I think this ticket is an important part of #2049 and I'm already hitting on it a bit as I'm working through it. One of the potential "flows" from #2049 is the the following:
Again following up on the conversation in #2049, but limiting it only to the scenario above, I'm introducing a new server command (name is flexible),
Again, this is only focused on the situation above where there is an entirely clean workspace and there needs to be an sbt session started before the BSP connection is made. I'll follow-up in #2049 with other stuff as I come across it with switching after the user already imported with Bloop, etc. Also regarding opening a tab or window with sbt running etc, I consider that a client detail that will need to be worked out for each client. |
@ckipp01 I think that is exactly the way to go! Great work figuring out 👏 |
Sounds great! You may find useful to use the
I think this feature is not much useful anymore since one can use the |
Ah neat, I didn't know about this before. However, I'm not sure I'll actually use it. One of the issues I hit on was that after the creation of the |
Is your feature request related to a problem? Please describe.
.bsp/sbt.json
.java -cp sbt-launch.jar xsbt.boot.Boot -bsp
, which is sbt running in client mode.sbt -bsp
does not find a running sbt session it will try to spawn sbt (server) in the background, which will take time and timeout..bsp/sbt.json
but that doesn't feel right either.Describe the solution you'd like
In addition to
sbt -bsp
, I would like a mechanism to suggest to Metals to open up a new terminal window and start a new sbt session by typing in "sbt", and wait for the server to come up. (The code exists here - https://github.com/sbt/sbt/blob/e323f1f713251968b3d4ecda8a7f0ed52593713a/vscode-sbt-scala/client/src/extension.ts#L34-L45)Describe alternatives you've considered
Or maybe some hardcoded solution like a preference that starts sbt when sbt version is above 1.4.0-M1?
This could be convenient for testing etc purpose even if the user doesn't want to use sbt server as the build server.
Additional context
Search terms:
The text was updated successfully, but these errors were encountered: