kosayoda / nvim-lightbulb

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

lightbulb gutter sign gets prioritized over errors sign #13

Closed mortezadadgar closed 3 years ago

mortezadadgar commented 3 years ago

I guess the title is self explanatory I tried changing sign priority both in lightbulb config and sing_define none of them worked

vim.fn.sign_define("LspDiagnosticsSignError", {text = "", priority = 11})
vim.fn.sign_define("LightBulbSign", {text = "", priority = 10})
    use {
        "kosayoda/nvim-lightbulb",
        module = "nvim-lightbulb",
        config = function()
            require('nvim-lightbulb').update_lightbulb {
                sign = {
                    enabled = false,
                    priority = 10,
                },
            }
        end
    }

image

kosayoda commented 3 years ago

vim.fn.sign_define("LspDiagnosticsSignError", {text = "", priority = 11}) vim.fn.sign_define("LightBulbSign", {text = "", priority = 10})

You don't set priority in either of these.

use {
        "kosayoda/nvim-lightbulb",
        <-- snip -->
}

I don't use packer, but looking at packer's documentation, I don't see how this configuration calls the update_lightbulb function on CursorHold.

If this config does show the lightbulb when you hover however, setting the priority (like you did) to a number lower than 10 should make the diagnostics sign take priority.

As reference, :h sign-priority describes that the sign with the highest priority is used.

mortezadadgar commented 3 years ago

yeah I see what's wrong now I had vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() change it to vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb{sign = {enabled = true, priority = 9}}]] fixed the problem I thought changing config with packer would globally apply config

kosayoda commented 3 years ago

Where you call the update_lightbulb is also where you pass in most configuration, this plugin does not have a setup function like some others (see #2).