Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Markus Appel
    @markusa380
    Would it be up to BSP spec to start an instance of SBT explicitly in the integrated terminal? That would make sense in more than one way.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    when looking in there, I'm assuming you don't see the env variables you're looking for?
    if that's the case please do submit an issue with a reproduction
    Markus Appel
    @markusa380
    I don't even know what this JSON file contains as info, can I just "hack" it to not start SBT somehow?
    Again, I'm completely okay with not having functionality until SBT is started. I just want to be able to use SBT at the same time as using Metals.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    I'm still not sure I understand why you can't. Even after metals starts sbt, you should still be able to open your terminal, connect to the running server and issue commands
    Markus Appel
    @markusa380
    With SBT being more important as it tells me when it's done with compilation, while Metals leaves me to guess depending on how many seconds ago the list of errors has changed.
    Because SBTN is a buggy mess.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    also, are you issueing compile command via sbt in this scenario?
    Markus Appel
    @markusa380
    It randomly disconnects, and selecting recent commands with [Arrow Up] or pressing tab for autocomplete bugs out if SBT is busy
    Sometimes
    Chris Kipp
    @ckipp:matrix.org
    [m]
    I mean if sbt is your build server then compiling manually via sbt is redundant as a save in VS Code will also trigger the same compile
    Markus Appel
    @markusa380
    Metals leaves me to guess [when compile is done] depending on how many seconds ago the list of errors has changed.
    Especially on compile heavy projects this can get quite upsetting :(
    But apart from this I want to be able to run clean and test when I want
    Vadim Chelyshov
    @dos65
    @/all new release 0.10.4 with Scala 2.12.14 support is published
    Chris Kipp
    @ckipp:matrix.org
    [m]

    Because SBTN is a buggy mess.

    there has been a ton of work on the sbt side on sbtn, so please refrain from shitting on it here

    as for the clean and test, there are also ways to directly do these in VS Code, so that may not be ideal for you
    Markus Appel
    @markusa380
    I am not, it's a gods gift, but it's not yet stable enough for my day to day work
    Chris Kipp
    @ckipp:matrix.org
    [m]
    all that to say, trying to think through a workflow for you, one thing maybe to try, although it'd take an extra step would be to open VS COde, which would start sbt, especially since you chose to use it in the past
    after that, you could issue the Build Disconnect command which would shut your build server down
    then open your terminal and start it again that way
    Markus Appel
    @markusa380
    That's pretty similar to what I do already
    Chris Kipp
    @ckipp:matrix.org
    [m]
    but in theory that should be exactly the same as just attaching to the running server already
    Markus Appel
    @markusa380
    Whenever I open VSCode I run the following commands:
    sbt --client shutdown
    sbt
    Takes half a minute because of course the first instance is busy for a minute compiling before I can shut it down
    Look, Metals can't abstract SBT away, there's too much custom functionality. Every developer has some SBT console open while working in the IDE to run special commands. I mean the list of SBT commands is very long.
    Chris Kipp
    @ckipp:matrix.org
    [m]

    It randomly disconnects, and selecting recent commands with [Arrow Up] or pressing tab for autocomplete bugs out if SBT is busy

    Have these been reported to sbt?

    again to reiterate ideally in theory having Metals start sbt and then attaching to it via the embedded terminal should work fine
    Markus Appel
    @markusa380
    In a perfect world that would be the way to go
    Chris Kipp
    @ckipp:matrix.org
    [m]
    there are certain things you can't do at the same time with multiple connections to the server, that's a limitation of BSP support in sbt I believe, but still connecting to it shouldn't be an issue. I'd recommend reporting issues that sbt is having in that scenario there
    Markus Appel
    @markusa380
    Sure, okay
    Chris Kipp
    @ckipp:matrix.org
    [m]
    you could possibly disable Metals for a workspace as well
    then yo ucould open the project without metals triggering anything
    and then you'd be able to start sbt, and then enable Metals
    that might work in your scenario
    Markus Appel
    @markusa380

    you could possibly disable Metals for a workspace as well

    Seems like you guys seem suggesting this, but it's way too cumbersome.
    I asked a while ago why we couldn't stop Metals temporarily in case of broken builds and received the same answer, but the truth is going into plugin settings instead of issuing a command is just not ergonomic.

    Ólafur Páll Geirsson
    @olafurpg
    @markusa380 I think this particular issue lies on the sbt side, which generates the .bsp/sbt.json file. You could file an sbt/sbt feature request to make the generated command fail if it needs to start a new server instead of reconnecting
    Markus Appel
    @markusa380
    And in no form is that suggestion easier than my current way of killing and restarting SBT anyways. It's not that I don't have a solution, it's that it's just cumbersome.
    Ólafur Páll Geirsson
    @olafurpg
    Metals is only executing the command that sbt provides
    I suspect the .jvmopts settings are not respected because sbt is not including those settings inside the .bsp/sbt.json command.
    Metals does respect .jvmopts when running sbt bloopInstall, and that's what the "sbt script" setting is used for
    Markus Appel
    @markusa380
    Wait, it seems like Metals overwrites the .bsp/sbt.json file, is that possible? I changed it for testing purposes and it got reset...
    Or it might be SBT overwriting it, I don't know
    Chris Kipp
    @ckipp:matrix.org
    [m]
    Metals will only ever overwrite it if you issue the Metals Generate BSP Config Command
    that's the only time Metals will ever trigger sbt to write it
    Andreas Flierl
    @asflierl
    yeah I suspected that this was something that is missing on the SBT side of things :-/
    heksesang
    @heksenlied:matrix.org
    [m]
    When I have selected the auto-import option for ammonite scripts, how do I reset that choice?
    Justin Kaeser
    @jastice
    In a Scala3 sbt project, highlighting in Metals seems to work fine. Yet when I import the same project in IntelliJ, the diagnostics I get from Bloop (or sbt server) have only single character ranges. Any idea what's up here? For Scala 2.13, it works fine in both
    also how can I inspect the bsp messages from metals/vscode?