Open
Description
In Neovim, diagnostics are not updated after editing within a line and saving file.
Diagnostic seem to be only updated if a new line is added.
Other LSPs seem to work fine e.g. lua_ls
in Neovim and VSCode also works fine.
Here is a short video showing this behavior:
outdated_diagnostic.mp4
Repro steps
- Setup Neovim with
kotlin_lsp
over TCP (see setup below) - Create hello world gradle project with
gradle init
- Open up App.kt, observe diagnostic for "Use expression body ...." at line with
return "Hello World!"
- Delete
return
in that line - Observe lack of diagnostics for missing return
- Save with
:w
, same result - Add a new line above current
- Observe missing return diagnostic
No error logs printed on server side.
Debug level Logs from :LspLog
in Neovim: lsp_logs_debug.log
Setup
- I'm on Windows. I wrote a powershell version of
kotlin-lsp.sh
. - Neovim version is NVIM v0.11.1
nvim-lspconfig
plugin is on commitb8e7957
(a recent commit)- Here is snippet for
kotlin_lsp
from my Neovim config:
vim.lsp.config("kotlin_lsp", {
cmd = vim.lsp.rpc.connect("127.0.0.1", 9999),
single_file_support = true,
filetypes = { "kotlin" },
root_markers = {
"settings.gradle",
"settings.gradle.kts",
"pom.xml",
"build.gradle",
"build.gradle.kts",
"workspace.json",
},
})
vim.lsp.enable("kotlin_lsp")
-- Enable client side debug logging
vim.lsp.set_log_level("debug")
if vim.fn.has("nvim-0.5.1") == 1 then
require("vim.lsp.log").set_format_func(vim.inspect)
end
- I reproduced the issue also with barebones Neovim config that has just the snippet as
init.lua