You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error 15:31:15 msg_show.lua_error Error executing vim.schedule lua callback: ...ls/neovim/0.10.2/share/nvim/runtime/lua/vim/lsp/util.lua:485: index out of range
stack traceback:
[C]: in function 'get_line_byte_from_position'
...ls/neovim/0.10.2/share/nvim/runtime/lua/vim/lsp/util.lua:485: in function 'apply_text_edits'
...l/share/nvim/lazy/copilot.lua/lua/copilot/suggestion.lua:489: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
下記調整を実施したとのこと
local current_line = vim.api.nvim_get_current_line()
local utf16_char = vim.str_utfindex(current_line, character)
range["end"].line = line
range.start.line = line
range["end"].character = utf16_char
概要
日本語を含むbufferを開いた際に、コードコメントを使用すると改行の入り方がおかしくなっている気がする。
Warning: multiple different client offset_encodings detected for buffer, this is not supported yet
がmessageとして発生することがあるが、上記の改行と相関があるのかは不明。vim-jpに投げた質問の要約
gopls, lua-ls (現状、自分が使用しているLSPのすべて) でコードコメントを挿入するとLSPサーバーと同期がずれている様子で、ありもしないdiagnosticを吐くようになってしまいました。:edit でbufferを開き直すと同期が修正されるのか、diagnosticは消えます。それぞれのLSPで微妙に挙動が違うので補足します。
nvim-lspはbufferの差分のみをLSPサーバーへ連携しているとどこかで見た記憶があるので、その辺りで悪さしているのではと仮説を立てるところまでで壁に突き当たってしまいました。何か解決方法や検証方法などご存知の方いらっしゃいましたらご教示いただけると幸いです
The text was updated successfully, but these errors were encountered: