diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2026-09-30 14:41:16 +0100 |
|---|---|---|
| committer | Lewis Russell <me@lewisr.dev> | 2026-09-30 17:56:01 +0100 |
| commit | 364b7a3402634251a766c4a3a81117c296839e12 (patch) | |
| tree | ecab60376dd1f008b2594ffe3f03ee4bc8fde865 /runtime/lua/vim/pack.lua | |
| parent | 9f7fb8b27dc03daf21ff4524b982e1d6e982ca5e (diff) | |
| download | rneovim-364b7a3402634251a766c4a3a81117c296839e12.tar.gz rneovim-364b7a3402634251a766c4a3a81117c296839e12.tar.bz2 rneovim-364b7a3402634251a766c4a3a81117c296839e12.zip | |
ci(lua): enable annotation and style checks
Problem:
- annotation-usage-error and code-style-check are disabled.
- vim.inspect relies on a dummy self-assignment for docgen, and its help
omits parameter and option details.
- LuaLS fallback types obscure iterator inference.
- Docgen hardcodes public function names and appends separately sorted
files, leaving shared helpers under the inspector heading.
Solution:
- Enable annotation-usage-error and code-style-check, and fix misplaced
annotations.
- Document vim.inspect's callable module directly, removing the dummy
assignment. Describe its parameters, option defaults and process
callback.
- Remove LuaLS iterator fallbacks, correct iterator signatures and check
values that the improved inference identifies as optional.
- Parse callable modules, require bindings and parent module references.
Derive public names and inherited function docs from these links,
including missing help for vim.async.semaphore() and vim.version().
- Export vim.lsp.tagfunc directly with lazy loading and document its
implementation instead of maintaining a wrapper.
- Group files in section_order, replacing append_only and merge_files.
Merge declarations before sorting each section, placing shared helpers
in the main vim section and keeping vim.inspect in alphabetical order.
- Add basic parser coverage for callable modules and module links.
AI-assisted
Diffstat (limited to 'runtime/lua/vim/pack.lua')
| -rw-r--r-- | runtime/lua/vim/pack.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/pack.lua b/runtime/lua/vim/pack.lua index ee0cf11c83..da47043579 100644 --- a/runtime/lua/vim/pack.lua +++ b/runtime/lua/vim/pack.lua @@ -890,7 +890,7 @@ local function install_list(plug_list, confirm) if not confirm or confirm_install(plug_list) then trigger_events(plug_list, 'PackChangedPre', 'install') run_list(plug_list, do_install, 'Installing plugins') - local installed = vim.tbl_filter(function(p) --- @param p vim.pack.Plug + local installed = vim.tbl_filter(function(p) return p.info.installed == true end, plug_list) trigger_events(installed, 'PackChanged', 'install') @@ -945,7 +945,7 @@ local function infer_update_details(p) local any_version = vim.version.range('*') --[[@as vim.VersionRange]] local last_version = get_last_semver_tag(past_tags, any_version) - local newer_semver_tags = vim.tbl_filter(function(x) --- @param x string + local newer_semver_tags = vim.tbl_filter(function(x) return vim.version.gt(x, last_version) end, all_semver_tags) @@ -1400,7 +1400,7 @@ local function update_list(plug_list) end run_list(plug_list, do_update, 'Applying updates') - local updated = vim.tbl_filter(function(p) --- @param p vim.pack.Plug + local updated = vim.tbl_filter(function(p) return p.info.updated == true end, plug_list) trigger_events(updated, 'PackChanged', 'update') @@ -1503,7 +1503,7 @@ function M.update(names, opts) -- Update and show report if opts.force then - local plugs_to_update = vim.tbl_filter(function(p) --- @param p vim.pack.Plug + local plugs_to_update = vim.tbl_filter(function(p) return p.info.sha_head ~= p.info.sha_target end, plug_list) update_list(plugs_to_update) |