Closed pact0 closed 2 years ago
I sort of managed to "fix" this, found a workaround at least. I disabled formatting by efm and added this as a specific clangd
cmd. It seems to be working, but I am still unsure about the error which I was getting earlier.
['clangd'] = function()
default_opts = {
root_dir = lspconfig.util.root_pattern("compile_commands.json",
"compile_flags.txt",
".git") or
lspconfig.util.dirname,
on_attach = function(client, bufnr)
client.resolved_capabilities.document_formatting = true
on_attach(client, bufnr)
end,
filetypes = {"c", "cpp", "objc", "objcpp"},
cmd = {
"clangd", "--background-index", "--pch-storage=memory",
"--clang-tidy", "--suggest-missing-includes"
},
capabilities = capabilities,
single_file_support = true
}
end
I am getting the same thing (on every single character I type) when using null-ls
, so it is likely something that changed either with the core LSP client in Neovim (I'm using the latest nightly
build) as I have not updated clangd
itself in a long time @pact0.
Yea, this was added recently here (at least the vim.notify
call itself)
Okay, any idea what causes it? I am not that familiar with this code, any way to temporary fix this?
I made a kind of hacky PR and got some advice on how to do it better, see here. Basically you just manually specify the capabilities to be { "utf-16" }
explicitly.
Adding this line to the clangd's capabilities fixed the error capabilities.offsetEncoding = { "utf-16" }
.
What does this error mean? Relevant parts of the config, I am setting up efm with lsp.installer but it is manually installed with go. clang_format.lua
After
:LspInfo
I can seeefm
andclangd
attached with no problems. It even seems to be formatting on save since I have efm set up to do so, but each time the error shows up and it is really annoying. Is there any way to fix this/disable the error?