gbrlsnchs / telescope-lsp-handlers.nvim

MIT License
85 stars 9 forks source link

nvim 0.7 update required; jump_to_location must be called with valid offset encoding #6

Closed ulchie closed 1 year ago

ulchie commented 2 years ago

nvim 0.7 appears to have added a required parameter to vim.lsp.jump_to_location:

*vim.lsp.util.jump_to_location()*
jump_to_location({location}, {offset_encoding})
                Jumps to a location.

                Parameters: 
                    {location}         table (`Location`|`LocationLink`)
                    {offset_encoding}  [string](https://neovim.io/doc/user/eval.html#string) utf-8|utf-16|utf-32 (required)

                Return: 
                    `true` if the jump succeeded

A warning is issued when this is invoked in lsp_handlers.lua (https://github.com/gbrlsnchs/telescope-lsp-handlers.nvim/blob/d6d5983b0131ee2c386ca9e349f6621e12d971cb/lua/telescope/_extensions/lsp_handlers.lua)

ulchie commented 2 years ago

Sorry, think I misdiagnosed this one. My apologies.

Slotos commented 2 years ago

You did not misdiagnose this one. Removal of telescope-lsp-handlers.nvim resolves this warning.

gbrlsnchs commented 2 years ago

If anyone has a fix for this one I'll willingly merge it. 😃

Slotos commented 2 years ago

If anyone has a fix for this one I'll willingly merge it. 😃

I plan to try, but can't make no ETA promises.

brettmitchelldev commented 2 years ago

:h fileencoding

Here's a hidden option containing the encoding of the current file. lualine is using vim.opt.fileencoding:get() to show the encoding of the current file. I'm pretty new to this though, so maybe that's not the right way of solving the problem (I think hidden opts aren't guaranteed on all systems? I don't see why this one wouldn't be safe though). Anyways, I ran into this today and thought I'd at least suggest a path forward.

Lualine's usage for reference : https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/components/encoding.lua#L4

Slotos commented 1 year ago

It's not a file encoding that's necessarily required, but an LSP client one. Check neovim stock references handler for example - https://github.com/neovim/neovim/blob/63be7651829f8b77c4974d08ebe09f7775e41a8a/runtime/lua/vim/lsp/handlers.lua#L186

geodimm commented 1 year ago

If anyone has a fix for this one I'll willingly merge it. 😃

I've opened #9 to address this issue :)

gbrlsnchs commented 1 year ago

9 is merged, closing this for now. Please reopen if the issue still persist.