aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* feat(lsp): support range + full semantic token requests #37611jdrouhard2026-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the LSP Spec: > There are two uses cases where it can be beneficial to only compute > semantic tokens for a visible range: > > - for faster rendering of the tokens in the user interface when a user > opens a file. In this use case, servers should also implement the > textDocument/semanticTokens/full request as well to allow for flicker > free scrolling and semantic coloring of a minimap. > - if computing semantic tokens for a full document is too expensive, > servers can only provide a range call. In this case, the client might > not render a minimap correctly or might even decide to not show any > semantic tokens at all. This commit unifies the usage of range and full/delta requests as recommended by the LSP spec and aligns neovim with the way other LSP clients use these request types for semantic tokens. When a server supports range requests, neovim will simultaneously send a range request and a full/delta request when first opening a file, and will continue to issue range requests until a full response is processed. At that point, range requests cease and full (or delta) requests are used going forward. The range request should allow servers to return a result faster for quicker highlighting of the file while it works on the potentially more expensive full result. If a server decides the full result is too expensive, it can just error out that request, and neovim will continue to use range requests. This commit also fixes and cleans up some other things: - gen_lsp: registrationMethod or registrationOptions imply dynamic registration support - move autocmd creation/deletion to on_attach/on_detach - debounce requests due to server refresh notifications - fix off by one issue in tokens_to_ranges() iteration
* Merge #37626 feat(lsp)!: textDocument/codeLens as decoration providerJustin M. Keyes2026-02-03
|\
| * feat(lsp): support `workspace/codeLens/refresh`Yi Ming2026-02-03
| |
| * feat(lsp)!: reimplement `textDocument/codeLens` as decoration providerYi Ming2026-02-03
| |
* | fix(lsp): avoid scheduling client deletion before LspNotify #37685Yi Ming2026-02-03
| | | | | | | | | | | | | | | | | | | | | | | | Problem: `Client.on_exit` runs `Client._on_detach` and the client removal logic within two separate `vim.schedule` sequentially. However, since `Client._on_detach` executes `LspNotify` inside `vim.schedule`, this causes `LspNotify` to be executed after the client removal, which is scheduled first. At that point, a valid `Client` can no longer be retrieved within the autocmd callback. Solution: Put the client deletion inside the `vim.schedule` call.
* | feat(defaults): exclude temp dirs from 'shada' oldfiles #37631Pavel Pisetski2026-02-03
| | | | | | | | | | | | | | | | | | | | Problem: Temporary files from /tmp/ and /private/ paths clutter :oldfiles list. Additionally, the documented Windows default (rA:,rB:) was never applied due to a missing platform condition. Solution: Drop platform-specific shada differences and default to excluding /tmp/ and /private/ paths.
* | fix(ui2): wildmenu hidden behind dialog window #37684luukvbaal2026-02-03
|/ | | | | | | Problem: The wildmenu is hidden behind the dialog window with "list" in 'wildmode'. Global ('laststatus' set to 3) statusline is hidden behind the pager window. Solution: Check wildmenumode() to adjust the dialog position when necessary. Ensure pager is positioned above the global statusline with 'laststus' set to 3.
* fix(ui2): callbacks reference stale message-window handles #37673luukvbaal2026-02-02
| | | | | Problem: Scheduled callbacks reference potentially outdated window handles e.g. after switching tabpage. Solution: Use ext.wins which stores the updated window handles.
* fix(lua): close vim.defer_fn() timer if vim.schedule() failed (#37647)zeertzjq2026-02-01
| | | | | | | | Problem: Using vim.defer_fn() just before Nvim exit leaks luv handles. Solution: Make vim.schedule() return an error message if scheduling failed. Make vim.defer_fn() close timer if vim.schedule() failed.
* fix(lsp): call `on_list` before reading `loclist` #37645Maria Solano2026-02-01
| | | | | | | Problem: `on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true. Solution: Change the order of the relevant blocks.
* vim-patch:dd9f7e6: runtime(doc): Fix some overlength lineszeertzjq2026-02-01
| | | | | | | | closes: vim/vim#19286 https://github.com/vim/vim/commit/dd9f7e6cbbba6d8e63cca3b4c537dc9b8cc1837a Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* fix(lsp): use LSP textEdit range for completion start boundary (#37491)Harsh Kapse2026-01-30
| | | | | | | | | | | | | | | Previously, adjust_start_col returned nil when completion items had different start position from lsp textEdit range This caused the completion to fall back to \k*$ which ignores the non-keyword characters Changes: - adjust_start_col: now returns the minimum start postion among all items instead of nil - _lsp_to_complete_items - normalizes the items by adding the gap between current and minimum start Fixes: https://github.com/neovim/neovim/issues/37441
* docs(pack): clarify caveats about installing based on the lockfileEvgeni Chasnovski2026-01-29
|
* perf(filetype): vim.filetype.get_option cache miss when option value is ↵phanium2026-01-28
| | | | | | | | false #37593 Problem: when option value is false, it's treated as invalid then trigger FileType event again Solution: use cached false value
* refactor(lua): use vim.fs instead of fnamemodifyYochem van Rosmalen2026-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | Although powerful -- especially with chained modifiers --, the readability (and therefore maintainability) of `fnamemodify()` and its modifiers is often worse than a function name, giving less context and having to rely on `:h filename-modifiers`. However, it is used plenty in the Lua stdlib: - 16x for the basename: `fnamemodify(path, ':t')` - 7x for the parents: `fnamemodify(path, ':h')` - 7x for the stem (filename w/o extension): `fnamemodify(path, ':r')` - 6x for the absolute path: `fnamemodify(path, ':p')` - 2x for the suffix: `fnamemodify(path, ':e')` - 2x relative to the home directory: `fnamemodify(path, ':~')` - 1x relative to the cwd: `fnamemodify(path, ':.')` The `fs` module in the stdlib provides a cleaner interface for most of these path operations: `vim.fs.basename` instead of `':t'`, `vim.fs.dirname` instead of `':h'`, `vim.fs.abspath` instead of `':p'`. This commit refactors the runtime to use these instead of fnamemodify. Not all fnamemodify calls are removed; some have intrinsic differences in behavior with the `vim.fs` replacement or do not yet have a replacement in the Lua module, i.e. `:~`, `:.`, `:e` and `:r`.
* fix(types): add missing @return annotationsJosh Cooper2026-01-28
|
* fix: lsp.enable() don't work correctly inside FileType event #37538phanium2026-01-27
| | | | | | | | | | | | | | | | | | | | Problem: Two cases lsp.enable() won't work in the first FileType event 1. lsp.enable luals inside FileType or ftplugin/lua.lua, then: ``` nvim a.lua ``` 2. lsp.enable luals inside FileType or ftplugin/lua.lua, then: ``` nvim -> :edit a.lua -> :mksession! | restart +qa! so Session.vim ``` Solution: Currently `v:vim_did_enter` is used to detected two cases: 1. "maunally enabled" (lsp.enable() or `:lsp enable`) 2. "inside FileType event" To detect 2. correctly we use did_filetype().
* fix(lsp): remove side-effects if `vim.lsp.enable()` raises an error (#37571)Olivia Kinnear2026-01-27
| | | | | | | | | | | | | | | | | Problem: If `vim.lsp.enable()` fails with an error, either because `'*'` is one of the provided names or because there is an error in a config, `vim.lsp.enable()` will still have side-effects: - All names before the one that encountered an error will still be added to `lsp._enabled_configs`, but the autocommand will not get added or run. - Any name which makes `vim.lsp.config[name]` error will be added to `lsp._enabled_configs`, causing all future calls to `vim.lsp.enable()` to fail. This will also break `:che vim.lsp`. Solution: - Check all names for errors before modifying `lsp._enabled_configs`. - Check `vim.lsp.config[name]` does not raise an error before enabling the name.
* Merge #37309 :checkhealth vim.packJustin M. Keyes2026-01-27
|\
| * 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.
| * fix(pack): ensure plugin directory is created during first usage attemptEvgeni Chasnovski2026-01-08
| | | | | | | | | | | | | | Problem: Plugin directory ('.../pack/core/opt') may be missing while lockfile is present. Like after discarded attempt to install plugins. Solution: Ensure plugin directory is created on first `vim.pack` use.
* | fix: misc typos #37471phanium2026-01-27
| |
* | fix(health): use FileType autocmd for bug report winbar #37486glepnir2026-01-27
| | | | | | | | | | | | | | Problem: In float mode, vim.schedule() may run before filetype is set, so winbar is not shown. Solution: Use FileType autocmd to ensure winbar is set after filetype. Also use type=Bug in URL.
* | feat(lsp): semantic token range improvements #37451jdrouhard2026-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cache all tokens from various range requests for a given document version - all new token highlights are merged with previous highlights to maintain order and the "marked" property - this allows the tokens to stop flickering once they've loaded once per document version * abandon the processing coroutine if the request_id has changed instead of relying only on the document version - this will improve efficiency if a new range request is made while a previous one was processing its result * apply new highlights from processing coroutine directly to the current result when the version hasn't changed - this allows new highlights to be immediately drawable once they've processed instead of waiting for the whole response to be processed at once * rpc layer was changed to provide the request ID back in success callbacks, which is then provided as a request_id field on the handler context to lsp handlers
* | feat(health): check `vim.ui.open()` tool #37569skewb1k2026-01-27
| | | | | | | | | | | | | | | | | | Problem: `:checkhealth` does not report when no `vim.ui.open()` handler is available. Solution: Factor command resolution into `_get_open_cmd()` and reuse it from `:checkhealth` to detect missing handlers.
* | fix(health): add back `vim.cmd.redraw()` call (#37576)Olivia Kinnear2026-01-27
| | | | | | Was erroneously removed by #37462 during rebase.
* | fix(ui): only internal messages are unsafe #37462luukvbaal2026-01-26
| | | | | | | | | | | | | | | | Problem: Fast context for msg_show event inhibits vim.ui_attach from displaying a stream of messages from a single command. Solution: Remove fast context from msg_show events emitted as a result of explicit API/command calls. The fast context was originally introduced to prevent issues with internal messages.
* | fix(health): redraw after emitting progress message #37567Olivia Kinnear2026-01-26
| | | | | | | | | | | | | | | | | | Problem: `vim.cmd.redraw()` is not called after displaying a progress message, so vim will display progress for the previous health check, not the current one. Solution: Call `vim.cmd.redraw()` so that the correct progress message is displayed.
* | docs: nvim_set_hl fg_index, bg_indexed #37534glepnir2026-01-26
| |
* | fix(diagnostics): assert adjusted diagnostic position #37210Sergei Slipchenko2026-01-26
| | | | | | | | | | | | | | | | | | Problem: During diagnostic position adjustment we may go out of bounds when trying to get line's length. But it's not clear what kind of input triggers that. Solution: Assert and print relevant input values.
* | docspack): mention re-install after source's default branch change #37560Evgeni Chasnovski2026-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.pack.update()` doesn't update source's default branch if it has changed on the remote. It can be done by executing `git remote set-head origin --auto` for every plugin on every update, but it feels like too much extra work (which requires Internet connection) for a very rare use case. This matters since `version = nil` will keep pointing to previous default branch even after `vim.pack.update()`. Solution: Document that in order for `version = nil` to point to the source's new default branch, perform clean re-install.
* | vim-patch:9.1.2110: filetype: skhd files are not recognizedzeertzjq2026-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: skhd files are not recognized Solution: Detect .skhdrc and skhdrc as skhd filetype, include a syntax and filetype plugin, add syntax tests (Kiyoon Kim) Add syntax highlighting for skhd (simple hotkey daemon for macOS) configuration files. Includes filetype detection for skhdrc and .skhdrc files. Reference: - https://github.com/asmvik/skhd closes: vim/vim#19235 https://github.com/vim/vim/commit/e5f61842b509acea91c63923e60987ad7ae123dd Co-authored-by: Kiyoon Kim <kiyoon@users.noreply.github.com>
* | vim-patch:9.1.2109: filetype: NetLinx fires are not recognizedzeertzjq2026-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: NetLinx fires are not recognized Solution: Detect *.axs and *.axi as netlinx filetype (kb). Reference: - https://www.amx.com/en/site_elements/amx-language-reference-guide-netlinx-programming-language - https://kielthecoder.com/2021/06/11/netlinx-getting-started/ closes: vim/vim#19249 https://github.com/vim/vim/commit/6963e3b8bf46893f8d09e7ea556c37581248e777 Co-authored-by: kb <kim@simple.industries>
* | feat(lsp): highlighting the symbol being renamed (#37390)Yi Ming2026-01-23
| |
* | build(deps): bump luv to 1.51.0-2Christian Clason2026-01-23
| |
* | fix(lsp): raise error when lsp config is invalid type (#37508)Olivia Kinnear2026-01-22
| |
* | fix(lsp): fix nil-index error for `:lsp enable` (#37411)Olivia Kinnear2026-01-22
| | | | | | | | | | | | | | | | Problem: `:lsp enable` with no arguments will fail if there is a invalid config in `lsp/`, or if `vim.lsp.config[...]` returns nil for any other reason. Solution: Add a nil-check to `:lsp enable`.
* | vim-patch:9.1.2100: filetype: tiltfiles are not recognized (#37477)zeertzjq2026-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: tiltfiles are not recognized Solution: Detect Tiltfiles.* and *.tiltfiles as tiltfile filetype. (Luis Davim) Reference: - https://docs.tilt.dev/api.html fixes: vim/vim#19214 closes: vim/vim#19218 https://github.com/vim/vim/commit/ff0e5d994ca4b533f3c9c43a7a154276b0fa08fb Co-authored-by: Luis Davim <luis.davim@gmail.com>
* | vim-patch:9.1.1202: Missing TabClosedPre autocommandzeertzjq2026-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Missing TabClosedPre autocommand (zoumi) Solution: Add the TabClosedPre autcommand (Jim Zhou). fixes: vim/vim#16518 closes: vim/vim#16855 https://github.com/vim/vim/commit/5606ca5349982fe53cc6a2ec6345aa66f0613d40 Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
* | vim-patch:9.1.2094: filetype: tiger files are not recognizedChristian Clason2026-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: tiger files are not recognized Solution: Detect *.tig files as tiger filetype (Christian Clason). Reference: - https://www.cs.princeton.edu/~appel/modern/ closes: vim/vim#19202 https://github.com/vim/vim/commit/eb53ed5de01cfc4effc1825ad710999172c138ab Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* | fix(health): show full curl outputChristian Clason2026-01-17
| | | | | | | | | | | | | | Problem: The health check for `curl` strips the first line of the version output, which contains potentially useful information. Solution: Only trim empty lines.
* | vim-patch:9.1.0059: No event triggered before creating a windowzeertzjq2026-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No event is triggered before creating a window. (Sergey Vlasov) Solution: Add the WinNewPre event (Sergey Vlasov) fixes: vim/vim#10635 closes: vim/vim#12761 https://github.com/vim/vim/commit/1f47db75fdc8c53c5c778b26ecfa0942ac801f22 Not sure if this should be triggered before creating a floating window, as its use case is related to window layout. Co-authored-by: Sergey Vlasov <sergey@vlasov.me>
* | fix(treesitter): fix spell navigation on first line (#37361)ashab-k2026-01-15
| | | | | | | | | | | | | | | | Problem: Spell navigation skips words on the first line because _on_spell_nav passes an empty range (0,0) to the highlighter. Solution: Use math.max(erow, srow + 1) to ensure a valid search window. Signed-off-by: ashab-k <ashabkhan2000@gmail.com>
* | Merge #37377 from echasnovski/pack-fix-checkoutJustin M. Keyes2026-01-13
|\ \
| * | fix(pack): actually checkout proper version of submodulesEvgeni Chasnovski2026-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Installing plugin with submodules doesn't check out their state (due to `git clone --no-checkout` to not end up with default branch code in case of invalid `version`). Updating a plugin with submodules doesn't update their state. Solution: Update `git_checkout` helper to account for submodules. Another approach would be `git checkout --recurse-submodules ...`, but that doesn't seem to allow `--filter=blob:none` for submodules, which is nice to have. Also make `git_clone` wrapper simpler since `--no-checkout` makes `--recurse-submodules` and `--also-filter-submodules` do nothing.
| * | fix(pack): skip `git stash` during installEvgeni Chasnovski2026-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Installing plugin is done via `git clone --no-checkout ...` (to not end up with default branch code in case of invalid `version`). This leaves cloned repo in a state that `git stash` will actually add an entry to the stash list. Although not critical, better to not have that if possible. Solution: explicitly skip `git stash` step in checkout during install.
* | | fix(glob): handle numeric literals in pattern matching (#37257)Tristan Knight2026-01-12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: vim.glob.to_lpeg() errors when patterns contain numeric literals (like the '1' in '.ps*1') because LPeg interprets numeric strings as indexed grammar rule references. For example: vim.glob.to_lpeg('.ps*1') E5108: Lua: rule '1' undefined in given grammar Solution: Prefix all rule names with '_' in the end_seg() function to prevent literal numbers from being interpreted as LPeg indexed rules. This ensures pattern components like '1',