ionide / ionide/Ionide-vim

Neovim lsp functionality doesn't work until after file is edited.

Open
#43 15 comments 1 reaction 1 assignee Claimed by @cannorin View on GitHub
bug
Dominant language
Vim Script
Stars
211
Forks
28
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Lsp functionality (go to definition, find references, etc) doesn't work when a .fs file is first opened. Codelens for function definitions show "Unresolved lens ..."

Once I have edited the file and exited insert mode for the first time, all functionality starts working.

The lsp log file shows:
[ERROR][2021-11-14 14:11:16] .../vim/lsp/rpc.lua:462 "rpc" "dotnet" "stderr" "[14:11:16.356 WRN] [LSP] CodeLensResolve - Cached typecheck results not yet available for /home/kcarlton/dev/fsharp/FTest/src/App/Program.fs\n"

**Environment**
- OS: ubuntu 20.04 running in wsl2 on windows 11
- Neovim version: 0.5.1
- dotnet SDK version: 5.0.403
- .Net Framework version: 5.0.12

**Additional context**
Installed with vim-plug. Using nvim-lsp. No configuration set other than keybindings.

It looks like the InsertLeave autocmd is running condelens.refresh(). At this point lsp functionality starts working.
But manually running :lua vim.buf.codelense.refresh() before this doesn't do anything.

If I disable codelense:
let g:fsharp#lsp_codelens = 0
Then the lack of lsp functionality happens. But in this scenario running :lua vim.buf.codelense.refresh() restores functionality.

Plugin is working wonderfully otherwise!
I'm pretty new to neovim. Sorry if I've missed something dumb.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.