-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Fetch results from multiple LSPs #3211
Fetch results from multiple LSPs #3211
Conversation
Is there a reason to have a new function called |
Co-authored-by: James Trew <[email protected]>
No, I guess I didn't realize it wasn't used anymore, renaming it to leave only |
91afe3c
to
45929d9
Compare
45929d9
to
dff296d
Compare
@jamestrew any chance you can run the CI workflows? I think there's nothing left for me to do |
@jamestrew done |
thanks! |
Description
Please include a summary of the change and which issue is fixed. Please also
include relevant motivation and context
Fixes #2342
Right now, when you have two LSPs connected to one buffer and you want to, let's say, go to a definition, there's a race condition / non-deterministic behavior in which Telescope uses the answer of the first LSP that responds
As an example (and the actual reason for me submitting this change), if you have a ruby application that uses sorbet, and you're running the Sorbet LSP and RubyLSP for the same buffer (which is pretty useful), what you'll see for
telescope.builtin.lsp_definitions
will be:The first two times, it used the locations from RubyLSP, and the third one from Sorbet
With this change applied, this is what happens:
You've got all the results from both LSPs consistently
This leaves us with the issue of what happens if both LSPs returning overlapping locations, so deduplication could be in order
But since this isn't my case and I suspect not a lot of people use multiple LSPs that return the same stuff, I prefer to get your feedback first and maybe implement it later
Also, we should probably remove the
list_or_jump
implementation since this makes it obsolete I think, but again, I prefer to get feedback firstApologies if the code is not up to standard, I'm a complete Lua illiterate
Type of change
How Has This Been Tested?
Manually, as my knowledge of lua is very limited and mostly learned by tinkering with neovim plugins and config
Configuration:
Checklist: