Commit Graph

4447 Commits

Author SHA1 Message Date
Tristan Knight
7c3df3e2ea fix(lsp): get_namespace signature (#38449)
Problem: Since the change to `pull_id` in #37938 we used the
deprecated signature internally

Solution: Don't
2026-03-23 15:42:47 -07:00
Gregory Anders
a728eb7af1 refactor(treesitter)!: remove "all" option of Query:iter_matches #33070
This option was introduced to help with transitioning to the new
behavior during the 0.11 release cycle with the intention of removing in
0.12.
2026-03-23 14:34:14 -04:00
glepnir
f2d0b06ecb fix(lsp): completion word includes leading space from label #38435
Problem: clangd prepends a space/bullet indicator to label. With
labelDetailsSupport enabled, the signature moves to labelDetails,
making label shorter. This flips the length comparison in
get_completion_word, causing it to use item.label directly and
insert the indicator into the buffer.

Solution: only prefer filterText over label when label starts with non-keyword
character in get_completion_word fallback branch.
2026-03-23 11:02:30 -04:00
Justin M. Keyes
3a3c6f0907 refactor: rename termcap.lua -> tty.lua #38437
Problem:
The `termcap.lua` module is too narrowly named. We may need a place for
tty-related functionality in the future.
https://github.com/neovim/neovim/pull/31399#discussion_r1882598297

Solution:
This isn't a public/documented interface, so just rename it.
2026-03-23 10:14:48 -04:00
skewb1k
9a5641b4b5 fix(lua): drop support for boolean buf in vim.keymap #38432
Problem:
`vim.keymap.*.Opts.buf` allows `boolean` aliases for more widely
used `integer?` values, `true` -> `0` and `false` -> `nil`. This
conversion is unnecessary and can be handled at call sites.

Solution:
As a follow-up to deprecating the `buffer` option, drop support for
boolean values for the new `buf` option. The deprecated `buffer`
continues to support booleans for backward compatibility.
2026-03-23 08:00:53 -04:00
glepnir
4ed597389c fix(lsp): snippet preview blocked completionItem/resolve request #38428
Problem: Generating snippet preview in get_doc() populated the
documentation field before resolve, so the resolve request was
never sent.

Solution: Move snippet preview logic into on_completechanged and
the resolve callback so it no longer blocks the resolve request.
2026-03-23 07:57:36 -04:00
Barrett Ruth
d6a6eed4f3 feat(lsp): attach to buftype=help buffers #38412
Problem: `vim.lsp.enable()` skips all buffers with non-empty `buftype`,
including `help` buffers. LSPs targeting `filetype='help'` never
auto-attach despite help buffers being real files.

Solution: Expand the `buftype` guard in `lsp_enable_callback` to allow
`help` alongside `""`.
2026-03-23 07:30:35 -04:00
Justin M. Keyes
59eadebe33 fix(runtime)!: move "tohtml" to pack/dist/opt/ #34557
Problem:
The "tohtml" plugin is loaded by default.

Solution:
- Move it to `pack/dist/opt/nvim.tohtml/`, it is an "opt-in" plugin now.
- Document guidelines.
- Also revert the `plugin/` locations of `spellfile.lua` and `net.lua`.
  That idea was not worth the trouble, it will be too much re-education
  for too little gain.
2026-03-23 06:41:00 -04:00
Maria Solano
471213ee61 revert: "feat(lsp): add buftypes field to vim.lsp.Config" #38421
revert: "feat(lsp): add `buftypes` field to `vim.lsp.Config` (#38380)"

This reverts commit cfcdbcf638.
2026-03-22 13:33:11 -04:00
Eisuke Kawashima
51aa64488d fix(provider): support python3.14 #38419
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-03-22 09:20:04 -04:00
Justin M. Keyes
256811a617 Merge #38410 from justinmk/fix-numbered-list-html 2026-03-21 21:13:26 -04:00
Justin M. Keyes
e12a9e7c4e docs: starting.txt new layout 2026-03-22 01:57:28 +01:00
Barrett Ruth
cfcdbcf638 feat(lsp): add buftypes field to vim.lsp.Config (#38380)
Problem: `vim.lsp.enable()` skips buffers with `buftype` set, even when
`filetype` matches.

Solution: Add `buftypes` field to `vim.lsp.Config`.
2026-03-21 17:09:01 -07:00
KrrishJain
0db8efcbe4 fix(lsp): restore virtual document color visibility (#38407)
Problem: Default swatch unicode character got lost.

Solution: Put it back where it belongs.

---------

Co-authored-by: vnadgaonkar-spec <vnadgaonkar@gmail.com>
Co-authored-by: Christian Clason <ch.clason+github@icloud.com>
2026-03-22 00:34:44 +01:00
glepnir
cc518cf9ba feat(lsp): support CompletionItem.labelDetails #38403
Problem: CompletionItem.labelDetails is ignored, losing
function signatures and module info in the completion menu.

Solution: Append labelDetails.detail to abbr and use
labelDetails.description for menu with fallback to item.detail.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemLabelDetails
2026-03-21 19:07:26 -04:00
skewb1k
4d3a67cd62 feat(lua): replace buffer with buf in vim.keymap.set/del #38360
The `buffer` option remains functional but is now undocumented.
Providing both will raise an error. Since providing `buf` was disallowed
before, there is no code that will break due to using `buffer` alongside
`buf`.
2026-03-21 12:00:06 -04:00
luukvbaal
fbac2e5edc feat(ui2): configure maximum window heights #38392
Problem:
- Window height is set dynamically to match the text height,
  making it difficult for the user to use a different height.
- Cmdwin is closed to enter the pager but still taken into
  account for the pager position, and not restored when
  the pager is closed.
- Dialog pager handler may unnecessarily consume <Esc>.

Solution:
- Add maximum height config fields for each of the UI2 windows,
  where a number smaller than one is a fraction of 'lines',
  absolute height otherwise (i.e. `cfg.msg.pager.height = 0.5`).
- If the cmdwin will be closed to enter the pager, don't try
  to position the pager above it. Re-enter the cmdwin when the
  pager is closed.
- Only add vim.on_key() handler for the dialog paging is actually
  possible.
2026-03-21 10:20:06 -04:00
Sergei Slipchenko
7a5e9ef0aa fix(lsp/diagnostic): use diagnostic provider identifier for code actions #38401
Problem:
f9b2189b28 started using namespaces
for pull diagnostics that look like this `<id>:<identifier>`.
`vim.lsp.buf.codeaction` passes `true` instead of an identifier
to `vim.lsp.diagnostic.get_namespace`, resulting in a namespace that
looks like `<id>:nil`. The end result is that none of the diagnostics are
passed to `textDocument/codeAction` request. Because of that server
might not send any code actions back. For example, eslint lsp responds
with an empty list of actions if it receives no diagnostics.

Solution:
use `_provider_foreach` to collect diagnostics from all `identifiers`
and use that identifier to get a namespace instead of `true`.
2026-03-21 09:38:11 -04:00
zeertzjq
0655a359ae vim-patch:9.2.0217: filetype: cto files are not recognized (#38400)
Problem:  filetype: cto files are not recognized
Solution: Detect *.cto as concerto filetype (Jamie Shorten)

Add filetype detection for the Concerto Modelling Language. Concerto
is a schema language by the Accord Project for defining data models
used in smart legal contracts and business networks.

Reference:
Language spec: https://concerto.accordproject.org
Tree-sitter grammar: https://github.com/accordproject/concerto-tree-sitter

closes: vim/vim#19760

68f9dedba4

Co-authored-by: Jamie Shorten <jamie@jamieshorten.com>
2026-03-21 08:50:15 +08:00
Justin M. Keyes
e3a1e47bb2 docs: misc 2026-03-20 23:30:09 +01:00
Evgeni Chasnovski
3d37aa3116 fix(pack): account for Git's "insteadOf" in :checkhealth #38393
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.
2026-03-20 17:40:45 -04:00
Mathias Fussenegger
507cd63418 fix(lsp): handle completion/resolve response arriving after on_insert_leave
If a user accepts completion and immediately exits insert mode, it
could happen that `Context.cursor` was nil by the time the
`completion/resolve` response arrives, leading to an error.
2026-03-20 17:20:08 +01:00
Shadman
24684f90ea feat(progress): status api, 'statusline' integration #35428
Problem:
Default statusline doesn't show progress status.

Solution:
- Provide `vim.ui.progress_status()`.
- Include it in the default 'statusline'.

How it works:
Status text summarizes "running" progress messages.
 - If none: returns empty string
 - If one running item: "title:  percent%"
 - If multiple running items: "Progress: N items avg-percent%"
2026-03-20 07:18:20 -04:00
Justin M. Keyes
f9b2189b28 Merge #38047 _provider_foreach 2026-03-20 05:11:27 -04:00
Yochem van Rosmalen
72a63346d8 feat(stdlib): vim.fs.ext() returns file extension #36997
Problem:
Checking the extension of a file is done often, e.g. in Nvim's codebase
for differentiating Lua and Vimscript files in the runtime. The current
way to do this in Lua is (1) a Lua pattern match, which has pitfalls
such as not considering filenames starting with a dot, or (2)
fnamemodify() which is both hard to discover and hard to use / read if
not very familiar with the possible modifiers.

vim.fs.ext() returns the file extension including the leading dot of
the extension. Similar to the "file extension" implementation of many
other stdlibs (including fnamemodify(file, ":e")), a leading dot
doesn't indicate the start of the extension. E.g.: the .git folder in a
repository doesn't have the extension .git, but it simply has no
extension, similar to a folder named git or any other filename without
dot(s).
2026-03-20 05:08:00 -04:00
Yi Ming
29c6176f08 fix(lsp): unify LSP error logging prefixes #38354
Problem
The format of LSP log messages is inconsistent; some include underscores, while others are not logged at all.

Solution
Standardize log recording and unify the log message prefixes with the module names.
2026-03-20 04:51:36 -04:00
Tristan Knight
a8ffa6e323 fix(lsp): guard dynamic capability attachment #38382
Problem:
The capability attach path for client/registerCapability can initialize a capability even when the capability was only registered in specific buffers

Solution:
Check supports_method() before attaching capabilities from the dynamic registration handler so unsupported registrations are ignored.

AI-assisted: OpenCode
2026-03-20 04:48:19 -04:00
zeertzjq
a18d51a958 vim-patch:9.2.0204: filetype: cps files are not recognized
Problem:  filetype: cps files are not recognized
Solution: Detect *.cps files as json filetype (Guillaume Barbier).

Reference:
https://github.com/cps-org/cps
https://cps-org.github.io/cps/

closes: vim/vim#19758

53884ba7a8

Co-authored-by: Guillaume Barbier <barbier.guillaume60@gmail.com>
2026-03-20 08:17:18 +08:00
zeertzjq
e2c3106b85 vim-patch:9.2.0201: filetype: Wireguard config files not recognized
Problem:  filetype: Wireguard config files not recognized
Solution: Detect /etc/wireguard/*.conf files as dosini filetype
          (Furkan Sahin).

closes: vim/vim#19751

cc8798e719

Co-authored-by: Furkan Sahin <furkan-dev@proton.me>
2026-03-20 08:17:18 +08:00
tris203
1f558f8d09 fix(lsp): improve diagnostics handling and comments
- Add TODO comments for aggregating diagnostics from all pull namespaces
  and for clearing diagnostics when an empty array is received, referencing
  the LSP specification.
- Update diagnostics refresh logic to safely access previousResultId,
  preventing potential nil errors.
2026-03-19 20:02:26 +00:00
tris203
0cda018345 fix(lsp/diagnostic): key resultId by client and identifier
Previously, resultId for diagnostics was keyed only by client_id, which
could cause issues when multiple identifiers are used by the same client.
This change introduces a composite key of client_id and identifier for
client_result_id, ensuring correct tracking of diagnostic results per
identifier. Updates all relevant logic to use the new keying scheme.
2026-03-19 17:51:21 +00:00
tris203
95dce376f3 fix(lsp): handle providers without subcapabilities
Previously, the LSP client assumed all providers had subcapabilities,
which could cause issues when a provider did not. This change adds a
check for the presence of subcapabilities before attempting to access
them, ensuring correct handling of both cases. This improves
compatibility with servers that register providers without additional
capabilities.
2026-03-19 17:51:21 +00:00
tris203
6a49a277f5 fix(lsp): request diagnostics from all registrations
Update diagnostic refresh to request diagnostics from all provider
registrations using _provider_foreach. This ensures diagnostics are
fetched from every registered provider during a refresh.

Co-authored-by: ZieMcd <ziemcd@gmail.com>
2026-03-19 17:51:21 +00:00
tris203
c8d9ade16a refactor(lsp): replace _provider_value_get with _provider_foreach
Introduce _provider_foreach to iterate over all matching provider
capabilities for a given LSP method, handling both static and dynamic
registrations. Update diagnostic logic and tests to use the new
iteration approach, simplifying capability access and improving
consistency across features.
2026-03-19 17:51:21 +00:00
Yi Ming
06befe1e34 feat(defaults): map "grx" to vim.lsp.codelens.run() #37689
Problem
Unlike inlay hints, code lenses are closely related to running commands;
a significant number of code lenses are used to execute a command (such
as running tests). Therefore, it is necessary to provide a default
mapping for them.

Solution
Add a new default mapping "grx" (mnemonic: "eXecute", like "gx").
2026-03-19 13:47:52 -04:00
glepnir
531442ddd8 fix(ui): apply 'pumborder' to mouse menu, fix overflow #36193
Problem:
Mouse popup menus (right-click context menus) do not respect the
'pumborder' option and could overflow screen boundaries when borders
were enabled near the edge.

Solution:
- Remove the mouse menu exclusion from border rendering.
- Add boundary check to shift menu left when border would exceed screen
  width, ensuring complete visibility of menu content and borders.
2026-03-19 13:11:35 -04:00
mpal9000
4b0700c618 fix(lsp): vim.Range check in document_color.color_presentation() (#38374)
Problem:
`vim.lsp.document_color.color_presentation()` throws, due to incorrect use of the `vim.Range` API.

Solution:
Change `vim.Range.has(a, b)` call to `a:has(b)`.
2026-03-19 10:00:45 -07:00
Luuk van Baal
e58a842749 fix(ui2): wrong condition used to detect active pager
Problem:  Entering the pager is scheduled to avoid errors while in the
          cmdwin. Meanwhile the current window is used as a condition to
          detect an active pager.
Solution: Keep track of when the user is in the pager (or entered the
          cmdwin while the pager was open).
2026-03-19 16:38:57 +01:00
Luuk van Baal
dff3028fe7 fix(ui2): move windows to current tabpage
Problem:  Windows are closed and re-opened after changing tabpage (and
          might be removed from the current tabpage after 094b297a).
Solution: Ensure windows are on the current tabpage by moving them.
2026-03-19 16:38:44 +01:00
Olivia Kinnear
e406c4efd6 feat(lsp): vim.lsp.get_configs() #37237
Problem:
No way to iterate configs. Users need to reach
for `vim.lsp.config._configs`, an internal interface.

Solution:
Provide vim.lsp.get_configs().
Also indirectly improves :lsp enable/disable completion
by discarding invalid configs from completion.
2026-03-19 07:33:34 -04:00
Maria Solano
4430c9a424 feat(lsp): migrate document_color to capability framework (#38344)
* feat(lsp): migrate `document_color` to capability framework

* feat(lsp): use `vim.Range` in `document_color` module
2026-03-18 17:18:48 -07:00
Juan Pablo Briones
f4f1149292 fix(options): vim.opt fails for 'fillchars' #37141
Problem:
When `to_vim_value[info.metatype](info, value)` is called, a list value
such as `{'eob:a'}` is treated like a map, which generates `1:eob:a`.

Note: commands like `:lua vim.opt.wildmode={'longest:full'}` are not an
issue because only cases harcoded in `key_value_options` have metatype `map`.

Solution:
Check for array type and use the same logic as in array metatypes.
2026-03-18 19:19:47 -04:00
Justin M. Keyes
286b78de9b docs: misc, terminal
Close #38319
Close #38348

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Barrett Ruth <br.barrettruth@gmail.com>
2026-03-18 20:40:20 +01:00
Yi Ming
addd408b39 fix(lsp): redraw codelens after request completed #38352
Problem:
When code lens is enabled, `on_attach` is executed, but it does not trigger a redraw. Another event, eg, moving the cursor, is required to trigger a redraw and execute the decoration provider's `on_win`.

Solution:
Trigger a `redraw` after each request is completed.
2026-03-18 11:02:46 -04:00
Ayaan
63642ebf80 refactor(terminal): impl "[Process exited]" in Lua #38343
Problem:
"[Process exited]" is implemented in C with anonymous namespace
and users have no way to hide it.

Solution:
- Handle "TermClose" event in Lua.
- User can delete the "nvim.terminal" augroup to avoid "[Process exited]".
2026-03-18 07:54:41 -04:00
Justin M. Keyes
02ce446510 docs: api, lsp, messages, intro #38327 2026-03-17 17:02:15 -04:00
glepnir
0da9827673 fix(lsp): respect documentation markup kind in completion preview #38338
Problem:
Completion preview always assumes plain text, ignoring LSP documentation "kind".

Solution:
Pass markup kind from completion item to info window, or fallback to PlainText.
2026-03-17 10:24:30 -04:00
Harsh Kapse
a5b8cf145d feat(diff): merge adjacent blocks using inline:word (#37085)
vim-patch:9.2.0174: diff: inline word-diffs can be fragmented

Problem:  When using 'diffopt=inline:word', lines were excessively
          fragmented with punctuation creating separate highlight
          blocks, making it harder to read the diffs.
Solution: Added 'diff_refine_inline_word_highlight()' to merge
          adjacent diff blocks that are separated by small gaps of
          non-word characters (up to 5 bytes by default) (HarshK97).

When using inline:word diff mode, adjacent changed words separated by
punctuation or whitespace are now merged into a single highlight block
if the gap between them contains fewer than 5 non-word characters.

This creates more readable diffs and closely matches GitHub's own diff
display.

closes: vim/vim#19098

42c6686c78
2026-03-17 12:11:55 +00:00
TomIO
6edae88052 feat(vimscript): scripts can detect 'android', 'termux' #38218
Problem:
The 'android' and 'termux' feature flags have been shipped in the
downstream neovim/neovim-nightly package for 5+ years but were never
properly documented in the downstream patch.

Solution:
Upstream the 'android' and 'termux' feature flags into Neovim as
decoupled feature flags, this enables the 'android' feature in
particular to be available independently of the 'termux' feature
for builds of Neovim against the Android NDK, but not including
the Termux NDK patchset.

Co-authored-by: Lethal Lisa <43791059+lethal-lisa@users.noreply.github.com>
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
2026-03-16 19:12:12 -04:00
Shadman
7b7e8cc724 feat(progress): disable cmdline progress msg via messagesopt' #36730
Problem:
No way to disable progress messages in cmdline message area. If
a third-party plugin handles Progress events + messages, the user may
not want the "redundant" progress displayed in the cmdline message area.

Solution:
Support "progress:c" entry in 'messageopts' option.
2026-03-16 11:29:47 -04:00