Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccls - warning: multiple different client offset_encodings detected for buffer, this is not supported yet #2709

Open
ColinKennedy opened this issue Jul 10, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@ColinKennedy
Copy link
Sponsor

ColinKennedy commented Jul 10, 2023

Description

When using nvim-lspconfig with ccls (note, not clangd), I get the following message:

warning: multiple different client offset_encodings detected for buffer, this is not supported yet

There's been a past issue about this with clangd here, #2184 and the server configuration documentation mentions, for clangd, to use "default capabilities, with offsetEncoding utf-8" but it's unclear to me how to apply the same advice to fix this for ccls. Could someone advise on what configuration is needed to fix this pretty spammy warning?

Neovim version

NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/__w/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/build/src/nvim/auto -I/__w/neovim/neovim/build/include -I/__w/neovim/neovim/build/cmake.config -I/__w/neovim/neovim/src -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Nvim-lspconfig version

8dc45a5

Operating system and version

CentOS 7

Affected language servers

ccls

Steps to reproduce

  • Compile the latest https://github.com/MaskRay/ccls (in my case, tag 0.20220729)
  • Include the minimum config as a part of nvim-lspconfig
  • Load a C++ file and wait. The warning shows

Actual behavior

Constant warnings about UTF encodings

Expected behavior

Normal LSP behavior

Minimal config

local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()

capabilities.offsetEncoding = "utf-8"
capabilities.offset_encoding = "utf-8"
capabilities.clang = {}
capabilities.clang.offsetEncoding = "utf-8"
capabilities.clang.offset_encoding = "utf-8"
lspconfig.ccls.setup { capabilities=capabilities }

LSP log

https://gist.github.com/ColinKennedy/1e0afe0158751bb9947902c831fdbe08

@ColinKennedy ColinKennedy added the bug Something isn't working label Jul 10, 2023
@glepnir
Copy link
Member

glepnir commented Jul 10, 2023

should be solved in nightly can you try latest version

@ColinKennedy
Copy link
Sponsor Author

ColinKennedy commented Jul 10, 2023

By nightly, do you mean the latest commit of nvim-lspconfig? I've pulled up to deade69 just now but it still gives the same error.

@glepnir
Copy link
Member

glepnir commented Jul 10, 2023

neovim latest build

@ColinKennedy
Copy link
Sponsor Author

ColinKennedy commented Jul 11, 2023

I changed Neovim to the current nightly tag. At the time of writing it's

NVIM v0.10.0-dev-653+gfbeef0d4e
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

My nvim-treesitter was a bit out of date so I updated that too, to nvim-treesitter/nvim-treesitter@90581ac. nvim-lspconfig is also at its latest commit, deade69. With the same configuration posted above, I still get the multiple different client offset_encodings error.

@sebastiancarlos
Copy link

I am having the same issue.

@mindbound
Copy link

Same here.

@AndreM222
Copy link

I am having this problem but for clangd. Has this been firgured out for clangd? I tried setting up the capabilities to utf 16 but it still pritns out the error message.

@ColinKennedy
Copy link
Sponsor Author

ColinKennedy commented Mar 14, 2024

@AndreM222

For clangd, you'll want to refer to this other issue #2184. This issue is for ccls. Short answer though - clangd already has a setting for encoding, located here: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd. And https://www.reddit.com/r/neovim/comments/18cb9d8/comment/kc9lre2/?utm_source=share&utm_medium=web2x&context=3

Btw the reason I was getting this warning

warning: multiple different client offset_encodings detected for buffer, this is not supported yet

I think was because at the time I was using null-ls at the same time as ccls. The two plugins were specifying different encodings which led to the warning. However I later moved onto nvim-lint. Somewhat against my will, I still miss null-ls. Apparently there's also none-ls but I haven't looked into whether that plugin has the same encoding bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants