|
@@ -35,6 +35,23 @@ local function make_formatters_info(ft)
|
|
return section
|
|
return section
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+local function make_code_actions_info(ft)
|
|
|
|
+ local null_actions = require "lvim.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 function make_linters_info(ft)
|
|
local null_linters = require "lvim.lsp.null-ls.linters"
|
|
local null_linters = require "lvim.lsp.null-ls.linters"
|
|
local supported_linters = null_linters.list_available(ft)
|
|
local supported_linters = null_linters.list_available(ft)
|
|
@@ -121,6 +138,8 @@ function M.toggle_popup(ft)
|
|
|
|
|
|
local linters_info = make_linters_info(ft)
|
|
local linters_info = make_linters_info(ft)
|
|
|
|
|
|
|
|
+ local code_actions_info = make_code_actions_info(ft)
|
|
|
|
+
|
|
local content_provider = function(popup)
|
|
local content_provider = function(popup)
|
|
local content = {}
|
|
local content = {}
|
|
|
|
|
|
@@ -137,6 +156,8 @@ function M.toggle_popup(ft)
|
|
formatters_info,
|
|
formatters_info,
|
|
{ "" },
|
|
{ "" },
|
|
linters_info,
|
|
linters_info,
|
|
|
|
+ { "" },
|
|
|
|
+ code_actions_info,
|
|
} do
|
|
} do
|
|
vim.list_extend(content, section)
|
|
vim.list_extend(content, section)
|
|
end
|
|
end
|
|
@@ -151,6 +172,7 @@ function M.toggle_popup(ft)
|
|
vim.cmd [[let m=matchadd("LvimInfoHeader", "Language Server Protocol (LSP) info")]]
|
|
vim.cmd [[let m=matchadd("LvimInfoHeader", "Language Server Protocol (LSP) info")]]
|
|
vim.cmd [[let m=matchadd("LvimInfoHeader", "Formatters info")]]
|
|
vim.cmd [[let m=matchadd("LvimInfoHeader", "Formatters info")]]
|
|
vim.cmd [[let m=matchadd("LvimInfoHeader", "Linters info")]]
|
|
vim.cmd [[let m=matchadd("LvimInfoHeader", "Linters info")]]
|
|
|
|
+ vim.cmd [[let m=matchadd("LvimInfoHeader", "Code actions info")]]
|
|
vim.cmd('let m=matchadd("LvimInfoIdentifier", " ' .. ft .. '$")')
|
|
vim.cmd('let m=matchadd("LvimInfoIdentifier", " ' .. ft .. '$")')
|
|
vim.cmd 'let m=matchadd("string", "true")'
|
|
vim.cmd 'let m=matchadd("string", "true")'
|
|
vim.cmd 'let m=matchadd("string", "active")'
|
|
vim.cmd 'let m=matchadd("string", "active")'
|
|
@@ -160,6 +182,7 @@ function M.toggle_popup(ft)
|
|
-- tbl_set_highlight(registered_providers, "LvimInfoIdentifier")
|
|
-- tbl_set_highlight(registered_providers, "LvimInfoIdentifier")
|
|
tbl_set_highlight(require("lvim.lsp.null-ls.formatters").list_available(ft), "LvimInfoIdentifier")
|
|
tbl_set_highlight(require("lvim.lsp.null-ls.formatters").list_available(ft), "LvimInfoIdentifier")
|
|
tbl_set_highlight(require("lvim.lsp.null-ls.linters").list_available(ft), "LvimInfoIdentifier")
|
|
tbl_set_highlight(require("lvim.lsp.null-ls.linters").list_available(ft), "LvimInfoIdentifier")
|
|
|
|
+ tbl_set_highlight(require("lvim.lsp.null-ls.code_actions").list_available(ft), "LvimInfoIdentifier")
|
|
end
|
|
end
|
|
|
|
|
|
local Popup = require("lvim.interface.popup"):new {
|
|
local Popup = require("lvim.interface.popup"):new {
|