kosayoda / nvim-lightbulb

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

always show lightbulb when lsp is active #25

Closed RaZ0rr-Two closed 2 years ago

RaZ0rr-Two commented 2 years ago

Could you help me with settings up options/autocommand to show light bulb whenever code actions are available and not just on CursorHold ? nvim_lightbulb1 Not showing bulb when cursor somewhere else nvim_lightbulb2 Shows when cursor is there

kosayoda commented 2 years ago

I'm not sure what you mean here, the lightbulb shows up whenever there is a code action to perform at your cursor location, ie. if you see the lightbulb you'll get code actions to perform when you run vim.lsp.buf.code_action().

RaZ0rr-Two commented 2 years ago

Sorry for lack of clarification. What I meant is that I would like to show the lightbulb shows up whenever there is a code action to perform. Not depending where the cursor is

kosayoda commented 2 years ago

I see. This is probably a duplicate (or at least similar to) #10. My response to that is this:

Hi, I doubt that is possible, since code actions are position dependant on the LSP server side, and the server will not return a code action for let's say, swapping function parameters if I ask for a code action for the entire line.

A workaround would be to ask the server for possible code actions for every single column on the line, but I feel that it would be very resource intensive and not worthwhile.

Let me know if I misunderstood.

RaZ0rr-Two commented 2 years ago

I understood. If it makes the plugin more resource-intensive, I rather not have it