diff options
| author | glepnir <glephunter@gmail.com> | 2024-05-17 14:06:45 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-17 14:06:45 +0800 |
| commit | 45015c6d1fc436e377ac6d349840eb09d3775f47 (patch) | |
| tree | f71aeae2c5ae5045450eeea221d66ec617054ee8 /scripts | |
| parent | refactor: remove usages of deprecated vim.tbl_add_reverse_lookup (#3156) (diff) | |
| download | nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.tar nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.tar.gz nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.tar.bz2 nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.tar.lz nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.tar.xz nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.tar.zst nvim-lspconfig-45015c6d1fc436e377ac6d349840eb09d3775f47.zip | |
refactor: add compatible tbl_flatten and lsp_get_clients for new version 0.10 (#3154)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/docgen.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/docgen.lua b/scripts/docgen.lua index 9f6c1bc1..f8ddcdb9 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -4,7 +4,6 @@ local util = require 'lspconfig.util' local inspect = vim.inspect local uv = vim.loop local fn = vim.fn -local tbl_flatten = vim.tbl_flatten local function template(s, params) return (s:gsub('{{([^{}]+)}}', params)) @@ -40,12 +39,15 @@ local function indent(n, s) end local function make_parts(fns) - return tbl_flatten(map_list(fns, function(v) - if type(v) == 'function' then - v = v() - end - return { v } - end)) + return vim + .iter(fns) + :map(function(v) + if type(v) == 'function' then + v = v() + end + return { v } + end) + :totable() end local function make_section(indentlvl, sep, parts) @@ -215,7 +217,7 @@ local function make_lsp_sections() return tick('enum ' .. inspect(v.enum)) end if v.type then - return tick(table.concat(tbl_flatten { v.type }, '|')) + return tick(table.concat(util.tbl_flatten { v.type }, '|')) end end, }), |
