Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Swoorup Joshi
    @Swoorup
    This seems like what I want :P
    image.png
    Quafadas
    @Quafadas
    @Swoorup almond is awesome...
    Swoorup Joshi
    @Swoorup
    :frowning: Have to wait for scala 3 support and no sbt project support due to ammonite.
    Anton Sviridov
    @velvetbaldmime:matrix.org
    [m]
    Scala 3 support has been merged in Ammonite, not sure how stable it is. Almond will follow suit eventually, as the maintainer of it was indeed the one who merged Scala 3 support :)
    You can potentially already run Scala 3 scripts with ammonite, just need the right version:
    ❯ cs launch ammonite --scala-version 3.0.0
    Loading...
    Welcome to the Ammonite Repl 2.3.8-124-2da846d2 (Scala 3.0.0 Java 14.0.1)
    @ import $ivy.`org.typelevel::cats-core:2.6.1`
    import $ivy.$
    
    @ import cats._
    import cats._
    
    @ case class Test(a: Int)
    defined class Test
    
    @ given Eq[Test] with
        def eqv(t1: Test, t2: Test) = t1.a - t2.a == 0
    
    defined object ``
    
    @ import cats.syntax.all._
    import cats.syntax.all._
    
    @ Test(25) === Test(35)
    res5: Boolean = false
    Swoorup Joshi
    @Swoorup
    oh lol, nice :D
    Anton Sviridov
    @velvetbaldmime:matrix.org
    [m]
    Swoorup Joshi
    @Swoorup
    Sounds like internal only feature from that changelog description, but I’ll give you the benefit of doubt. :P
    sinanspd
    @sinanspd
    Is there an easy way for me to introduce a new keyword to be highlighted (I am running my own distribution of Scala to develop new features) ?
    Anton Solovyev
    @Rosteelton
    image.png
    Hi! I have some problems with go to sources in scala 3.0 with vscode.
    For some classes it doesn't work, for example, ConfigReader (but I can find it manually with #ConfigReader).
    Is there some issue with it?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    @Swoorup: cool I hope that works for you!
    @sinanspd: I don't believe there is an easy way to add that unless you'd add it into the actual scala syntax plugin https://github.com/scala/vscode-scala-syntax
    Sheng-Loong Su
    @code_ssl_twitter
    Hi everyone, is there a way in Vim to quickly add type annotation like in Intellij, eg. from def run() = {...} to def run(): Unit = {...}? I tried coc-codeaction-line and got No code action available.
    felher
    @felher
    @code_ssl_twitter I asked that myself a couple of months back. The answer was: Move with the cursor over the variable and do:
    :call CocActionAsync("codeAction", "cursor")
    Of course, you should be able to map that to whatever you want :)
    Sheng-Loong Su
    @code_ssl_twitter
    Wow, it works! Thanks a lot, @felher!
    Quafadas
    @Quafadas

    WIth metals, I'm using sbt as my build server in an (experimental :-/) multi project setup,

    I want to customise some integration tests

    class WithDbFramework extends utest.runner.Framework

    In an SBT terminal, the tests run fine.

    If I click on the "ghost link" to run the test "in place" in metals, I get errors. The test looks for a test config file;

    val confFile = new File("./modules/backend/src/test/scala/dev.conf")

    which apparently, it can't find ...

    [ERROR] Uncaught exception when running tests: org.ekrich.config.ConfigException$Missing: ./modules/backend/src/test/scala/dev.conf (not found): No configuration setting found for key 'db'

    Would this be expected? Is it expected that an sbt terminal exhibits different behaviour to "metals runner"?

    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    Hello 👋 just joined to ask whether i need to set up sth specifically for getting metals support for simple scala scripts in VS code
    Chris Kipp
    @ckipp:matrix.org
    [m]
    hey Nik, can you explain what sth is?
    Anton Sviridov
    @velvetbaldmime:matrix.org
    [m]
    sth = something? :)
    Chris Kipp
    @ckipp:matrix.org
    [m]
    lol if that means something, then once you have Metals installed, there is nothing additional you'd need for a Scala script
    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    Ok so if i open up a folder containing only a file of data and a script.sc, suggestions should work fine? :o
    Chris Kipp
    @ckipp:matrix.org
    [m]
    well it sort of depends on what you're expecting
    if you open script.sc in an empty directory Metals will assume that you have an ammonite script and will prompt you to import it
    so it will be treated as an Ammonite script
    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    ah i see :/ so then scala 3 is just not gonna work :/
    or did li & co. already port it?
    Anton Sviridov
    @velvetbaldmime:matrix.org
    [m]
    There's some preliminary support for Scala 3 in ammonite, yes
    Chris Kipp
    @ckipp:matrix.org
    [m]
    afaik, we have zero tests for Ammonite and Scala 3
    so it sort of depends on what your aim is
    it might be preferable to use worksheets if you are just messing around
    also keep in mind that if you have a directory with a standalone file, the version of Scala that will be used will be defaulted to the version that metals uses
    if you want a fallback on Scala 3 instead you'd need to set fallbackScalaVersion in your settings
    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    aaah! i see, thank you
    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    just as a brief example:
    i was hacking this smol script for doing a bunch of random calculations and scala 2 support works pretty well, but scala 3 just goofs on me :/
    also this when i manually start the ammonite server
    Chris Kipp
    @ckipp:matrix.org
    [m]
    yea, so the version of Ammonite we support isn't published for Scala 3 yet
    you can also add a newer ammonite version with // ammonite <version>
    but again, no guarantees how that will work
    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    cool :o i'll just try a few things
    Chris Kipp
    @ckipp:matrix.org
    [m]
    actually just looked
    I'm pretty positive it won't work
    Nik
    @your-psychiatrist:ellipsen.net
    [m]
    yeah it doesnt :/