ojroques / nvim-lspfuzzy

A Neovim plugin to make the LSP client use FZF
BSD 2-Clause "Simplified" License
316 stars 11 forks source link

Update to use new lsp handler signatures #21

Closed 110y closed 3 years ago

110y commented 3 years ago

Recently, master branch of NeoVim takes a breaking change regarding LSP handler signatures: https://github.com/neovim/neovim/pull/15504

This PR deals with the breaking change while preserving the behavior for the latest stable version of NeoVim (0.5.0).

NOTE:

Although this PR fixes the problem for the majority of people, people who use the NeoVim whose version is greater than 0.5.0 but less than https://github.com/neovim/neovim/pull/15504 still faces the problem, since such version of NeoVim returns 1 for vim.fn.has("nvim-0.5.1") but still use old handler signatures.

Technically, we can make this plugin work fine for all three cases like below at the same time by making the handlers check the type of arguments (string / table):

But, since doing so will make the codebase a bit dirty, I think just checking the version of NeoVim whether it has nvim-0.5.1 as this PR does is better.

ojroques commented 3 years ago

Hello! First thank you for your contribution. Maybe you didn't notice but I've already pushed a fix in the dev branch that address this issue for those on Neovim nightly/master. I'll try to merge that branch to master today that would work for both 0.5 and nightly/master.

ojroques commented 3 years ago

I've merged dev to main in #22. Please tell me if this breaks anything. Thanks again for your contribution.

110y commented 3 years ago

@ojroques

Thanks, it's working fine for me!