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

Assert that the vim.lsp.config function exists before calling it #927

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

antoineco
Copy link
Contributor

@antoineco antoineco commented Jan 7, 2025

The plugin/blink-cmp.lua script added in af1febb currently doesn't check whether vim.lsp.config exists, which causes an error on startup if the Neovim nightly doesn't have this feature (ref. #897 (comment)). There is a broad range of development versions of Neovim 0.11 used in the wild, so solely checking for the nvim-0.11 feature isn't enough.

I considered two alternative implementations for this:

  1. Skip the vim.fn.has('nvim-0.11') check entirely since it is not technically required.
    -> I left it on purpose because it has the merit of adding explicitness to the script.
  2. Use pcall().
    -> Works equally well, but checking for the existence of the function is enough here.

@Saghen Saghen merged commit 47efef8 into Saghen:main Jan 7, 2025
2 checks passed
@Saghen
Copy link
Owner

Saghen commented Jan 7, 2025

Thanks!

@antoineco antoineco deleted the fix/vimlspconfig-check branch January 7, 2025 15:46
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.

2 participants