SmiteshP / nvim-navbuddy

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

Query: Any way for navbuddy to ignore some lsp clients ? #47

Closed edr3x closed 1 year ago

edr3x commented 1 year ago

as the question says is there any way for navbuddy to ignore some lsp clients line tailwindcss-ls or null-ls as i got this error: 2023-04-14_10:10:36

was able to solve this by doing this:


M.on_attach = function(client, bufnr)
    if client.name ~= "tailwindcss" or client.name ~= "null-ls" then
        require("nvim-navbuddy").attach(client, bufnr)
    end
end

what i am curious is that is there other better way ?

edr3x commented 1 year ago

asking this couz sometimes this works sometimes it doesn't.

aaronkollasch commented 1 year ago

Instead of filtering by client name, you could filter by the server's capabilities directly:

if client.server_capabilities.documentSymbolProvider then
    require("nvim-navbuddy").attach(client, bufnr)
end

You can also try using the built-in auto-attach functionality by setting auto_attach = true in the config.

edr3x commented 1 year ago

Ohh can do that, Thank you!