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
    @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
    Sciss
    @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
    Sciss
    @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.
    And can be fixed by clean; compile
    Chris Kipp
    @ckipp:matrix.org
    [m]

    btw does nightly metals still somehow use 3.0.0 compiler to compile 3.0.1-RC1 sources specified in sbt?

    it shouldn't, no

    Swoorup Joshi
    @Swoorup
    That's Weird
    I wonder there is some sort of cache created by the compiler that creates this invalid blob or something
    Chris Kipp
    @ckipp:matrix.org
    [m]
    does this happening when switching from 3.0.0 -> 3.0.1-RC1 or just from a fresh RC1 project?
    Swoorup Joshi
    @Swoorup
    project dated far back as 0.27 dotty release. But I often git clean -dxf and clean in general.
    and is on 3.0.1-RC1 early as when it was released :P
    Swoorup Joshi
    @Swoorup
    is there an easy way to run a worksheet and drop into console?
    The imports and objects within the console is just an continuation of the worksheet.
    I have some time intensive thing going on, trying to think what is the best way of handling this, without writing a dedicated main project.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    not really no, however what is the end goal?
    is it that you just want quick repl responses?
    and if so, does the quick evaluation in the worksheet itself not suffice? or how would dropping into the console help?
    Swoorup Joshi
    @Swoorup
    its working with external web requests, akka streams, but don’t want the editor to time out.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    ahh, would maybe an ammonite script work better? so then you still have metals support in the script, but you can just run it with amm?
    Swoorup Joshi
    @Swoorup
    probably something like notebooks, which I assume has sections that can be independently executed but still has knowledge of context I assume?
    hmm, never tried ammonite.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    I'd recommend giving it a try
    Swoorup Joshi
    @Swoorup
    trying to look through some learning materials. What is the difference between ammonite vs sbt console?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    in some ways they can be used similarly but most of the time sbt console is used when you want to drop into a repl within the context of your sbt build. Ammonite has some of the same concepts, but is more used as either an alternative to the scala repl or as a script runner
    Swoorup Joshi
    @Swoorup
    does it still understand current sbt projects though?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    no, it's completely separated from sbt