Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tomasz Godzik
    @tgodzik
    it should actually use the coursier itnerface to download, maybe coursier should be updated in Bloop?
    I need to setup Scala steward finally
    I plan to put in more work on the Bloop side once I finish with scalafmt support for Scala 3
    scalavision
    @scalavision

    trying to get vscode metals to import ammonite script results in the following:

    ammrunner.CoursierError: Error fetching Ammonite 2.3.8-4-88785969 for scala 2.12.13
    ...
    Caused by: coursierapi.error.SimpleResolutionError$1: Error downloading com.lihaoyi:ammonite-repl-api_2.12.13:2.3.8-4-88785969

    any idea why such an old version of ammonite is required?

    I also have ammonite installed locally, could it use that one?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    so this is a bug in the current Metals version. We use that version of Ammonite (not the latest), because there was a regression in the first and only published version of the 2.12.13 Ammonite
    then pair that with an oversight on the Metals side and you get this
    You can get around this by setting the Scala version to one that is supported for that version of Ammonite, or change the version of Ammonite like as outlined here https://scalameta.org/metals/docs/troubleshooting/faq.html#ammonite-scripts
    Chris Kipp
    @ckipp:matrix.org
    [m]
    or you can also use the latest snapshot of Metals as well
    Eric K Richardson
    @ekrich
    @tgodzik Thanks, I’ll try that. Is someone working on Bloop to update? Not sure of the long term strategy for build server, Bloop or sbt or both? Do I need to put in an issue?
    scalavision
    @scalavision
    thanks @ckipp:matrix.org , this seems to work :-)
    Tomasz Godzik
    @tgodzik
    @ekrich I need to take a look at that, but haven't found the time yet :/
    Jakub Kozłowski
    @kubukoz
    I'm starting to think my machine is just cursed and that's why there are problems with Metals using too many resources..
    this doesn't happen on my personal laptop but happens consistently on all kinds of projects on the work one
    so I'll stop ranting after Wednesday :)
    Eric K Richardson
    @ekrich
    @tgodzik Any chance it could be updated before the Scala Native 0.4.0 deploy? I tried the bloop config thing but it doesn't seem to work.
    João Costa
    @JD557
    @kubukoz are you by chance using vim/coc.nvim? A while ago, I think I had metals configured twice for some reason on my laptop. Reinstalling metals and coc seemed to fix the issue
    Jakub Kozłowski
    @kubukoz
    nope, I'm using vscode
    Jesse Atkinson
    @jsatk
    I'm having a complete brainfart. How do I tell metals (in vim) to search for a missing import?
    I used to do this all the time and then took a week off work and now I can't remember 🤦‍♂️
    Never mind this was it.
    " Remap for do codeAction of current line
    nmap <leader>ac <Plug>(coc-codeaction)
    my brain was pushing only <leader>a
    Siddhant Sanyam
    @siddhant3s
    Hey guys, I would like to setup Metals in such a way that it doesn't need access to internet to fetch the dependencies. Is there a script/config that I can use so that it can access those deps from within a local files or a fat jar?
    Jakub Kozłowski
    @kubukoz
    If you have the dependencies cached with the usual ivy2/coursier mechanisms, I think you shouldn't need internet access on further runs
    import a project once and I'd say it should work offline from then on
    additionally, you might want to ask sbt to stop trying to use the internet: https://alvinalexander.com/scala/setting-putting-sbt-into-offline-mode-no-wifi/
    this would go either into your build as offline := true or possibly into the global sbt settings as Global / offline := true - I haven't tried that though
    sbt scoping is weird af so I wouldn't bet a dime on that
    Siddhant Sanyam
    @siddhant3s
    Thanks. In this case, I'd have to ensure that my ivy2/couriser cache is up to date. If there was a way I could know in advance what all deps Metals will fetch, I can make sure it is already present in the cache.
    Or if there is a a way I can run Metals as a standalone LSP and have VSCode extension connect to it using hostname and port.
    vito-c
    @vito-c
    how do you run organize imports from coc.nvim?
    1 reply
    Siddhant Sanyam
    @siddhant3s
    On that note, do we have a way for Metals Server and VSCode language client communicate using unix sockets instead of TCP?
    Jakub Kozłowski
    @kubukoz
    I was almost sure they don't use TCP but process stdin/stdout
    at least last time I had the sources opened
    about the caches - I'd say if you're able to do a build import, you have everything you need.
    Tomasz Godzik
    @tgodzik
    @siddhant3s you can use VScode ssh plugin, this will run Metals on a separate machine. Metals by default uses input/output, so this will not work currently otherwise.
    Eric K Richardson
    @ekrich
    @tgodzik Do you think it would be possible to just update coursier in bloop? I could give it a go if you don't have time?
    Siddhant Sanyam
    @siddhant3s
    @tgodzik This is running metals on a separate machine already using SSH Plugin. Basically the machine on which Metals run needs to be "sandboxed" in certain ways so we're trying to figure out if we can cut access to the internet and still have it run by pre-downloading the binaries to the coursier cache. But can you please tell me more about "Metals by default uses input/output," ? When I run Metals' VSCode plugin, I see it starts metal and that metals is actually listening on a TCP port.
    java    3124174 siddhant  101u     IPv4         1390651908      0t0        TCP localhost:42869 (LISTEN) <---------- Listening
    java    3124174 siddhant  107u     IPv4         1390656144      0t0        TCP localhost:33290->localhost:8212 (ESTABLISHED)
    java    3124174 siddhant  120u     IPv4         1390669649      0t0        TCP localhost:33626->localhost:8212 (ESTABLISHED)
    java    3124174 siddhant  121u     IPv4         1390673042      0t0        TCP localhost:33630->localhost:8212 (ESTABLISHED)
    Ayoub
    @I_am_ayoub_twitter

    Hi, I am trying to implement the decoration protocol with sublime so I added the following to the initializationOptions

        "decorationProvider": true,
        "inlineDecorationProvider": true

    and enabled "-Dmetals.show-inferred-type=true" but for a simple example like

    object Hello extends App {
      val l = List(1, 2, 3)
    }

    the client keeps receiving empty options meaning metals/publishDecorations: {'options': [], 'uri': 'file:///...'}
    Is there any other settings / flags I need to set so that for a simple example the client would receive actually some DecorationOptions ?

    Chris Kipp
    @ckipp:matrix.org
    [m]
    @I_am_ayoub_twitter: to test, it might be easier to try it in a worksheet first. Since you will really only need the decorationProvider enabled for that. then you can see the most basic ones come. As far as I know, -Dmetals.show-inferred-type=true will do nothing
    we stopped adding new settings to flags like this, and now everything is done via InitializationOptions instead.
    however I now see that the new options we create are still getting published on the site as new properties, which we will need to fix
    Chris Kipp
    @ckipp:matrix.org
    [m]
    ah, actually sorry to confuse you, I meant UserConfiguration, not InitializationOptions
    but yea, make sure it's sent the way outline there, not as a server property
    I also created an issue to remind us to fix it. I'll be able to get it fixed in the next couple days