docs(#3088): add nvim-tree.api* function and class meta, generate help documentation, lazy load api#3244
docs(#3088): add nvim-tree.api* function and class meta, generate help documentation, lazy load api#3244alex-courtis wants to merge 179 commits intomasterfrom
Conversation
…tors to main help
…at and order nvim_tree.Config
…ries populate others placeholder
…_decorator.lua changes, retain api opts classes but make them exact
| -- | ||
| -- Already required elsewhere | ||
| -- | ||
| api.commands.get = commands.get |
There was a problem hiding this comment.
@przepompownia : this was not available until after setup. I have changed it to before.
Is there any reason we didn't make it available before?
There was a problem hiding this comment.
I could not find any related discussion.
There was a problem hiding this comment.
Thanks @przepompownia , really appreciate the detailed AB testing.
emptyapiapi + setuponly setupinit.lua (appname: master or pr3244, require calls possibly uncommented)local thisInitFile = debug.getinfo(1, 'S').source:sub(2)
local cwd = vim.fs.dirname(thisInitFile)
local appname = vim.env.NVIM_APPNAME or 'pr3244'
vim.env.XDG_CONFIG_HOME = cwd
vim.env.XDG_DATA_HOME = vim.fs.joinpath(cwd, '.xdg', 'data')
vim.env.XDG_STATE_HOME = vim.fs.joinpath(cwd, '.xdg', 'state')
vim.env.XDG_CACHE_HOME = vim.fs.joinpath(cwd, '.xdg', 'cache')
vim.fn.mkdir(vim.fs.joinpath(vim.env.XDG_CACHE_HOME, appname), 'p')
local stdPathConfig = vim.fn.stdpath('config')
vim.opt.runtimepath:prepend(stdPathConfig)
vim.opt.packpath:prepend(stdPathConfig)
local extuiExists, extui = pcall(require, 'vim._extui')
if extuiExists then
extui.enable({enable = true, msg = {target = 'msg'}})
end
local function gitClone(url, installPath, branch)
if vim.fn.isdirectory(installPath) ~= 0 then
return
end
local command = {'git', 'clone', '--', url, installPath}
if branch then
table.insert(command, 3, '--branch')
table.insert(command, 4, branch)
end
vim.notify(('Cloning %s dependency into %s...'):format(url, installPath), vim.log.levels.INFO, {})
local sysObj = vim.system(command, {}):wait()
if sysObj.code ~= 0 then
error(sysObj.stderr)
end
vim.notify(sysObj.stdout)
vim.notify(sysObj.stderr, vim.log.levels.WARN)
end
local pluginsPath = vim.fs.joinpath(cwd, appname, 'pack/plugins/opt')
vim.fn.mkdir(pluginsPath, 'p')
pluginsPath = assert(vim.uv.fs_realpath(pluginsPath))
--- @type table<string, {url:string, branch: string?}>
local plugins = {
['nvim-tree'] = {url = 'https://github.com/nvim-tree/nvim-tree.lua', branch = '3088-gen_vimdoc-api-3231-remove-api-requires'},
}
for name, repo in pairs(plugins) do
local installPath = vim.fs.joinpath(pluginsPath, name)
gitClone(repo.url, installPath, repo.branch)
vim.opt.runtimepath:append(installPath)
-- vim.cmd.packadd({args = {name}, bang = true})
end
local function init()
-- require('nvim-tree.api')
-- require('nvim-tree').setup({})
end
vim.api.nvim_create_autocmd('UIEnter', {
once = true,
callback = init,
})
|
… to prevent runaway FS updates
… to prevent runaway FS updates
…nnecessary build and possible Nvim lint failures
Nvim's |
Many thanks for testing this one out @przepompownia I made a couple of bad assumptions. Grateful if you could review a fix: #3260 |
@alex-courtis I cannot find enough time to make detailed reviews, but at least can try some tests, including real usage. |
Test is great, thank you. |
…n uses nvim source build to execute (#3260) * docs(#3241): unify help generation and lint into vimdoc.sh, generation uses nvim source build to execute * docs(#3241): unify help generation and lint into vimdoc.sh, generation uses nvim source build to execute * docs(#3241): unify help generation and lint into vimdoc.sh, generation uses nvim source build to execute * docs(#3241): unify help generation and lint into vimdoc.sh, generation uses nvim source build to execute
fixes #3088
partially addresses #2668
addresses #3231 step 2
follows #3235
Goals
api.luaScope
lua/nvim-tree/_meta/api/andlua/nvim-tree/_meta/api.luafor namespacedrequire("nvim-tree.api")require("nvim-tree.api")callapi.impl.pre(fast)wrap) ORapi.events.subscribeapi.impl.post(slow) to completes all remaining implementationsapi.impl.legacycalled after pre and post*nvim-tree-commands*help#3231 step 2 was added to scope as the api hydration was changed anyway and needed to be tested.
Review Please
I can't ask anyone to review the whole thing, with help and api not diffable, however I'd be most grateful for a review of
I'd also be really grateful for a test of:
make help-check@stefgodin I'd be really grateful for a review of the Node and Git class documentation in the
*nvim-tree-api*section of nvim-tree-lua.txt@przepompownia and @perrin4869 I'd really appreciate a test of startup performance before and after api and setup
Startup timing:
Nothing required:
api
setup
log
Manual Testing
:source