docs(lua): more improvements (#24387)

* docs(lua): teach lua2dox how to table

* docs(lua): teach gen_vimdoc.py about local functions

No more need to mark local functions with @private

* docs(lua): mention @nodoc and @meta in dev-lua-doc

* fixup!

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>

---------

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
Lewis Russell
2023-07-18 15:42:30 +01:00
committed by GitHub
parent d0ae529861
commit be74807eef
39 changed files with 322 additions and 511 deletions

View File

@@ -21,7 +21,10 @@ local M = {}
---@alias LoaderStats table<string, {total:number, time:number, [string]:number?}?>
---@nodoc
M.path = vim.fn.stdpath('cache') .. '/luac'
---@nodoc
M.enabled = false
---@class Loader
@@ -58,7 +61,6 @@ function Loader.get_hash(path)
return Loader._hashes[path]
end
---@private
local function normalize(path)
return vim.fs.normalize(path, { expand_env = false })
end
@@ -122,7 +124,6 @@ end
--- @param path string
--- @param mode integer
--- @return string? data
--- @private
local function readfile(path, mode)
local f = uv.fs_open(path, 'r', mode)
if f then
@@ -310,7 +311,6 @@ function M.find(modname, opts)
local results = {}
-- Only continue if we haven't found anything yet or we want to find all
---@private
local function continue()
return #results == 0 or opts.all
end
@@ -318,7 +318,6 @@ function M.find(modname, opts)
-- Checks if the given paths contain the top-level module.
-- If so, it tries to find the module path for the given module name.
---@param paths string[]
---@private
local function _find(paths)
for _, path in ipairs(paths) do
if topmod == '*' then
@@ -504,7 +503,6 @@ end
---@private
function M._inspect(opts)
if opts and opts.print then
---@private
local function ms(nsec)
return math.floor(nsec / 1e6 * 1000 + 0.5) / 1000 .. 'ms'
end