mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 18:06:30 +00:00
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:
13884
src/nvim/eval.lua
13884
src/nvim/eval.lua
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
Reference in New Issue
Block a user