feat(docs): generate builtin.txt (#24493)

- eval.lua is now the source of truth.

- Formatting is much more consistent.

- Fixed Lua type generation for polymorphic functions (get(), etc).

- Removed "Overview" section from builtin.txt
  - Can generate this if we really want it.

- Moved functions from sign.txt and testing.txt into builtin.txt.

- Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred.

- Removed the temp-file-name tag from tempname()

- Moved lueval() from lua.txt to builtin.txt.

* Fix indent

* fixup!

* fixup! fixup!

* fixup! better tag formatting

* fixup: revert changes no longer needed

* fixup! CI

---------

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
Lewis Russell
2023-07-28 14:48:41 +01:00
committed by GitHub
parent c1c2a1b5dd
commit 42333ea98d
14 changed files with 15221 additions and 2466 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@ local funcsfname = autodir .. '/funcs.generated.h'
local hashy = require'generators.hashy'
local hashpipe = io.open(funcsfname, 'wb')
local hashpipe = assert(io.open(funcsfname, 'wb'))
hashpipe:write([[
#include "nvim/arglist.h"
@@ -62,16 +62,22 @@ for _,fun in ipairs(metadata) do
end
end
local func_names = vim.tbl_keys(funcs)
local func_names = vim.tbl_filter(function(name)
return name:match('__%d*$') == nil
end, vim.tbl_keys(funcs))
table.sort(func_names)
local funcsdata = io.open(funcs_file, 'w')
local funcsdata = assert(io.open(funcs_file, 'w'))
funcsdata:write(mpack.encode(func_names))
funcsdata:close()
local neworder, hashfun = hashy.hashy_hash("find_internal_func", func_names, function (idx)
return "functions["..idx.."].name"
end)
hashpipe:write("static const EvalFuncDef functions[] = {\n")
for _, name in ipairs(neworder) do
local def = funcs[name]
local args = def.args or 0