Skip to content

Annotate locations_to_items() and friends with valid offset_encoding#56

Open
lyokha wants to merge 2 commits into
RishabhRD:masterfrom
lyokha:valid-offset-encoding
Open

Annotate locations_to_items() and friends with valid offset_encoding#56
lyokha wants to merge 2 commits into
RishabhRD:masterfrom
lyokha:valid-offset-encoding

Conversation

@lyokha
Copy link
Copy Markdown

@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