-
Notifications
You must be signed in to change notification settings - Fork 43
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
Neovim badly interacts with server when position_encoding
is set to "utf-8"
#766
Comments
my lsp settings for tinymist is mentioned in #761. |
I'm also experiencing this with polish characters. My lsp settings: lspconfig.tinymist.setup {
on_attach = on_attach,
capabilities = capabilities,
offset_encoding = "utf-8",
settings = {
semantic_tokens = "disable",
}
} |
Got a similar error when using cyrrillic letters in Neovim. The error can be reproduced like this:
When looking through the logs, I see this:
Which probably means there is something wrong with incremental document changes. If I type
(I formatted the LSP log a little bit, because it joined multiple server logs into LSP client log) My current LSP config: lspconfig.tinymist.setup {
capabilities = capabilities,
offset_encoding = "utf-8",
setup = {
cmd = { 'tinymist' }
},
settings = {
semantic_tokens = "disable",
}
} I tried setting Removing So, my guess is what those Chinese characters take two utf16 codepoints, and the deal with them is the same with Cyrillic/Polish characters, which take two utf8 codepoints. Maybe try setting But in that case out-of-range array access errors from vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
client.server_capabilities.semanticTokensProvider = nil
end,
});
|
A temporary solution might be to upgrade or downgrade your Neovim, I personally think supporting only utf-16 from Tinymist is better. |
@Eric-Song-Nop I don't think upgrading will help much, as my neovim version is the latest. |
The requirement for utf-8 offset_encoding should be fixed in neovim/neovim#30747 , after that pr I hope that not using utf-8 offset_encoding should be enough. |
@Eric-Song-Nop Nope, removing "offset_encoding" causes the issue #761. |
position_encoding
is set to "utf-8"
position_encoding
is set to "utf-8"position_encoding
is set to "utf-8"
I wouldn't like to make an assertion but there should be some bug(s) on neovim and a way without having to change tinymist to make semantic highlighting perfect on neovim, because we haven't received any confused semantic highlighted errors on VS Code for months. I also add another recent finding about it, hinting there might be inconsistent uses of position encoding on some distros of neovim, which causes desync state between LSP server (tinymist) and clients (neovim). This happens even if tinymist and neovim have negotiated a position encoding: folke/trouble.nvim#606 More information is needed as I'm not a proficient neovim user. |
Describe the bug
When typing Chinese in neovim, syntax highlighting is off, and unclosed delimiter errors are everywhere
Package/Software version:
tinymist version:
v0.12.0
, installed throughmason.nvim
neovim version:
The text was updated successfully, but these errors were encountered: