ionide / Ionide-vim

F# Vim plugin based on FsAutoComplete and LSP protocol
MIT License
174 stars 21 forks source link

CodeLens doesn't always refresh #69

Closed no1melman closed 1 year ago

no1melman commented 1 year ago

Describe the bug Essentially, after opening a couple of buffers, CodeLens stops loading properly

To Reproduce Steps to reproduce the behaviour:

I have NvChad, so a tree explorer, and nvim lsp with Ionide loaded

  1. Open up several buffers
  2. See the codelens start to fail

Expected behaviour CodeLens should always show...

Screenshots image

Environment (please complete the following information):

Additional context I have created a command to automagically call this for me

vim.api.nvim_create_user_command("FSharpRefreshCodeLens", function()
  vim.lsp.codelens.refresh()
  print "working..."
end, {
  bang = true,
})

In my init.lua script, if anyone was curious on how to get around this...

no1melman commented 1 year ago

In actual fact, I've just done better when requiring ionide and auto setting it up.

require("ionide").setup {
  on_attach = function(client, bufnr)
    on_attach(client, bufnr)
    vim.lsp.codelens.refresh()
  end,
  capabilities = capabilities,
}

This seems to force the refresh

cannorin commented 1 year ago

@no1melman Hi! Can you check (with the workaround removed) if the fix-69 branch fixes the problem? It injects vim.lsp.codelens.refresh() to on_attach.

no1melman commented 1 year ago

OOOOoooo I will have a check in a bit