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
    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?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    You can create a bsp.trace.json file as outlined here https://scalameta.org/metals/docs/contributors/getting-started.html#json-rpc-trace, that'd be the easiest way to see the communication
    the single character diagnostic actually reminds me of this which I saw in Mill where the diagnositcs being returned where also single character https://github.com/com-lihaoyi/mill/pull/999#issuecomment-733120085
    I haven't looked any more into it and no idea why it'd be that way
    Justin Kaeser
    @jastice
    thanks, I'll check and compare the trace
    rcano
    @rcano
    image.png
    is it possible that the new improved type printing in metals chokes on some recursive types? I've been hit by this today ↑
    the memory usage climbs as fast as possible, and even before reaching 100% heap usage it seems to get caught in an endless loop
    Chris Kipp
    @ckipp:matrix.org
    [m]
    ooo that's definitely not what we want. For sure create an issue with that @rcano and as much info as you can include the better
    Tomasz Godzik
    @tgodzik
    @jastice we don't have any custom logic for Metals in Bloop aside from adding semanticdb, so it should work exactly the same
    9 replies