aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/pack
Commit message (Collapse)AuthorAge
* fix(pack): ignore inherited GIT_INDEX_FILE #42114Jake Wang2026-09-30
| | | | | | | | | | | | Problem: An inherited Git index can leave a plugin checkout empty or prevent updates. Solution: Clear GIT_INDEX_FILE for plugin Git commands. Verify installs and updates preserve the caller environment and index. AI-assisted Signed-off-by: Jake Wang <jakezwang@users.noreply.github.com>
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(lua): enable assignment type checking in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | Enable EmmyLua's assign-type-mismatch diagnostic after correcting the runtime annotations and assignments it flags. Correct option, tuple, and return types, and use separate locals when a value changes representation. Add guards and narrow casts where needed so the runtime passes the stricter check. Regenerate the affected docs. AI-assisted
* fix(lua): enable nil-safety diagnostics in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | | Enable EmmyLua's need-check-nil diagnostic and resolve nullable values through more precise types, explicit invariants, and guards for missing runtime state. Keep analyzer-specific workarounds local and update the affected API documentation. Exclude the bundled re.lua from analysis so its nil-check warnings do not fail CI. AI-assisted
* docs(pack): mention `:checkhealth vim.pack` #41955Evgeni Chasnovski2026-09-18
| | | | | | Problem: No explicit recommendations about how to check for possible issues related to `vim.pack`. Soltuion: Mention `:checkhealth vim.pack` explicitlye as a recipe.
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* build: enable more EmmyLua checksLewis Russell2026-09-09
| | | | | | | | | | Enable checks for unused code, deprecated calls, return types, and annotations. Fix the warnings and replace the deprecated highlight function. Keep exceptions where old APIs are still needed or the checker gets it wrong. AI-assisted
* fix(pack): read document links from the request buffer #41638Volodymyr Chernetskyi2026-09-02
| | | | | | | | | | | | | Problem: The `textDocument/documentLink` handler resolves the confirmation buffer from the request URI and checks it for `nil`, then reads lines from buffer `0`. When the confirmation buffer is not current, links are computed from unrelated text and returned against the confirmation buffer's line numbers, producing missing or misplaced links. Solution: Read lines from the resolved `bufnr`. AI-assisted
* feat(pack): add support for sourcing manifest scriptsEvgeni Chasnovski2026-07-31
| | | | | | | | | | | | | | | | | | | Problem: No way for plugins to define hooks that would be executed during plugin lifecycle. Like after install/update or before update/delete. Solution: Automatically source scripts defined in plugin manifest file (if any) after triggering corresponding `PackChanged{,Pre}` events. During sourcing make some termporary adjustments: - Current directory is set to plugin's root to simplify execution of CLI calls like `make build`. - Plugin's path is ensured to be inside 'runtimepath' to allow using `require('plugin-module')` inside manifest scripts. The reason to execute after triggering event is so that there is a possibility for users to execute code both before the script (exactly on event) and after the script (more-or-less via `vim.schedule` called on the event).
* feat(pack): introduce plugin manifest supportEvgeni Chasnovski2026-07-31
| | | | | | | | | Problem: There is no agreed way for plugins to provide extra information about themselves. Like required Neovim version, install/update/delete hooks, and dependencies. Solution: Introduce basic concept of plugin manifest file `pkg.json` based on https://packspec.org/.
* feat(pack): 'packlockfile' option #40562Evgeni Chasnovski2026-07-08
| | | | | Problem: No way to configure the lockfile location. Solution: Add 'packlockfile' option.
* fix(health): handle failed dir listingJustin M. Keyes2026-07-01
|
* fix(pack): suggest "delete" code action for active plugins #39678Evgeni Chasnovski2026-05-08
| | | | | | | | | | Problem: Trying to execute code action on an active plugin without updates leads to nothing. It is more useful if code actions "do something" on a bigger portion of the confirm buffer. Solution: Suggest "delete" code action even for active plugins. Trying to execute it will first show a confirmation buffer with relevant warning of why this might be not a good idea. Confirming will delete a plugin.
* fix(util): add and use forge link computationEvgeni Chasnovski2026-04-25
| | | | | | | | Problem: There are many Git forges each with a different way of constructing permanent links to like commits and tags. Solution: Add a private utility function that computes these special links on the best effort basis.
* feat(pack): support `textDocument/documentLink` in confirmation bufferEvgeni Chasnovski2026-04-25
| | | | | | | | | | | | | | Problem: In `vim.pack.update()` confirmation buffer it might be useful to be able to use `gx` (open link at cursor) when cursor is on something like commit or tag. Solution: Add `textDocument/documentLink` method support for the in-process LSP. This may be used by LSP clients and makes `gx` automatically work. The shortcoming is that this requires tracking how to construct a URL from source and commit/tag. Currently only GitHub hosted repositories are supported.
* fix(pack): GIT_DIR/GIT_WORK_TREE env vars may interfere #39279fleesk2026-04-22
| | | | | | | | Problem: With GIT_DIR/GIT_WORK_TREE set, the LSP on the vim.pack.update() confirmation buffer does not show the correct git log on hover. Solution: Temporarily remove the git vars from the environment.
* fix(pack): more advice for out-of-sync lockfile #38931Evgeni Chasnovski2026-04-10
| | | | | | | | | | Problem: If the lockfile points to the revision that is not on disk, the `:checkhealth vim.pack` suggests to run `vim.pack.update()`. Although usually it should resolve the problem, it is not always the case: like if the state on disk is already the latest available. Solution: Add an extra suggestion with a more drastic measure by manually removing `rev` field from the lockfile for it to be repaired after the `:restart`.
* fix(pack): account for Git's "insteadOf" in `:checkhealth` #38393Evgeni Chasnovski2026-03-20
| | | | | | | | | | | | Problem: It is possible (and documented in `:h vim.pack`) that plugin's `src` uses "insteadOf" Git config. In that case comparing it directly to repo's `origin` will error. Solution: Add extra check that lockfile's `src` is not equal to repo's `origin` when taking Git's "insteadOf" into account. However, still report the original lockfile's `src` in the `:checkhealth` output, as it seems to be a clearer indication of what actually is wrong.
* refactor: integer functions, optimize asserts #34112Lewis Russell2026-03-12
| | | | | | | | | | | | refactor(lua): add integer coercion helpers Add vim._tointeger() and vim._ensure_integer(), including optional base support, and switch integer-only tonumber()/assert call sites in the Lua runtime to use them. This also cleans up related integer parsing in LSP, health, loader, URI, tohtml, and Treesitter code. supported by AI
* docs: deprecate hit-enterJustin M. Keyes2026-03-11
|
* feat(pack): add checkhealthEvgeni Chasnovski2026-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: No `:checkhealth` entry. Solution: Add `:checkhealth vim.pack`. Design it around validating assumptions about `vim.pack` usage and giving actionable advice to fix possible issues. In particular: - Basic requirements are met: `git` executable, lockfile, and plugin directory are present. - Lockfile has correct shape (json with correct field types) and aligns with plugins on disk (revision and source are as expected). - Plugin directory has proper entries: all directories, in the state that `vim.pack` might leave them. Also notify if there are not active plugins. Those might be lazy loaded (okay) or removed an entry from the config without `vim.pack.del()` (not okay). Make sure that it passes with brief feedback if it doesn't look like `vim.pack` is being used. Duplicate check for `git` executable (on top of already existing very similar 'health/health.lua' check for "External tools") to have it shown after `:checkhealth vim.pack`. Keep the other check for more exposure and possibly for other plugins to reuse it.
* Merge #37113 from echasnovski/pack-better-revertJustin M. Keyes2025-12-30
|\
| * feat(pack): allow running `update()` without Internet connectionEvgeni Chasnovski2025-12-26
| | | | | | | | | | | | | | | | | | | | Problem: There is now way to run `update()` without Internet connection while there are some workflows that do not require it. Like "switch plugin version" and "revert latest update". Solution: Add `opts.offline` to `update()`. This also allows now to treat `vim.pack.update(nil, { offline = true })` as a way to interactively explore currently installed plugins.
* | feat(pack)!: suggest "delete" code action only for not active pluginsEvgeni Chasnovski2025-12-28
| | | | | | | | | | | | | | | | Problem: Deleting active plugins can lead to a situation when it is reinstalled after restart. Solution: Suggest "delete" code action only for not active plugins. Whether a plugin is not active is visible by a hint in its header.
* | feat(pack): hint in confirmation buffer that plugin is not activeEvgeni Chasnovski2025-12-28
| | | | | | | | | | | | | | | | | | | | | | Problem: After `vim.pack.update()` it is not clear if plugin is active or not. This can be useful to detect cases when plugin was removed from 'init.lua' but there was no `vim.pack.del()`. Solution: Add ` (not active)` suffix with distinctive highlighting to header of plugins that are not active. It will also be shown in in-process LSP document symbols to have quick reference about which plugins are not active.
* | feat(pack)!: make `del()` only remove non-active plugins by defaultEvgeni Chasnovski2025-12-28
|/ | | | | | | | | | | | Problem: Using `vim.pack.del()` to delete active plugin can lead to a situation when this plugin is reinstalled after restart. Removing plugin from 'init.lua' is documented, but can be missed. Solution: Make `del()` only remove non-active plugins by default and throw an informative error if there is an active plugin. Add a way to force delete any plugin by adding `opts.force`. This also makes `del()` signature be the same as other functions, which is nice.
* fix(pack): rename confirmation buffer to again use `nvim-pack://` schemeEvgeni Chasnovski2025-11-17
| | | | | | | | | | | | Problem: `nvim://` scheme feels more like a generalized interface that may be requested externally, and it acts like CLI args (roughly). This is how `vscode://` works. Anything that behaves like an "app" or a "protocol" deserves its own scheme. For such Nvim-owned things they will be called `nvim-xx://`. Solution: Use `nvim-pack://confirm#<bufnr>` template for confirmation buffer name instead of `nvim://pack-confirm#<bufnr>`.
* fix(pack): use more correct URI for confirmation buffer nameEvgeni Chasnovski2025-11-06
| | | | | | | | | Problem: Confirmation buffer is named with `nvim-pack://` as scheme prefix and uses buffer id (needed for in-process LSP) as one an entry in the "hierarchical part". Solution: Use `nvim://pack-confirm#<buf>` format with a more ubiquitous `nvim://` prefix and buffer id at the end as the optional fragment.
* fix(pack): consistently use "revision" instead of "state"Evgeni Chasnovski2025-11-06
| | | | | | | | Problem: In some areas plugin's revision is named "state". This might be confusing for the users. Solution: Consistently use "revision" to indicate "plugin's state on disk".
* feat(pack): add code actions in confirmation bufferEvgeni Chasnovski2025-10-05
| | | | | | | | | | | | | Problem: No way to granularly operate on plugins when inside confirmation buffer. Solution: Implement code actions for in-process LSP that act on "plugin at cursor": - Update (if has updates). - Skip updating (if has updates). - Delete. Activate via default `gra` or `vim.lsp.buf.code_action()`.
* feat(pack): add built-in plugin manager `vim.pack`Evgeni Chasnovski2025-07-04
Problem: No built-in plugin manager Solution: Add built-in plugin manager Co-authored-by: Lewis Russell <lewis6991@gmail.com>