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

fix(lsp): pass server resp through client handlers (1) #2770

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamestrew
Copy link
Contributor

For LSP methods/pickers:

  • references
  • definition
  • typeDefinition
  • implementation

Passes the server results through client (and neovim's) lsp handler function.
This lets those handlers deal with some of the language server specific idiosyncrasies.

Also refactors shared code between these pickers.

Other pickers/methods will need similar treatment.

For LSP methods/pickers:
- references
- definition
- typeDefinition
- implementation

Passes the server results through client (and neovim's) lsp handler
function.
This lets those handlers deal with some of the language server specific
idiosyncrasies.

Also refactors shared code between these pickers.

Other pickers/methods will need similar treatment.
@solson
Copy link

solson commented Nov 7, 2023

Thanks for the quick PR! When I re-try my reproduction steps from #2768, I run into this error:

Error executing vim.schedule lua callback: ...ker/start/telescope.nvim/lua/telescope/builtin/__lsp.lua:147: attempt to index local 'location' (a nil value)
stack traceback:
        ...ker/start/telescope.nvim/lua/telescope/builtin/__lsp.lua:147: in function 'handler'
        ...eovim-unwrapped-0.9.4/share/nvim/runtime/lua/vim/lsp.lua:1393: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Which suggests that local location = items[1].user_data was nil.

@jamestrew
Copy link
Contributor Author

Ah.. it's probably a neovim version issue.
It looks like I'm relying on some bleeding edge changes on nightly (neovim/neovim#25830)

I think we're planning to bump the minimum neovim version requirement to 0.10 for telescope v0.2.0 but there's no timeline for that. Either we come up with a different approach or can't merge this until then.

I'm not sure if I'm in love with my solution anyways. This relies on the custom handlers eventually calling neovim's builtin handler or supporting a on_list option like the builtin one does. And I don't think this is a requirement for lsp handlers.

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.

None yet

2 participants