-
-
Notifications
You must be signed in to change notification settings - Fork 639
docs(#3088): add nvim-tree.api* function and class meta, generate help documentation, lazy load api #3244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
docs(#3088): add nvim-tree.api* function and class meta, generate help documentation, lazy load api #3244
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find any related discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
fixes #3088
fixes #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