Open kosayoda opened 1 year ago
I've fixed the concatenation bug in https://github.com/kosayoda/nvim-lightbulb/commit/8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9.
In that commit I've also added a new config option: ignore.actions_without_kind
that would allow ignoring code actions that do not have or have an empty string for the kind
.
@utkarshgupta137 I tested the option with null-ls
and crates.nvim
and it seems to work as expected. Let me know here if it does for you too. Alternatively, you can blanket turn off the lightbulb for null-ls
by adding it to ignore.clients
.
Working for crates.nvim. But I noticed that it isn't working for marksman:
11:27:23 msg_show.echomsg NvimLightbulb.debug({ action_kinds = { "quickfix" } }) [Configuration]
{
sign = { hl = 'LightBulbSign', text = '💡', enabled = true },
line = { hl = 'LightBulbLine', enabled = false },
float = {
hl = 'LightBulbFloatWin',
text = '💡',
win_opts = { focusable = false },
enabled = false
},
ignore_id = {},
priority = 100,
autocmd = {
enabled = true,
events = { 'CursorHold', 'CursorHoldI' },
pattern = { '*' },
updatetime = 200
},
status_text = { text = '💡', text_unavailable = '', enabled = false },
ignore = { clients = {}, actions_without_kind = true, ft = {} },
number = { hl = 'LightBulbNumber', enabled = false },
link_highlights = true,
hide_in_unfocused_buffer = true,
action_kinds = { 'quickfix' },
validate_config = 'auto',
virtual_text = {
enabled = false,
hl = 'LightBulbVirtualText',
hl_mode = 'combine',
text = '💡',
pos = 'eol'
}
}
[Code Actions]
i No code action support: null-ls, copilot
i With code action support: marksman
marksman
1. Create a Table of Contents source
Any ideas? Or do I just need to disable the client?
So marksman
actually provides a kind
for their code actions, in the Create a Table of Contents
situation it's source
. For now I recommend ignoring the marksman
client.
The way action_kinds
work currently is by sending the whitelist to the server during the code action request:
Unfortunately as you can see it's
So servers can omit computing them
and not
So servers must omit computing them
The docs also say that "...are filtered out by the client" before being shown so technically that's on me, but I don't want to have to examine every code action and match the kind against every kind in the whitelist. If we were to want to filter out eg based on name too then there would be an explosion in cases to handle.
So, I am thinking of allowing the user to provide custom lua function with a specific signature that will allow the user to receive the action information and return whether or not to ignore it. What do you think?
Thanks for being patient!
Disabling marksman
works for me. Thanks for your support!
I'm getting this in
Cargo.toml
withcrates.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.Originally posted by @utkarshgupta137 in https://github.com/kosayoda/nvim-lightbulb/issues/47#issuecomment-1644504678