feat: Add option to blacklist symbols

Closes #38
This commit is contained in:
simrat39
2021-07-21 12:59:44 -07:00
parent 0868b5f463
commit 6a51c637dd
3 changed files with 65 additions and 82 deletions

View File

@@ -19,6 +19,7 @@ local defaults = {
code_actions = "a"
},
lsp_blacklist = {},
symbol_blacklist = {},
symbols = {
File = {icon = "", hl = "TSURI"},
Module = {icon = "", hl = "TSNamespace"},
@@ -77,6 +78,11 @@ local function has_value(tab, val)
return false
end
function M.is_symbol_blacklisted(kind)
if kind == nil then return false end
return has_value(M.options.symbol_blacklist, kind)
end
function M.is_client_blacklisted(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return has_value(M.options.lsp_blacklist, client.name)