mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-19 02:04:32 +02:00
ci: rename update-scripts
→ ci
This changes how we think about this directory; it does not need to be exclusively for scripts related to updates, but should be a place for any scripts intended to be run by CI workflows. This mindset should make it easier to develop and test the business logic of workflows, without always needing to test "in production" on the nixvim repo or a fork.
This commit is contained in:
parent
7388c85c54
commit
2b2b1e6d8f
18 changed files with 13 additions and 12 deletions
|
@ -1,52 +0,0 @@
|
|||
-- This script is heavily inspired by https://github.com/neovim/nvim-lspconfig/blob/master/scripts/docgen.lua
|
||||
require("lspconfig")
|
||||
local configs = require("lspconfig.configs")
|
||||
local util = require("lspconfig.util")
|
||||
|
||||
local function require_all_configs()
|
||||
for _, v in ipairs(vim.fn.glob(vim.env.lspconfig .. "/lua/lspconfig/configs/*.lua", 1, 1)) do
|
||||
local module_name = v:gsub(".*/", ""):gsub("%.lua$", "")
|
||||
configs[module_name] = require("lspconfig.configs." .. module_name)
|
||||
end
|
||||
end
|
||||
|
||||
local function map_list(t, func)
|
||||
local res = {}
|
||||
for i, v in ipairs(t) do
|
||||
local x = func(v, i)
|
||||
if x ~= nil then
|
||||
table.insert(res, x)
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
local function sorted_map_table(t, func)
|
||||
local keys = vim.tbl_keys(t)
|
||||
table.sort(keys)
|
||||
return map_list(keys, function(k)
|
||||
return func(k, t[k])
|
||||
end)
|
||||
end
|
||||
|
||||
require_all_configs()
|
||||
|
||||
info = sorted_map_table(configs, function(server_name, server_info)
|
||||
local description = nil
|
||||
if server_info.document_config.docs ~= nil then
|
||||
description = server_info.document_config.docs.description
|
||||
end
|
||||
local cmd = server_info.document_config.default_config.cmd
|
||||
if type(cmd) == "function" then
|
||||
cmd = "see source file"
|
||||
end
|
||||
return {
|
||||
name = server_name,
|
||||
cmd = cmd,
|
||||
desc = description,
|
||||
}
|
||||
end)
|
||||
|
||||
local writer = io.open("lsp.json", "w")
|
||||
writer:write(vim.json.encode(info))
|
||||
writer:close()
|
Loading…
Add table
Add a link
Reference in a new issue