-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Only warn about offset encoding differences once per buffer #16694
Conversation
Perhaps it would be better to check the It is also possible that I have something wrong in my configuration with the passed capabilities when initializing each server, so checking that first. Moving to a draft for now as this is not in a truly ready state at all; just a potentially wrong solution to a problem that might not even exist. |
I'd rather fix the offset encoding issues (really, the buf_request api issue) in the 0.7 cycle than add workarounds for a plugin in core. |
Absolutely. I had the same problem with clangd (when attached with other lsps). local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.offsetEncoding = { "utf-16" }
require('lspconfig').clangd.setup({capabilities = capabilities}) I go with utf-16 as it is the default for most... |
Yes forcing clangd to run in utf-16 is the best solution (for now). |
Makes sense. Is this a bad idea to belligerently set for everything? I imagine it requires coordination with what the server supports. |
Yes, also running as utf-8 avoids some costly utf handling conversions. Nothing you will notice, that is just the advantage (neovim is utf-8 native) |
FWIW, you could also use this flag |
Has this changed any lately I found myself having to do this in Lunarvim and it actually works poorly with another plugin I am trying to use. |
Not sure if this is the right way to go about doing this, but after the commit here every time I type in insert-mode with
clangd
(reports{ "utf-8", "utf-16" }
) andnull-ls
(reports"utf-16"
) attached attached to a buffer, I get this warning.Perhaps there is something deeper going on where I should be forcing a client to use a particular encoding? If that is the case, feel free to close this.
Otherwise, it seems sufficient to only warn about this once per buffer; it can be assaulting to have it every time this function is called (especially if using something like
nvim-notify
).