Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ó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
    Ólafur Páll Geirsson
    @olafurpg
    @jastice metals expands the range to the token in order to keep the diagnostics updated alongside syntax errors while you type
    Metals uses edit-distance to align the position from the old snapshot of the source code and the in-memory buffer
    Hanns Holger Rutz
    @Sciss
    quick thought, as I skimmed through the nvim intro by @ckipp:matrix.org - it should be possible to embed metals in a desktop app indirectly by using nvim --embed with a UI embedding, and then somehow configuring that nvim instance to use metals. correct? would that be a reasonable approach? that way I could ditch a custom editor altogether, although the work will shift to implementing the nvim UI client. has anyone done such thing, implement the nvim UI API in a Scala app?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    I'm not super familiar with how --embed works, but if the embedded nvim still uses the same plugin architecture then yea, you'd be able to also bundle in https://github.com/scalameta/nvim-metals, which would give you the full power of Metals, even installation
    Hanns Holger Rutz
    @Sciss
    great. I think I will explore this. as far as I understand --embed, it simply means it runs the full nvim but without its own UI, and then you use the RCP interface to receive UI events such as redraw commands, and the client is free to render that in whatever architecture (will be Java2D in my case).
    Swoorup Joshi
    @Swoorup
    wonder if I can use the latest nightly to get 3.0.1-RC1 support :P ?
    with 3.0.0 I run constantly into a dotty compilation bug which was fixed on RC
    Vadim Chelyshov
    @dos65
    @Swoorup you can use latest snapshot version - 0.10.4+41-4ceb9050-SNAPSHOT
    Hải Hoàng
    @Fubuchi
    image.png
    do I need extra steps to make project explorer work with sbt? Surrently it shows nothing, it is a standard scala3.g8 template. I tried to add some class to Main.scala file but nothing show up here
    Greg Fisher
    @gnfisher
    This message was deleted
    I'm seeing a curious thing (metals/coc.nvim) where a value class that was updated is understood properly in some places but not in others. For example, after the change, in the same function, the result errors (expects a single value, it has been changed to a list, compiler understands). yet in the body of that function, the autocomplete behaves real strangely, thinking it is still the single value type (with the old attribute name). I've done a bloop exit and restarted nvim/metals... not going away. Any suggestions?
    Swoorup Joshi
    @Swoorup
    is there a way to directly import external sbt project in worksheet file?
    Swoorup Joshi
    @Swoorup
    nvm
    Chris Kipp
    @ckipp:matrix.org
    [m]
    @Fubuchi: there shouldn't be anything special needed to get nodes to show there I believe in Scala 2 that's the way it works, so it may be something funky going on with Scala 3. I see you created a discussion about it. I'll move it to an issue and we'll follow-up there.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    @gnfisher: 🤔 are you able to provided maybe a minimal example of what is happening @gnfisher and submit an issue with it? I'm not fully sure what could be going on
    nafg
    @nafg
    https://youtu.be/97HCUZwRpQA how does @kubukoz get errors to show inline?
    Jakub Kozłowski
    @kubukoz:matrix.org
    [m]
    Error Lens vscode extension
    nafg
    @nafg
    thanks :)
    Kamyar
    @kammoh:matrix.org
    [m]

    Hi!
    I'm using metals+vscode+bloop on macOS/M1 where only the snapshot versions of bloop work. I've set "Bloop Version" settings to "1.4.8-45-8b51bdd9" and have the same version of bloop-jvm installed using coursier. Native "bloop" is not installed and the bloop is a symlink to bloop-jvm. I am absolutely sure there's not other bloop executable on my system.

    Everything work fine and bloop version seems to be correct

    ls -al `which bloop`
    lrwxr-xr-x  1 kamyar  staff  64 Jun  4 13:28 /Users/kamyar/.local/bin/bloop -> /Users/kamyar/Library/Application Support/Coursier/bin/bloop-jvm
    
    ❯ bloop about 
    bloop v1.4.8-45-8b51bdd9

    Until once in a while things stop working and when I the check the running server version I get:

    ❯ bloop about
    bloop v1.4.8-19-4d9f966b

    Where is this server version coming from and how can I stop this from happing?
    Cleaning the project (+.bloop and .metals directories, metals.sbt files etc) and killing running java processes solves the issue for a while but it happens again in couple of days!
    I also tried adding bloop-sbt plugin with the correct version to my project but it doesn't seem to be helping.

    Kamyar
    @kammoh:matrix.org
    [m]

    :point_up: Edit: Hi!
    I'm using metals+vscode+bloop on macOS/M1 where only newer snapshot versions of bloop work. I've set "Bloop Version" settings to "1.4.8-45-8b51bdd9" and have the same version of bloop-jvm installed using coursier. Native "bloop" is not installed and the bloop is a symlink to bloop-jvm. I am absolutely sure there's not other bloop executable on my system.
    Everything work fine and bloop version seems to be correct

    ls -al `which bloop`
    lrwxr-xr-x  1 kamyar  staff  64 Jun  4 13:28 /Users/kamyar/.local/bin/bloop -> /Users/kamyar/Library/Application Support/Coursier/bin/bloop-jvm
    
    ❯ bloop about 
    bloop v1.4.8-45-8b51bdd9

    Until once in a while things stop working and when I the check the running server version I get:

    ❯ bloop about
    bloop v1.4.8-19-4d9f966b

    Where is this server version coming from and how can I stop this from happing?
    The only trace of that version in my project directory is in .metas/metals.log:

    > No server running at 127.0.0.1:8212, let's fire one...
    > Resolving ch.epfl.scala:bloop-frontend_2.12:1.4.8-19-4d9f966b...

    Cleaning the project (+.bloop and .metals directories, metals.sbt files etc) and killing running java processes solves the issue for a while but it happens again in couple of days!
    I also tried adding bloop-sbt plugin with the correct version to my project but it doesn't seem to be helping.

    3 replies
    Swoorup Joshi
    @Swoorup
    under -source:future I get an issue with worksheet
    image.png
    It thinks I am using underscores for imports even though asterisks has been used.
    Swoorup Joshi
    @Swoorup
    logged an issue: scalameta/metals#2864
    Swoorup Joshi
    @Swoorup
    btw does nightly metals still somehow use 3.0.0 compiler to compile 3.0.1-RC1 sources specified in sbt?
    I am getting this issue time and again.
    [error] ## Exception when compiling 16 sources to /Users/swoorup.joshi/personal/finflow-scala/trader/target/scala-3.0.1-RC1/classes
    [error] scala.MatchError: AppliedType(TypeRef(TermRef(TermRef(ThisType(TypeRef(NoPrefix,module class finflow)),object common),WithEnv$package),WithEnv),List(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class typesafe)),object config),Config), AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class actor)),object typed),Behavior),List(TypeRef(ThisType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class trader)),object actors),module class TradeEngine$)),type Command))))) (of class dotty.tools.dotc.core.Types$CachedAppliedType)
    which is fixed on the RC1 version, but somehow props up every now and then.