aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* fix(lsp): only auto-detach lsp.config clients #33834glepnir2025-05-04
| | | | | | | | Problem: enable() routine detaches clients even if they were manually started and not managed by vim.lsp.config. Solution: Skip clients that aren't managed by vim.lsp.config.
* fix(extui): hide inactive "more" window (#33831)luukvbaal2025-05-04
| | | | | Problem: More-window is left visible after leaving it. Cursor may be hidden behind it and it is hard to re-enter afterwards. Solution: Close the more-window when another window is entered.
* fix(treesitter): invalidate conceal_lines marks #33828luukvbaal2025-05-03
| | | | | | Problem: Spliced conceal_lines marks after changing the buffer text are left valid, concealing lines that shouldn't be. Solution: Set the `invalidate` extmark property.
* feat(lsp): detach LSP clients when 'filetype' changes #33707Jeremy Fleischman2025-05-03
| | | | | | | | | | | Problem: When the buffer 'filetype' changes, invalid or non-applicable LSP clients are not detached. https://github.com/neovim/neovim/issues/33443 https://github.com/neovim/nvim-lspconfig/issues/3326 Solution: In the enable() routine, check can_start() on _existing_ clients.
* feat(lua): function `behavior` for tbl_extend, tbl_deep_extend #33819Maria José Solano2025-05-03
|
* fix(extui): search highlighting in extui "more" pager #33792luukvbaal2025-05-03
| | | | Problem: No search highlighting in extui "more" pager window. Solution: Only use custom highlight namespace in cmdline window.
* docs(lua): typing for vim.fn.winlayout #33817PRIZ ;]2025-05-03
| | | | | | | | | | | | | | | Problem: `any[]` means nothing, and the return value is not the same as what's documented in the comment (eg, Lua returns `{ "row", { { "leaf", 1000 }, { "leaf", 1001 } } }`, not `{ "row", { "leaf", 1000, "leaf", 1001 } }`) Solution: Create two classes (vim.fn.winlayout.leaf and vim.fn.winlayout.branch) and one alias that links the two together. Also: Due to LuaLS limitations, there is an empty class, vim.fn.winlayout.empty Signed-Off-By: VoxelPrismatic <voxelprismatic@pm.me>
* feat(lsp): vim.lsp.is_enabled() #33703Jeremy Fleischman2025-05-03
| | | | | | | | | Problem: No way to check if a LSP config is enabled without causing it to resolve. E.g. `vim.lsp.config['…'] ~= nil` will resolve the config, which could be an unwanted and somewhat expensive side-effect. Solution: Introduce `vim.lsp.is_enabled()`.
* fix(runtime): conceal paths in help, man ToC loclist #33764Michele Campeotto2025-05-03
| | | | | | | | | | | | | | | | | Problem: The check for concealing paths in TOCs in the qf syntax file fails because the TOC tile has changed. Solution: Force the qf syntax file to be reloaded after the qf_toc variable has been set, so that the it can apply the correct settings. Using the explicit qf_toc key, already used in the syntax file, instead of the title is less prone to breaking. It was also already being set for man pages but it had no effect because the syntax file had already been loaded when the variable was set. Fixes #33733
* fix(lsp): improper diagnostic end_col computationRiley Bruins2025-05-03
| | | | | | | | **Problem:** For multiline diagnostics, the end column was improperly calculated by checking the byte index of the character position on the *start* line. **Solution:** Calculate the byte index for end_col using the *end* line.
* fix(treesitter): close `:InspectTree` with `q`Christian Clason2025-05-02
| | | | | | | Problem: `:InspectTree` window does not follow precedent for focused "info windows" (like `checkhealth`, `Man`, etc.). Solution: Map `q` to `<C-w>c`.
* fix(lsp): use `bufnr` when getting clients in `symbols_to_items` (#33760)Maria José Solano2025-05-02
|
* fix(extui): cmdline visibility, cmdheight cursor position (#33774)luukvbaal2025-05-02
| | | | | | | | | Problem: The cmdline popupmenu is hidden behind extui windows. 'showmode' message is drawn over the cmdline. Changing the 'cmdheight' to accommodate space for the text in the cmdline may change the current cursor position. Solution: Ensure kZIndexMessages < zindex < kZIndexCmdlinePopupMenu. Clear the 'showmode' message when the cmdline level is negative. Temporarily set 'splitkeep' = "screen" when changing the 'cmdheight'.
* fix(extui): close message window with `q`Christian Clason2025-05-02
| | | | | | | Problem: Using `<c-c>` does not follow precedent (from `checkhealth` etc.) for closing "information windows". Solution: Use `q` for close mapping.
* vim-patch:9.1.1360: filetype: GNU Radio companion files are not recognizedzeertzjq2025-05-02
| | | | | | | | | | | | | | Problem: filetype: GNU Radio companion files are not recognized Solution: detect *.grc files as xml or yaml filetype depending on the first line (zeertzjq). Ref: - https://wiki.gnuradio.org/index.php/XML_GRC - https://wiki.gnuradio.org/index.php/YAML_GRC closes: vim/vim#17241 https://github.com/vim/vim/commit/af4a5d6e2ae57a44edab48c8b012d2afa743998f
* vim-patch:9.1.1359: filetype: GNU Radio config files are not recognizedzeertzjq2025-05-02
| | | | | | | | | | | | | Problem: filetype: GNU Radio config files are not recognized. Solution: detect GNU Radio config files as confini filetype. Only allow '#' as start of comment in confini syntax (zeertzjq). Ref: - https://wiki.gnuradio.org/index.php/Configuration_Files closes: vim/vim#17242 https://github.com/vim/vim/commit/9c9200d1eafe50077222a38bfad6cba7156a6487
* fix(extui): check option values after VimEnter (#33768)luukvbaal2025-05-02
| | | | | | Problem: Not picking up configured option values when enabling _extui after startup. Solution: Check option values when enabing _extui. Fix https://github.com/neovim/neovim/issues/33767
* fix(vim.lsp.enable): don't eagerly enable LSP configs during startup #33762Phạm Bình An2025-05-02
| | | closes #33761
* feat(ui): ext_cmdline/messages for the TUI #27855luukvbaal2025-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: We have an unmaintained Vimscript parser and cmdline highlighting mechanism, with which it is hard to leverage the treesitter highlighter. Long messages result in a hit-enter-prompt. Solution: Implement a vim.ui_attach() UI, that replaces the message grid (orphaning some 3000+ LOC core C code). Introduce an experimental vim._extui module, because removing the message grid at the same time is too risky. The new UI leverages the bundled treesitter highlighter and parser for Vimscript, as well as the matchparen plugin, to highlight the cmdline. Messages are truncated in the cmdline area, or placed in a floating message box in the bottom right corner. Special ("list_cmd") messages and the message history are shown in a, "more prompt" (now a fully interactive regular window). Various default UI elements ('showcmd', 'ruler') are also placed in the cmdline area, as virtual text. `require('vim._extui').enable({})` enables the experimental UI. `{ msg.pos = 'box' }` or `:set cmdheight=0` enables the message box variant. Followup: - Come to a consensus for how best to represent messages (by default). - Start removing message grid when this is deemed a successful replacement. When that is finished, make this new UI the default and update a lot of tests.
* fix(lsp): handle `nil` buffer state in `documentColor` clear (#33746)Maria José Solano2025-05-01
|
* fix(diagnostic): allow virtual_{lines,text} cursor exclusivity #33517Michael Clayton2025-05-01
| | | | | | | | | | | | | | | | | | | | Problem: virtual_text diagnostics are great when skimming a file, and virtual_lines are great when "zooming in" on a particular problem. Having both enabled results in duplicate diagnostics on-screen. Solution: This PR expands the behavior of `current_line` for virtual_text and virtual_lines by making `virtual_text.current_line = false` distinct from `nil`. If you set: vim.diagnostic.config({ virtual_text = { current_line = false }, virtual_lines = { current_line = true }, }) With this configuration, virtual_text will be used to display diagnostics until the cursor reaches the same line, at which point they will be hidden and virtual_lines will take its place.
* Merge pull request #33738 from zeertzjq/vim-fa8b7dbzeertzjq2025-05-01
|\ | | | | vim-patch: doc updates
| * vim-patch:fb08192: runtime(doc): clarify the use of 'tagfunc', update a ↵zeertzjq2025-05-01
| | | | | | | | | | | | | | | | | | | | comment in tags.c related: vim/vim#17228 https://github.com/vim/vim/commit/fb08192ca75344d6467f9e7f9b9e6d4509df308a Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:partial:fa8b7db: runtime(doc): tweak documentation style in ↵zeertzjq2025-05-01
| | | | | | | | | | | | | | | | | | | | options.txt closes: vim/vim#17229 https://github.com/vim/vim/commit/fa8b7db99afad9074e4e1f89b49046836ac61d5b Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* | feat(lsp): start/stop LSPs as necessary during vim.lsp.enable() #33702Jeremy Fleischman2025-04-30
|/ | | | | | | | | | Problem: enable() could be more flexible, so that it works even if called "late". Solution: - enable(true) calls `doautoall nvim.lsp.enable FileType`. - enable(false) calls `client:stop()` on matching clients. This will be useful for e.g. :LspStop/:LspStart also.
* feat(terminal): parse current buffer contents in nvim_open_term() (#33720)Gregory Anders2025-04-30
| | | | When nvim_open_term() is called with a non-empty buffer, the buffer contents are piped into the PTY.
* feat(lsp): `root_markers` can control priority #33485Lorenzo Bellina2025-04-30
| | | | | | | | | | | | | | | | | | Problem: root_markers cannot specify "equal priority filenames. Solution: Support nesting: { ... root_markers = { { ".stylua.toml", ".luarc.json" }, { ".git "} } ... } Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Gregory Anders <github@gpanders.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(trust): support for trusting directories #33617Jeremy Fleischman2025-04-30
| | | | | | | | | | | | | | | | | | | | | Problem: Directories that are "trusted" by `vim.secure.read()`, are not detectable later (they will prompt again). https://github.com/neovim/neovim/discussions/33587#discussioncomment-12925887 Solution: `vim.secure.read()` returns `true` if the user trusts a directory. Also fix other bugs: - If `f:read('*a')` returns `nil`, we treat that as a successful read of the file, and hash it. `f:read` returns `nil` for directories, but it's also documented as returning `nil` "if it cannot read data with the specified format". I reworked the implementation so we explicitly treat directories differently. Rather than hashing `nil` to put in the trust database, we now put "directory" in there explicitly*. - `vim.secure.trust` (used by `:trust`) didn't actually work for directories, as it would blindly read the contents of a netrw buffer and hash it. Now it uses the same codepath as `vim.secure.read`, and as a result, works correctly for directories.
* feat(ui): use builtin completion popupmenu with ext_cmdline (#31269)luukvbaal2025-04-29
| | | | | | | | Problem: UIs implementing ext_cmdline/message must also implement ext_popupmenu in order to get cmdline completion with wildoptions+=pum. Solution: Allow marking a window as the ext_cmdline window through nvim_open_win(), including prompt offset. Anchor the cmdline- completion popupmenu to this window.
* Merge pull request #33667 from glepnir/vim-9.1.1341zeertzjq2025-04-29
|\ | | | | vim-patch: 9.1.{1341,1344}
| * vim-patch:ffc89e4 runtime(doc): clarify complete_match() and 'isexpand' optionglepnir2025-04-29
| | | | | | | | | | | | | | | | | | | | clarify complete_match() documentation to better explain its backward search behavior, argument handling, and return value format and add an example of isexpand closes: https://github.com/vim/vim/pull/17212 https://github.com/vim/vim/commit/ffc89e47d014178bcd0a681ff2c8e18470cc972b
| * vim-patch:9.1.1341: cannot define completion triggersglepnir2025-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot define completion triggers and act upon it Solution: add the new option 'isexpand' and add the complete_match() function to return the completion matches according to the 'isexpand' setting (glepnir) Currently, completion trigger position is determined solely by the 'iskeyword' pattern (\k\+$), which causes issues when users need different completion behaviors - such as triggering after '/' for comments or '.' for methods. Modifying 'iskeyword' to include these characters has undesirable side effects on other Vim functionality that relies on keyword definitions. Introduce a new buffer-local option 'isexpand' that allows specifying different completion triggers and add the complete_match() function that finds the appropriate start column for completion based on these triggers, scanning backwards from cursor position. This separation of concerns allows customized completion behavior without affecting iskeyword-dependent features. The option's buffer-local nature enables per-filetype completion triggers. closes: vim/vim#16716 https://github.com/vim/vim/commit/bcd5995b40a1c26e735bc326feb2e3ac4b05426b Co-authored-by: glepnir <glephunter@gmail.com>
* | Merge #33542 shada improvementsJustin M. Keyes2025-04-27
|\ \ | | | | | | | | | | | | | | | * feat(shada): don't store jumplist if '0 in 'shada' * fix(shada): don't store search and sub patterns if /0 in 'shada' * fix(shada): don't store empty replacement string * fix(shada): don't add '0' mark if f0 in 'shada'
| * | feat(shada): don't store jumplist if '0 in 'shada'Andre Toerien2025-04-27
| | |
* | | docs: lsp, lua #33682Justin M. Keyes2025-04-27
| | | | | | | | | | | | | | | | | | - sort fields alphabetically. - in the `vim.lsp.Client` docs, reference `vim.lsp.ClientConfig` instead of duplicating its docs. - cleanup lots of redundant-yet-drifted field docs.
* | | docs: lsp, emoji, startup #33446Justin M. Keyes2025-04-27
| | | | | | | | | Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* | | fix(lsp): fallback to empty `capability_path` in `supports_registration`Maria José Solano2025-04-27
| | |
* | | fix(lsp): remove unused `ns` fieldMaria José Solano2025-04-27
| | |
* | | feat(checkhealth): trigger FileType event after showing report #33677Justin M. Keyes2025-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `FileType` event is fired before checkhealth report is finished, so user can't override report settings or contents. https://github.com/neovim/neovim/pull/33172#issuecomment-2833513916 Solution: - Trigger FileType event later. - Document how to remove emojis.
* | | fix(lsp): properly handle `documentColor` from multiple servers #33656Maria José Solano2025-04-27
| | |
* | | fix(lsp): access correct client capability path in `supports_registration`Maria José Solano2025-04-26
| | |
* | | feat(lsp): generate method to client capability mapMaria José Solano2025-04-26
|/ /
* | fix(health): checkhealth float opens extra empty buffer #33648Andre Toerien2025-04-26
| |
* | perf(lsp): include `previousResultId` in `DocumentDiagnosticParams` #32887Yi Ming2025-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Users of the Roslyn (C#) LSP have encountered significant delays when retrieving pull diagnostics in large documents while using Neovim. For instance, diagnostics in a 2000-line .cs file can take over 20 seconds to display after edits in Neovim, whereas in VS Code, diagnostics for the same file are displayed almost instantly. As [mparq noted](https://github.com/seblj/roslyn.nvim/issues/93#issuecomment-2508940330) in https://github.com/seblj/roslyn.nvim/issues/93, VS Code leverages additional parameters specified in the [LSP documentation for textDocument/diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#documentDiagnosticParams), specifically: - previousResultId - identifier Solution: When requesting diagnostics, Neovim should include the `previousResultId` and `identifier` parameters as part of the request. These parameters enable the server to utilize caching and return incremental results. Support for maintaining state is already present in the [textDocument/semanticTokens implementation](https://github.com/neovim/neovim/blob/8f84167c30692555d3332565605e8a625aebc43c/runtime/lua/vim/lsp/semantic_tokens.lua#L289). A similar mechanism can be implemented in `textDocument/diagnostic` handler.
* | fix(lsp): detect if Client:request resolved synchronously #33624Bartłomiej Maryńczak2025-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: In cases when the (in-process) LSP server responds to the request immediately and calls `notify_reply_callback` the request will still be marked as pending, because the code assumes that the response will occur asynchronously. Then the request will be pending forever, because it was already set as "completed" before we even set it as "pending". A workaround is to wrap `notify_replay_callback` in `vim.shedule` ([like so](https://github.com/neovim/neovim/pull/24338#issuecomment-2809568617)] but that seems counterintuitive. Solution: Handle this case in Client:request().
* | fix(lsp): cycling signatures with the default `config.focusable`Yi Ming2025-04-26
| |
* | fix(lsp): prioritize showing active signatureYi Ming2025-04-26
| |
* | vim-patch:9.1.1343: filetype: IPython files are not recognizedChristian Clason2025-04-25
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: IPython files are not recognized (user202729) Solution: detect *.ipy files as python filetype fixes: vim/vim#17163 https://github.com/vim/vim/commit/e380b5cbba23869b07e17cfc7f4602e2fe681945 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | fix(docs) fix syntax error in Lua snippet for `vim.lsp.document_color` #33612Stephan Seitz2025-04-24
| | | | | | | | 9ff1239634 added support for 'textDocument/documentColor' but the text snippet in the Lua docs seem to contain a syntax error.
* | fix(lsp): don't create an `'LspAttach'` `document_color` autocommandMaria José Solano2025-04-24
| |