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

feat(lsp): added support for dynamic capabilities #2594

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

folke
Copy link
Contributor

@folke folke commented Jul 5, 2023

Description

Added support for dynamic registration of capabilities to all the lsp pickers.
I also refactored the relevant code a bit to make it less verbose.

Any code that wants to check lsp capabilities should use client.supports_method.
That function includes checks for dynamically registered capabilities.
Just checking server_capabilities only includes caps that were advertised during init.

Fixes LazyVim/LazyVim#990

Fixes goto definition for a number of lsp servers like jdtls and solargraph

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I've testes all the methods using several LSP servers including the one solargraph where go to definition was broken.

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@folke
Copy link
Contributor Author

folke commented Jul 5, 2023

The failing tests are not because of this change, but because homebrew can not be updated

@tjdevries tjdevries merged commit 276362a into nvim-telescope:master Jul 6, 2023
6 checks passed
@tjdevries
Copy link
Member

Thanks, makes sense to me. Some of that LSP code is quite old (not all the methods existed at the time). Thanks :)

@ben-krieger
Copy link

Is there a reason that this commit hasn't been cherry-picked into a release (of which there have been a few since the PR was merged)? The README discourages using master, but as a user of jdtls, I need this fix for jumping to definition to work.

@jamestrew
Copy link
Contributor

@ben-krieger we aren't cherry picking features into 0.1.x following semver. This will come in 0.2.0 but no timeline for this.
Best bet is using the master branch pinned to this 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.

4 participants