summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/core/info.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/core/info.lua')
-rw-r--r--.config/nvim/lua/core/info.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/.config/nvim/lua/core/info.lua b/.config/nvim/lua/core/info.lua
index d448492..646cf71 100644
--- a/.config/nvim/lua/core/info.lua
+++ b/.config/nvim/lua/core/info.lua
@@ -34,6 +34,23 @@ local function make_formatters_info(ft)
return section
end
+local function make_code_actions_info(ft)
+ local null_actions = require "lsp.null-ls.code_actions"
+ local registered_actions = null_actions.list_registered_providers(ft)
+ local supported_actions = null_actions.list_available(ft)
+ local section = {
+ "Code actions info",
+ fmt(
+ "* Active: %s%s",
+ table.concat(registered_actions, "  , "),
+ vim.tbl_count(registered_actions) > 0 and "  " or ""
+ ),
+ fmt("* Supported: %s", str_list(supported_actions)),
+ }
+
+ return section
+end
+
local function make_linters_info(ft)
local null_linters = require "lsp.null-ls.linters"
local supported_linters = null_linters.list_available(ft)
@@ -123,6 +140,8 @@ function M.toggle_popup(ft)
local linters_info = make_linters_info(ft)
+ local code_actions_info = make_code_actions_info(ft)
+
local content_provider = function(popup)
local content = {}
@@ -153,6 +172,7 @@ function M.toggle_popup(ft)
vim.cmd [[let m=matchadd("NvimInfoHeader", "Language Server Protocol (LSP) info")]]
vim.cmd [[let m=matchadd("NvimInfoHeader", "Formatters info")]]
vim.cmd [[let m=matchadd("NvimInfoHeader", "Linters info")]]
+ vim.cmd [[let m=matchadd("NvimInfoHeader", "Code actions info")]]
vim.cmd('let m=matchadd("NvimInfoIdentifier", " ' .. ft .. '$")')
vim.cmd 'let m=matchadd("string", "true")'
vim.cmd 'let m=matchadd("string", "active")'
@@ -168,6 +188,10 @@ function M.toggle_popup(ft)
require("lsp.null-ls.linters").list_available(ft),
"NvimInfoIdentifier"
)
+ tbl_set_highlight(
+ require("lsp.null-ls.code_actions").list_available(ft),
+ "NvimInfoIdentifier"
+ )
end
local Popup = require("interface.popup"):new {