Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Chris Kipp
    @ckipp:matrix.org
    [m]
    btw @jsatk just merged in a fix that should prevent you from seeing the crazy stale semantidb error now
    Jesse Atkinson
    @jsatk
    OMG TY. I’m gonna read over it because I’m dying to know what it was.
    @milessabin I recognize your avatar from Twitter. Welcome!
    Chris Kipp
    @ckipp:matrix.org
    [m]
    this was the change scalameta/metals#2921
    it started out as the title says, but then we ended up doing a couple extra checks as well
    also keep in mind that if you are using saga and using the lightbulb feature for code actions, you're actually querying metals constantly for code actions
    vito-c
    @vito-c
    Is it possible to have a worksheet with a different file ending than foo.worksheet.sc?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    no the *.worksheet.sc is hardcoded into all the functionality needed on the Metals end for the time being
    Jesse Atkinson
    @jsatk
    Are there any plans to support go-to-definition for scala docs?
    It works in intelliJ.
    Chris Kipp
    @ckipp:matrix.org
    [m]
    we haven't actually chatted a lot about it, but it honestly should be doable
    i know there was talk a while back about getting clickable links in hovers for scaladocs, but that wouldn't really help the vim world
    Chris Kipp
    @ckipp:matrix.org
    [m]
    heads up, I'm throwing the whole next / main branch strategy in the trash and just sticking with one branch, main
    if need be I'll add in checks to the code to ensure things maintain compatability
    I just really don't want to manage two branches
    so if you are set to next, please just remove it
    they are in sync at them moment, so there really isn't a change
    cquiroz
    @cquiroz:matrix.org
    [m]
    Thanks for the notice, and yes keeping multiple versions is quite a task
    Jesse Atkinson
    @jsatk
    @ckipp:matrix.org i've been wanting to contribute for ages but just havent found an issue to solve (that you didn't get to first ;)) would working on go-to-definition support for scaladocs be, uh, do-able for me? (experienced with vim & scala. New to the metals code base tho.)
    Chris Kipp
    @ckipp:matrix.org
    [m]
    so pretty much 100% of the work would be done on the Metals side @jsatk
    and my assumption would be that it'd work the same as a normal definition request
    the request would go to Metals and Metals would need to recognize the symbol underneat the cursor and navigate to it
    there doesn't even seem to be a feature request for it, so the first thing to do would be to create a feature request for this https://github.com/scalameta/metals-feature-requests
    as for the difficulty. I'm not entirely sure since I'm not super famaliar with how the scaladocs parse and if the symbol information in the doc is part of what is produced in semanticdb
    I don't believe it'd be super difficult, but would require a little digging to figure out how to actually do it
    Jesse Atkinson
    @jsatk
    Thank you :)
    Submitted.
    alexcardell
    @alexcardell:matrix.org
    [m]
    Has anybody managed to make https://github.com/ray-x/lsp_signature.nvim/ work with metals? I've tried both the on_attach and setup methods. on_attach works in other LSPs, I just tested with typescript, but not metals. No errors or logging that I can see, calling either vim.lsp.buf.signature_help() and require'lsp_signature'.signature()
    That virtual text hint is pretty nifty
    Chris Kipp
    @ckipp:matrix.org
    [m]
    So I've never seen it before, but I just tested it out and it seems to work fine
    how are you setting it up?
    alexcardell
    @alexcardell:matrix.org
    [m]
    
    local M = {}
    
    M.metals = metals.bare_config
    
    M.metals.on_attach = function()
        metals.setup_dap()
    
        require'lsp_signature'.on_attach(require'alex.signature')
    end
    
    M.metals.init_options = {
         -- If you set this, make sure to have the `metals#status()` function
         -- in your statusline, or you won't see any status messages
         statusBarProvider            = "on";
         inputBoxProvider             = true;
         quickPickProvider            = true;
         executeClientCommandProvider = true;
         decorationProvider           = true;
         didFocusProvider             = true;
         debuggingProvider            = true;
       };
    
       M.handlers = {
         ["textDocument/hover"]          = metals['textDocument/hover'];
         ["metals/status"]               = metals['metals/status'];
         ["metals/inputBox"]             = metals['metals/inputBox'];
         ["metals/quickPick"]            = metals['metals/quickPick'];
         ["metals/executeClientCommand"] = metals["metals/executeClientCommand"];
         ["metals/publishDecorations"]   = metals["metals/publishDecorations"];
         ["metals/didFocusTextDocument"] = metals["metals/didFocusTextDocument"];
       };
    
    M.metals.settings = {
         showImplicitArguments = true;
         showInferredType = true;
         superMethodLensesEnabled = true;
         showImplicitConversionsAndClasses = true;
       };
    
    return M
    and that is called in initialize_or_attach in my autocmd
    the alex.signature config object is shared with all my lspconfig setup too, so it works
    {
      bind = true,
      floating_window = false,
      hint_enable = true,
      hint_scheme = "String",
      extra_trigger_chars = {"(", ","}
    }
    Chris Kipp
    @ckipp:matrix.org
    [m]
    if you only use require("lsp_signature").on_attach() instead of your require alex one, does it work then?
    alexcardell
    @alexcardell:matrix.org
    [m]
    Nope
    Did it work out of the box for you?
    Chris Kipp
    @ckipp:matrix.org
    [m]
    ahh sorry misunderstood what it was doing, didn't realize it was just a settings table
    yea I added it and it just worked
    after included the on_attatch()
      Metals_config.on_attach = function(client, bufnr)
        require("metals").setup_dap()
        require("lsp_signature").on_attach()
      end
    alexcardell
    @alexcardell:matrix.org
    [m]
    Peculiar
    Okay well at least it's just my config, that narrows it down
    Jesse Atkinson
    @jsatk
    Does nvim-metals integrate with airline? I've read through both the readme and help for airline, the section on statusbar stuff on the metals website (which is bias towards Coc) and the :h metals intro stuff about how to add it to status line. It's still not just auto-magically showing metals info even tho I have `metals_config.init_options.statusBarProvider
    = "on"`
    Oddly in vim 8 with Coc it does show the metals info.
    I suspect whatever property Coc sets for statusline is automatically being picked up by airline but not with the case of nvim-metals.
    Jesse Atkinson
    @jsatk
    I'm trying to sus out how to do this from the galaxyline config I shamelessly stole from @ckipp:matrix.org
    it's just odd that this works for coc-metals out of the box