SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
783 stars 30 forks source link

Suggestion: Specify supported Neovim version #99

Open rsynnest opened 3 months ago

rsynnest commented 3 months ago

Yo! Thank you for making this ❤️

I recently updated navbuddy, and it errored out my neovim due to this change: https://github.com/SmiteshP/nvim-navbuddy/commit/06525d02d93ed83ed2b5314115a63d991fdf0dc6

That update totally makes sense to target the latest Neovim API, but if users are on an old version it might be tricky to figure out why it's broken.

I had an idea that it might be useful to add a version check like the following:

if not (nvim_version.major == 0 and nvim_version.minor >= 10) then
  vim.api.nvim_err_writeln("WARNING: nvim-navbuddy requires Neovim v0.10.0 or higher.")
end

I think it's good to continue to run the plugin even if it's on an unsupported neovim, because it will still throw a loud message if it encounters an error.

This check may also be annoying since you would need to manually keep it up to date. But, at least it gives the user some extra information about why something might be failing, and what version the plugin is tested against. Feel free to use it or not, just an idea I'm toying with.

Thanks!

rsynnest commented 3 months ago

Maybe a better idea is to fallback to the old function if nvim version isn't new enough:

if vim.fn.has('nvim-0.10') == 0 then
    local all_clients = vim.lsp.get_clients()
else
    local all_clients = vim.lsp.get_active_clients()
end