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

Annotate locations_to_items() and friends with valid offset_encoding #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lyokha
Copy link

@lyokha lyokha commented Mar 8, 2025

In Neovim 0.10, lack of the offset encoding value leads to warnings like show_document must be called with valid offset encoding. This commit fixes such warnings. Note that the fix in actions.lua is rather insufficient as it involves a global variable that must be adjusted on every usage which is not the case right now: it gets adjusted only in M.close_edit().

lyokha added 2 commits March 8, 2025 21:24
In Neovim 0.10, lack of the offset encoding value leads to warnings like
"show_document must be called with valid offset encoding". This commit fixes
such warnings. Note that the fix in actions.lua is rather insufficient as it
involves a global variable that must be adjusted on every usage which is not
the case right now: it gets adjusted only in M.close_edit().
- In close_selected_handler(), get buffer and then the value of offset_encoding
  with vim.api.nvim_get_current_buffer() and vim.lsp.get_clients().
- In codeaction_selection_handler(), we can safely ignore this because setting
  vim.lsp.handlers['textDocument/codeAction'] doesn't affect anything in
  Neovim 0.10, see details in a FIXME comment in the commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant