kosayoda / nvim-lightbulb

VSCode 💡 for neovim's built-in LSP.
MIT License
801 stars 30 forks source link

feat: add quickfix_only option #47

Closed utkarshgupta137 closed 1 year ago

kosayoda commented 1 year ago

Hello! Thank you for the PR and sorry it took so long to get back. The idea is wonderful, but I've modified it to allow specifying any LSP CodeActionKind.

In the latest release, you can now set action_kinds = { "quickfix" } to only show the lightbulb if there is a quickfix code action.

Thanks again!

utkarshgupta137 commented 1 year ago

This option isn't working for me

kosayoda commented 1 year ago

Hi. On the latest master I added a function to help debug lightbulb issues: https://github.com/kosayoda/nvim-lightbulb/issues/51#issuecomment-1629844759.

If the lightbulb is showing at a location when it shouldn't, please run the lightbulb's debug function and see what the types of code actions they are:

image.

You can also pass in a different configuration to the debug function to see whether or not the options apply, in my example if I call the function like this: :lua NvimLightbulb.debug({ action_kinds = { "quickfix" } }), I get this:

image

If you're still having trouble, please open a new issue with more details.

EDIT: Make sure you've updated the plugin!

utkarshgupta137 commented 1 year ago
Error executing vim.schedule lua callback: ...are/nvim/lazy/nvim-lightbulb/lua/nvim-lightbulb/init.lua:405: attempt to concatenate field 'kind' (a nil value)
stack traceback:
    ...are/nvim/lazy/nvim-lightbulb/lua/nvim-lightbulb/init.lua:405: in function 'callback'
    ...eovim-unwrapped-0.9.1/share/nvim/runtime/lua/vim/lsp.lua:2021: in function 'handler'
    ...eovim-unwrapped-0.9.1/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

I'm getting this in Cargo.toml with crates.nvim plugin. I would personally prefer if the kind is unknown, then the lightbulb still be hidden, because right now, it is showing on every line.