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

'character_offset must be called with valid offset encoding' #4

Open
luozhiya opened this issue May 6, 2023 · 0 comments
Open

'character_offset must be called with valid offset encoding' #4

luozhiya opened this issue May 6, 2023 · 0 comments

Comments

@luozhiya
Copy link

luozhiya commented May 6, 2023

Hi,

offset encoding cannot be nil.

local last_character = vim.lsp.util.character_offset(0, result.range['end'].line, last_col)

Neovim
https://github.com/neovim/neovim/blob/a72e795eda22c5f13e3f8b3c90a12b2ee85fc6bb/runtime/lua/vim/lsp/util.lua#L2122

function M.character_offset(buf, row, col, offset_encoding)
  local line = get_line(buf, row)
  if offset_encoding == nil then
    vim.notify_once(
      'character_offset must be called with valid offset encoding',
      vim.log.levels.WARN
    )
  end
 --...
end
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

No branches or pull requests

1 participant