4267 Commits

Author SHA1 Message Date
Tomasz N
eaacdc9bdf fix(lsp): ignore empty response on trigger completion #37663
Problem:
Empty response affects server start boundary computed before.

Solution:
Ignore empty responses. This is mostly micro-optimization that avoids
extending existing results with empty responses.
2026-02-08 16:25:47 -05:00
Mike J McGuirk
15ff454443 feat(lsp): display codelens as virtual lines, not virtual text #36469
Problem: Code lenses currently display as virtual text on the same line
and after the relevant item. While the spec does not say how lenses
should be rendered, above the line is most typical. For longer lines,
lenses rendered as virtual text can run off the side of the screen.

Solution: Display lenses as virtual lines above the text.

Closes https://github.com/neovim/neovim/issues/33923

Co-authored-by: Yi Ming <ofseed@foxmail.com>
2026-02-08 16:10:41 -05:00
Evgeni Chasnovski
0f73873d4f fix(pack): close confirmation buffer, not tabpage #37756 2026-02-08 09:15:16 -05:00
Mike J McGuirk
6cb3254c2f docs(eval): fix fn.strchar types #37737
Problem: The following strchar functions have incorrect types:

strcharlen() - Currently any. Always returns an integer, including on
error

strcharpart() - The skipcc annotation does not specify that 0 and 1 are
valid. These inputs are required for vimscript usage. The current
return type is any, even though the function returns an empty string
on error

strchars() - The skipcc annotation does not specify that 0 and 1 are
valid

Solution: Update the problem types.
2026-02-08 08:07:49 -05:00
Mike J McGuirk
6771b10b88 docs(eval): correct types for getcharsearch, setcharsearch #37734
Problem: In eval.lua, setcharsearch() has an incorrect param type,
causing Lua_Ls to display an error when a valid table is passed.

While getcharsearch correctly states that it returns a table, the type
is non-specific about the contents.

Solution: Update eval.lua with the correct types.
2026-02-08 08:06:55 -05:00
Mathias Fußenegger
c4f322b769 refactor(lsp): always fetch lenses again in codelens.run (#37720)
The auto-refresh has a bit of a delay so it can happen that when a user
runs `codelens.run` it operates on an outdated state and either
does nothing, or fails.

This changes the logic for `.run` to always fetch the current lenses
before (optional) prompt and execution.

See discussion in https://github.com/neovim/neovim/pull/37689#discussion_r2764235931

This could potentially be optimized to first check if there's local
state with a version that matches the current buf-version, but in my
testing re-fetching them always was quickly enough that `run` still
feels instant and doing it this way simplifies the logic.

Side effect of the change is that `.run` also works if codelens aren't
enabled - for power users who know what the codelens would show that can
be useful.
2026-02-06 13:31:44 +01:00
luukvbaal
e198037148 fix(ui2): always route to dialog when cmdline is open #37730
Problem:  Messages emitted while cmdline is open are not shown with
          cmdline message target.
Solution: Route to dialog window when cmdline is open.
2026-02-05 14:54:22 -05:00
Christian Clason
13a9cdc6b4 docs(lua): vim.keymap.set takes no noremap #37723
Problem: Unlike `nvim_keymap_set`, `vim.keymap.set` uses the non-negated
`remap` instead of `:set`'s `noremap`, but the documentation for this
got lost sometime before Nvim 0.10.

Solution: Restore the lost documentation and make it more explicit.
2026-02-05 08:43:04 -05:00
luukvbaal
bf68ba40a0 refactor: rename _extui => _core.ui2 #37692
Problem:
_extui module name is confusing and should eventually end up in _core/.

Solution:
Move it there and name it ui2.
2026-02-05 07:45:45 -05:00
luukvbaal
72a557c61b fix(ui2): only copy highlight marks when expanding cmdline #37709
Problem:  Error copying over multi-line message span marks to expanded cmdline.
Solution: Only copy over the highlight marks as intended.
2026-02-04 19:23:22 -05:00
luukvbaal
db2a54996e feat(ui2): replace message by its ID #37672
Problem:  UI2 does not implement the msg_show event msg_id parameter.
Solution: Store message IDs currently shown in the cmd/msg buffers.
          Set extmarks spanning the message which are used to replace
          a still visible message when a new message with the same ID
          is received.
2026-02-04 14:11:35 -05:00
Sean Dewar
9655bd560f fix(ui2): don't adjust dialog pos for pum wildmenu (#37695)
Problem:  Dialog position unnecessarily adjusted for pum wildmenu.
Solution: Apply no offset if the pum is visible.
2026-02-04 13:15:34 +01:00
Tomasz N
90abd2613d fix(lsp): don't empty server start-boundary by next client response #37665
Problem:
Server start boundary can be emptied by response provided by next client.

Solution:
Don't empty it when extending the result list.
2026-02-03 15:30:05 -05:00
jdrouhard
9278f792c3 feat(lsp): support range + full semantic token requests #37611
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
2026-02-03 13:16:12 -05:00
Justin M. Keyes
f5931102f8 Merge #37626 feat(lsp)!: textDocument/codeLens as decoration provider 2026-02-03 09:46:37 -05:00
Yi Ming
6f733f4a9b fix(lsp): avoid scheduling client deletion before LspNotify #37685
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.
2026-02-03 09:33:14 -05:00
Yi Ming
965468fca1 feat(lsp): support workspace/codeLens/refresh 2026-02-03 22:25:21 +08:00
Yi Ming
fe23168e2b feat(lsp)!: reimplement textDocument/codeLens as decoration provider 2026-02-03 22:25:18 +08:00
Pavel Pisetski
41cac54325 feat(defaults): exclude temp dirs from 'shada' oldfiles #37631
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.
2026-02-03 08:31:37 -05:00
luukvbaal
3038f0191e fix(ui2): wildmenu hidden behind dialog window #37684
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.
2026-02-03 08:17:33 -05:00
luukvbaal
8c7bbfba3d fix(ui2): callbacks reference stale message-window handles #37673
Problem:  Scheduled callbacks reference potentially outdated window
          handles e.g. after switching tabpage.
Solution: Use ext.wins which stores the updated window handles.
2026-02-02 10:54:26 -05:00
zeertzjq
1906da52db fix(lua): close vim.defer_fn() timer if vim.schedule() failed (#37647)
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.
2026-02-01 21:29:19 +08:00
Maria Solano
0501c5fd09 fix(lsp): call on_list before reading loclist #37645
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.
2026-02-01 07:18:16 -05:00
zeertzjq
c74d5ceda1 vim-patch:dd9f7e6: runtime(doc): Fix some overlength lines
closes: vim/vim#19286

dd9f7e6cbb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-01 08:30:59 +08:00
Harsh Kapse
36db6ff2c1 fix(lsp): use LSP textEdit range for completion start boundary (#37491)
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
2026-01-30 15:34:42 +01:00
Evgeni Chasnovski
1aa81290a4 docs(pack): clarify caveats about installing based on the lockfile 2026-01-29 16:24:33 +02:00
phanium
babdab2f70 perf(filetype): vim.filetype.get_option cache miss when option value is false #37593
Problem: when option value is false, it's treated as invalid
then trigger FileType event again

Solution: use cached false value
2026-01-28 05:58:00 -05:00
Yochem van Rosmalen
f7041625f1 refactor(lua): use vim.fs instead of fnamemodify
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`.
2026-01-28 10:57:39 +00:00
Josh Cooper
9988d7142d fix(types): add missing @return annotations 2026-01-28 10:56:36 +00:00
phanium
fd45bc8cab fix: lsp.enable() don't work correctly inside FileType event #37538
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().
2026-01-27 17:59:36 -05:00
Olivia Kinnear
34815777b2 fix(lsp): remove side-effects if vim.lsp.enable() raises an error (#37571)
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.
2026-01-27 13:17:45 -08:00
Justin M. Keyes
c2ecc9ca41 Merge #37309 :checkhealth vim.pack 2026-01-27 09:19:46 -05:00
phanium
dfa5d79d05 fix: misc typos #37471 2026-01-27 09:18:02 -05:00
glepnir
ae93639ec4 fix(health): use FileType autocmd for bug report winbar #37486
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.
2026-01-27 09:06:50 -05:00
jdrouhard
8ed68fda50 feat(lsp): semantic token range improvements #37451
* 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
2026-01-27 08:56:52 -05:00
skewb1k
8c63d84be1 feat(health): check vim.ui.open() tool #37569
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.
2026-01-27 08:51:00 -05:00
Olivia Kinnear
c28113dd9d fix(health): add back vim.cmd.redraw() call (#37576)
Was erroneously removed by #37462 during rebase.
2026-01-27 08:54:27 +01:00
luukvbaal
d30d91f3a4 fix(ui): only internal messages are unsafe #37462
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.
2026-01-26 18:18:51 -05:00
Olivia Kinnear
e9d03b92b6 fix(health): redraw after emitting progress message #37567
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.
2026-01-26 16:15:47 -05:00
glepnir
543e14d040 docs: nvim_set_hl fg_index, bg_indexed #37534 2026-01-26 08:31:57 -05:00
Sergei Slipchenko
f7b573f80a fix(diagnostics): assert adjusted diagnostic position #37210
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.
2026-01-26 08:26:50 -05:00
Evgeni Chasnovski
e6d955cb2c docspack): mention re-install after source's default branch change #37560
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.
2026-01-26 08:20:33 -05:00
zeertzjq
d982c00846 vim-patch:9.1.2110: filetype: skhd files are not recognized
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

e5f61842b5

Co-authored-by: Kiyoon Kim <kiyoon@users.noreply.github.com>
2026-01-26 07:00:32 +08:00
zeertzjq
798ee64287 vim-patch:9.1.2109: filetype: NetLinx fires are not recognized
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

6963e3b8bf

Co-authored-by: kb <kim@simple.industries>
2026-01-26 06:42:36 +08:00
Yi Ming
8876413e2d feat(lsp): highlighting the symbol being renamed (#37390) 2026-01-23 11:02:56 -08:00
Christian Clason
647d3dc454 build(deps): bump luv to 1.51.0-2 2026-01-23 09:30:37 +01:00
Olivia Kinnear
c39d18ee93 fix(lsp): raise error when lsp config is invalid type (#37508) 2026-01-22 15:44:04 -08:00
Olivia Kinnear
34116bbd9b fix(lsp): fix nil-index error for :lsp enable (#37411)
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`.
2026-01-22 12:27:03 -08:00
zeertzjq
87276db7f9 vim-patch:9.1.2100: filetype: tiltfiles are not recognized (#37477)
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

ff0e5d994c

Co-authored-by: Luis Davim <luis.davim@gmail.com>
2026-01-21 07:34:51 +08:00
zeertzjq
e3990f8643 vim-patch:9.1.1202: Missing TabClosedPre autocommand
Problem:  Missing TabClosedPre autocommand
          (zoumi)
Solution: Add the TabClosedPre autcommand (Jim Zhou).

fixes: vim/vim#16518
closes: vim/vim#16855

5606ca5349

Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2026-01-20 06:23:11 +08:00