aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(lsp): unify get_completion_word for textEdits/insertTextMathias Fussenegger2025-02-22
| | | | | | | | | | | | | | Problem: After https://github.com/neovim/neovim/pull/32377 selecting snippets provided by luals inserted the multi-line text before accepting the candidates. That's inconsistent with servers who provide `textEdit` instead of `insertText` and having lines shift up/down while cycling through the completion candidates is a bit irritating. Solution: Use the logic used for `textEdit` snippets also for `insertText`
* perf(treesitter): don't block when finding injection rangesRiley Bruins2025-02-21
| | | | | | | | | | | **Problem:** Currently, parsing is asynchronous, but it involves a (sometimes lengthy) step which finds all injection ranges for a tree by iterating over that language's injection queries. This causes edits in large files to be extremely slow, and also causes a long stutter during the initial parse of a large file. **Solution:** Break up the injection query iteration over multiple event loop iterations.
* fix(treesitter): `TSNode:field()` returns all children with the given fieldRiley Bruins2025-02-21
|
* perf(treesitter): only search for injections within the parse rangeRiley Bruins2025-02-21
| | | | Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
* feat(marks): virtual lines support horizontal scrolling (#32497)zeertzjq2025-02-20
| | | | Add a new field `virt_lines_overflow` that enables horizontal scrolling for virtual lines when set to "scroll".
* vim-patch:c729d6d: runtime: decouple Open and Launch commands and gx mapping ↵Luca Saccarola2025-02-20
| | | | | | | | from netrw (#32506) closes: vim/vim#16494 fixes: #vim/vim#16486 https://github.com/vim/vim/commit/c729d6d154e097b439ff264b9736604824f4a5f4
* fix(treesitter): don't spam query errors in the highlighterRiley Bruins2025-02-19
| | | | | | | | **Problem:** An erroneous query in the treesitter highlighter gives a deluge of errors that makes the editor almost unusable. **Solution:** Detach the highlighter after an error is detected, so that it only gets displayed once (per highlighter instance).
* fix(treesitter): avoid computing fold levels for empty bufferLuuk van Baal2025-02-19
| | | | | | | | Problem: Computing fold levels for an empty buffer (somehow) breaks the parser state, resulting in a broken highlighter and foldexpr. Cached foldexpr parser is invalid after filetype has changed. Solution: Avoid computing fold levels for empty buffer. Clear cached foldinfos upon `FileType`.
* fix(treesitter)!: enforce buffer is loaded when creating parserLuuk van Baal2025-02-19
| | | | | | | Problem: `vim.treesitter._create_parser()` silently loads the buffer, bypassing the swapfile prompt. Solution: Error for an unloaded buffer, ensure buffer is loaded in `vim.treesitter.start()` instead.
* vim-patch:5647c91: runtime(doc): add reference to extendnew() at extend() ↵zeertzjq2025-02-17
| | | | | | | | | (#32500) related: vim/vim#16607 https://github.com/vim/vim/commit/5647c91355f1ff3a1030c737bf5133bb7da5bb76 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(treesitter): separately track the number of valid regionsRiley Bruins2025-02-17
| | | | | | We need to add a separate variable to keep track of this information, since we cannot read the length of the valid regions table itself, since it has holes.
* docs: misc (#32258)dundargoc2025-02-17
| | | | | Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Julian Visser <12615757+justmejulian@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* docs: stdpath() type #32480phanium2025-02-16
|
* fix(diagnostic): don't include diagnostic code when using custom formatter ↵Maria José Solano2025-02-16
| | | | #32464
* fix(docs): update context type in `vim.lsp.LocationOpts.OnList`Maria José Solano2025-02-16
|
* feat(lsp): add support for completionItem.command resolvingMathias Fussenegger2025-02-14
| | | | | | | | `command` was already resolved via a `completionItem/resolve` request but only if `additionalTextEdits` were also present, and the `resolveSupport` capability wasn't listed. Closes https://github.com/neovim/neovim/issues/32406
* feat(term): trigger TermRequest for APC (#32407)Till Bungert2025-02-13
| | | | Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(lsp): add select kind in showMessageRequest #32387Maria José Solano2025-02-13
|
* Merge #32426 fix(lsp): reset active request when reporting an errorJustin M. Keyes2025-02-13
|\
| * refactor(lsp): handling errors and nil responses togetherYi Ming2025-02-13
| |
| * fix(lsp): reset active request when reporting an errorYi Ming2025-02-13
| |
| * fix(lsp): missing method parameter when canceling requestsYi Ming2025-02-13
| |
* | fix(lsp): clear word when expand multi-lines word (#32393)glepnir2025-02-13
| | | | | | | | | | Problem: When expanding a completion item that contains a multi-line word, the word is not deleted correctly. Solution: If the word contains a line break, delete the text from Context.cursor to the current cursor position.
* | fix(lsp): autotrigger should only trigger on client's triggerCharacters (#32266)Robert Muir2025-02-13
|/ | | | | | | | | | | | Problem: autotrigger option of vim.lsp.completion.enable() would trigger all clients, as long as it matched at least one client's triggerCharacters. Solution: trigger only the clients with triggerCharacters matching the character. overtriggering still happens if any client returns isIncomplete=true (this case is more involved). Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* fix(lsp): on detach, cancel pending foldingRange requests #31509Yi Ming2025-02-12
| | | | | | | | | | | | | | | | | | | Problem: 1. Open a relatively large file (so the server needs some time to process the request). 2. Then immediately execute `:bdelete`. 3. Once the request is completed, the handler will obtain the bufstate of a buffer already unloaded. Error executing vim.schedule lua callback: ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: assertion failed! stack traceback: [C]: in function 'assert' ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:119: in function 'multi_handler' ...7841_1/share/nvim/runtime/lua/vim/lsp/_folding_range.lua:140: in function 'handler' ...HEAD-c137841_1/share/nvim/runtime/lua/vim/lsp/client.lua:669: in function '' vim/_editor.lua: in function <vim/_editor.lua:0> Solution: On detach, cancel all pending textDocument_foldingRange requests.
* feat(options): add 'eventignorewin' (#32152)luukvbaal2025-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:partial:9.1.1084: Unable to persistently ignore events in a window and its buffers Problem: Unable to persistently ignore events in a window and its buffers. Solution: Add 'eventignorewin' option to ignore events in a window and buffer (Luuk van Baal) Add the window-local 'eventignorewin' option that is analogous to 'eventignore', but applies to a certain window and its buffers. Identify events that should be allowed in 'eventignorewin', adapt "auto_event" and "event_tab" to encode this information. Window context is not passed onto apply_autocmds_group(), and when to ignore an event is a bit ambiguous when "buf" is not "curbuf", rather than a large refactor, only ignore an event when all windows into "buf" are ignoring the event. https://github.com/vim/vim/commit/b7147f8236c962cd74d1ce028d9106f1c449ea6c vim-patch:9.1.1102: tests: Test_WinScrolled_Resized_eiw() uses wrong filename Problem: tests: Test_WinScrolled_Resized_eiw() uses wrong filename (Luuk van Baal, after v9.1.1084) Solution: Rename the filename to something more unique https://github.com/vim/vim/commit/bfc7719e48ffc365ee0a1bd1888120d26b6365f0
* Merge #30860 LSP: symbols_to_items()Justin M. Keyes2025-02-11
|\
| * feat(lsp)!: `symbol_to_item` requires `offset_encoding`Yi Ming2025-02-11
| |
| * feat(lsp): include `end_col` and `end_lnum` in `vim.lsp.buf.symbols_to_items`Yi Ming2025-02-11
| |
* | fix(treesitter): detect trees with outdated regions in `is_valid()`Riley Bruins2025-02-11
|/
* refactor(defaults): cleanup enable_ctx_menu #32391Siddhant Agarwal2025-02-10
| | | The ctx parameter is not needed since various refactors.
* build: set luals checklevel to Hint #32392Lewis Russell2025-02-10
|
* fix(defaults): improve visual search mappings #32378neeshy2025-02-09
| | | | | | | | | | | | | | | | | | Problem: The behavior of the visual search mappings aren't consistent with their normal mode counterparts. - The count isn't considered - Searching with an empty selection will match every character in the buffer - Searching backwards only jumps back when the cursor is positioned at the start of the selection. Solution: - Issue `n` `v:count1` times - Error out and exit visual mode when the selection is empty - Detect when the cursor is not at the start of the selection, and adjust the count accordingly Also, use the search register instead of the more error-prone approach of feeding the entire search string as an expression
* feat(defaults): "Show Diagnostics" in mouse popupmenu #32122Siddhant Agarwal2025-02-09
| | | | | | | Problem: No obvious way to see diagnostics without configuring it first. Solution: Add `Show Diagnostics`, `Show All Diagnostics` and `Configure Diagnostics` buttons to the context menu.
* fix(lsp): signature_help highlights wrong parameter #32382Shantanu Raj2025-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: With some LSP servers, `vim.lsp.buf.signature_help` (CTRL-s in insert-mode) highlights the first parameter regardless of the current cursor position. - On some lsps the `textDocument/signatureHelp` response only includes the `activeParameter` field on the `lsp.SignatureHelp` object. ```lua { { result = { activeParameter = 2, signatures = { { documentation = { kind = "markdown", value = "" }, label = "getBuyers(ctx context.Context, orderDB boil.ContextExecutor, supplierID string) ([]*BuyerWithLocation, error)", parameters = { { label = "ctx context.Context" }, { label = "orderDB boil.ContextExecutor" }, { label = "supplierID string" } } } } } } } ``` Solution: Ensure we retain this information before showing the signature information. Closes #32381
* build: add luals checkdundargoc2025-02-09
| | | | | | | | | | | | | | | | | | | This automatically downloads and uses the correct luals binary for the currently used system. `make luals` will run luals on all lua files in `runtime`. We download lua-language-server manually instead of relying on contributors downloading it on their own (like with stylua) as lua-language-server is updated frequently which may cause unnecessary friction. Therefore, we download a pinned version of luals which we then can manually bump when needed. This can be re-evaluated if luals becomes more stable in the future. Currently this is not run when using `make lint` since cmake style "file caching" doesn't seem possible at the moment. This is because checking a single file doesn't seem to work. Work on https://github.com/neovim/neovim/issues/24563.
* fix(lua): vim.tbl_get({}, nil, 1) should return nil #32218phanium2025-02-09
| | | | | | | | | | | | | | | Problem: `vim.tbl_get(tbl, nil, 1)` returns `tbl` itself. In this case, `keys` is not empty, but `ipairs` skips the iteration: local keys = { nil, 1 } assert(#keys == 2) for i, k in ipairs(keys) do assert(false, 'unreachable') end Solution: Use `select("#", ...)` and `select(i, ...)` to ensure consistency for count and iteration.
* vim-patch:9.1.1085: filetype: cmmt files are not recognizedChristian Clason2025-02-09
| | | | | | | | | | | | | | | Problem: filetype: cmmt files are not recognized Solution: detect '*.cmmt' as trace32 filetype (Christian Sax) "*.cmmt" files use the same syntax as regular TRACE32 scripts, but are intended as a kind of script template. closes: vim/vim#16598 https://github.com/vim/vim/commit/746fe54d4f16ad1c5694cccc8bc8d93a97c050e1 Co-authored-by: Christoph Sax <c_sax@mailbox.org>
* fix(lsp): check for valid buf before processing semantic tokens responseEvgeni Chasnovski2025-02-07
| | | | | | | | | | | | | | Problem: There is no check for buffer validity before processing semantic tokens response. This can lead to `Invalid buffer id` error if processing request takes a long time and the buffer is wiped out. For example, this can happen after by accident navigating to a buffer from different project which leads to first loading project's workspace and *then* processing semantic tokens. During that time a buffer can be wiped out, as navigation to it was by accident. Solution: Add extra check for buffer validity before processing semantic tokens response.
* vim-patch:9.1.1081: has('bsd') is true for GNU/Hurdzeertzjq2025-02-07
| | | | | | | | | | | | | | | | Problem: has('bsd') is true for GNU/Hurd Solution: exclude GNU/Hurd from BSD feature flag (Zhaoming Luo) GNU/Hurd, like Mac OS X, is a BSD-based system. It should exclude has('bsd') feature just like what Mac OS X does. The __GNU__ pre-defined macro indicates it's compiled for GNU/Hurd. closes: vim/vim#16580 https://github.com/vim/vim/commit/a41dfcd55b1744b44a47d2fc3feb5d5f6207a556 Co-authored-by: Zhaoming Luo <zhmingluo@163.com>
* vim-patch:9.1.1080: filetype: Mill files are not recognizedChristian Clason2025-02-06
| | | | | | | | | | | | | | | | | | | | Problem: filetype: Mill files are not recognized Solution: detect '*.mill' files as scala filetype (author) In the past [Mill](https://mill-build.org/mill/index.html) build files were always `build.sc` and treated as Scala files. However as the 0.12.x series of mill you can create a `build.mill` file. You can see a lot of examples of this if you search [GitHub](https://github.com/search?q=build.mill&type=code). This small change just ensures that if you have a `*.mill` file it treats it as a Scala file. closes: vim/vim#16585 https://github.com/vim/vim/commit/9c8f9b10fcb177fb07684626b49118dd2d2540b5 Co-authored-by: Chris Kipp <ckipp@pm.me>
* feat(defaults): enable diffopt "linematch" #32346Siddhant Agarwal2025-02-06
|
* feat(diagnostic): add `current_line` option for `virtual_text` handlerMaria José Solano2025-02-05
|
* feat(treesitter): show which nodes are missing in InspectTreeRiley Bruins2025-02-05
| | | | | | | | Now `:InspectTree` will show missing nodes as e.g. `(MISSING identifier)` or `(MISSING ";")` rather than just `(identifier)` or `";"`. This is doable because the `MISSING` keyword is now valid query syntax. Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* vim-patch:9.1.1009: diff feature can be improvedzeertzjq2025-02-04
| | | | | | | | | | | | Problem: diff feature can be improved Solution: include the linematch diff alignment algorithm (Jonathon) closes: vim/vim#9661 https://github.com/vim/vim/commit/7c7a4e6d1ad50d5b25b42aa2d5a33a8d04a4cc8a Co-authored-by: Jonathon <jonathonwhite@protonmail.com>
* Merge #32082 refactor(treesitter): use coroutines for resuming _parse()Justin M. Keyes2025-02-03
|\
| * feat(treesitter): allow LanguageTree:is_valid() to accept a rangeRiley Bruins2025-02-02
| | | | | | | | | | | | When given, only that range will be checked for validity rather than the entire tree. This is used in the highlighter to save CPU cycles since we only need to parse a certain region at a time anyway.
| * refactor(treesitter): use coroutines for resuming _parse() logicRiley Bruins2025-02-02
| | | | | | | | | | | | This means that all work previously done by a `_parse()` iteration will be kept in future iterations. This prevents it from running indefinitely in some cases where the file is very large and there are 2+ injections.
* | feat(diagnostic): format() can filter diagnostics by returning nil #32302Maria José Solano2025-02-03
| |
* | vim-patch:9.1.1070: Cannot control cursor positioning of getchar() (#32303)zeertzjq2025-02-03
|/ | | | | | | | | | Problem: Cannot control cursor positioning of getchar(). Solution: Add "cursor" flag to {opts}, with possible values "hide", "keep" and "msg". related: vim/vim#10603 closes: vim/vim#16569 https://github.com/vim/vim/commit/edf0f7db28f87611368e158210e58ed30f673098