aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* Merge pull request #24606 from bfredl/keysetnilbfredl2023-08-08
|\ | | | | docs(lua): the keyset nilocalypse
| * docs(lua): the keyset nilocalypsebfredl2023-08-08
|/ | | | This is needed to give recent LuaLS the right idea about optional fields.
* fix(treesitter): make sure injections don't return empty ranges (#24595)Lewis Russell2023-08-07
| | | | | | | | | | | | | | | | | | | | When an injection has not set include children, make sure not to add the injection if no ranges are determined. This could happen when there is an injection with a child that has the same range as itself. e.g. consider this Makefile snippet ```make foo: $(VAR) ``` Line 2 has an injection for bash and a make variable reference. If include-children isn't set (default), then there is no range on line 2 to inject since the variable reference needs to be excluded. This caused the language tree to return an empty range, which the parser now interprets to mean the full buffer. This caused makefiles to have completely broken highlighting.
* vim-patch:9.0.1678: blade files are not recognized (#24601)ObserverOfTime2023-08-07
| | | | | | | | Problem: Blade files are not recognized. Solution: Add a pattern for Blade files. (closes vim/vim#12650) https://github.com/vim/vim/commit/ad34abee258322826146d597ac5b5fd2111c2b79 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat: add .luarc.json (#24592)Lewis Russell2023-08-07
|
* docs(lsp): fix references to protocol.constants #24578Maria José Solano2023-08-07
|
* fix(treesitter): escape quotes in :InspectTree view #24582ObserverOfTime2023-08-07
| | | | Problem: Anonymous nodes containing double quotes break the highlighting. Solution: Escape double quotes in anonymous nodes.
* Merge pull request #24524 from bfredl/typed_keysbfredl2023-08-07
|\ | | | | refactor(api): use typed keysets
| * feat(lua): use keyset type informationbfredl2023-08-07
| |
| * test(api): update tests to new error messagesbfredl2023-08-07
| |
| * feat(lua): specific error messages for type checking `opts` paramsbfredl2023-08-07
| |
| * refactor(api): use typed keysetsbfredl2023-08-07
| | | | | | | | | | Initially this is just for geting rid of boilerplate, but eventually the types could get exposed as metadata
| * feat(lua): more specific error messages for vim.api type checkingbfredl2023-08-04
| |
* | fix(inccommand): don't set an invalid 'undolevels' value (#24575)zeertzjq2023-08-05
| | | | | | | | | | | | | | Problem: Cannot break undo by setting 'undolevels' to itself in 'inccommand' preview callback. Solution: Don't set an invalid 'undolevels' value. Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
* | refactor(lsp): use protocol.Methods instead of strings #24570Raphael2023-08-05
| |
* | docs(options): fix mistakes (#24568)zeertzjq2023-08-05
| |
* | docs(options): take ownership of options.txt (#24528)Lewis Russell2023-08-04
|/ | | | | | | | | | | | | | * docs(options): take ownership of options.txt - `src/nvim/options.lua` is now the source of truth - generate runtime/lua/vim/_meta/options.lua * fixup! zeer comments * fixup! zeer comments (2) * fixup! re-enable luacheck * fixup! regen
* fix(lsp): do not assume client capability exists in watchfiles check (#24550)Sean Dewar2023-08-04
| | | | | | | | | | | | | | | | | | | | | PR #23689 assumes `client.config.capabilities.workspace.didChangeWatchedFiles` exists when checking `dynamicRegistration`, but thats's true only if it was passed to `vim.lsp.start{_client}`. This caused #23806 (still an issue in v0.9.1; needs manual backport), but #23681 fixed it by defaulting `config.capabilities` to `make_client_capabilities` if not passed to `vim.lsp.start{_client}`. However, the bug resurfaces on HEAD if you provide a non-nil `capabilities` to `vim.lsp.start{_client}` with missing fields (e.g: not made via `make_client_capabilities`). From what I see, the spec says such missing fields should be interpreted as an absence of the capability (including those indicated by missing sub-fields): https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities Also, suggest `vim.empty_dict()` for an empty dict in `:h vim.lsp.start_client()` (`{[vim.type_idx]=vim.types.dictionary}` no longer works anyway, probably since the cjson switch).
* test(options/defaults_spec): fix NVIM_APPNAME test flakiness (#24553)zeertzjq2023-08-04
| | | Also avoid leaving directories behind.
* fix(terminal): forward horizontal mouse scrolling (#24552)zeertzjq2023-08-04
|
* fix(terminal): include modifiers when forwarding mouse (#24549)zeertzjq2023-08-04
|
* build(deps): bump libvterm to 0.3.3 (#24547)zeertzjq2023-08-04
| | | Fix #21106
* docs: luaref cleanup #24541Justin M. Keyes2023-08-03
| | | | - drop "luaref-" prefix in favor of "lua-" or nothing, where possible. - remove redundant "luaref--lang…" and "luaref-api…" tags.
* Merge #24351 docsJustin M. Keyes2023-08-03
|\
| * docs: remove "#" comment char in @returnJustin M. Keyes2023-08-03
| | | | | | | | | | | | | | Everything after a "#" char is a "description" comment, i.e. luals won't treat it as a type, name, etc. But "#" should not be present in the generated docs (such as :help docs). https://github.com/LuaLS/lua-language-server/wiki/Annotations#return
| * docs: miscJustin M. Keyes2023-08-03
| | | | | | | | Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
* | refactor(lsp): use protocol.Methods instead of strings #24537Raphael2023-08-03
|/
* fix(gen_lsp.lua): no notifications in lsp.Methods #24530Raphael2023-08-03
| | | | | | | | | Problem: - Notifications are missing from `lsp.Methods`. - Need a way to represent `$/` prefixed methods. Solution: - Generate notifications. - Use "dollar_" prefix for `$/` methods.
* docs(lua): fix generated `fname` param annotations #24533Marc Jakobi2023-08-02
|
* docs(builtin): fix alignment of comments in code blocks (#24529)zeertzjq2023-08-02
|
* docs: drop "Can also be used as a method" #24508Justin M. Keyes2023-08-01
| | | | | | | | Now that we "own" builtin.txt, we cant remove the repetitive mention of Vimscript's UFCS syntax. It's noisy to mention this for each function, and it's also not a Vimscript feature that should be encouraged. Also change the builtin.txt heading to "NVIM REFERENCE MANUAL", which indicates when a help file is Nvim-owned.
* feat(lua): add meta file for vim submodules (#24525)Lewis Russell2023-08-01
|
* fix(loader): cache path ambiguity #24491Tyler Miller2023-08-01
| | | | | | | | | | | Problem: cache paths are derived by replacing each reserved/filesystem- path-sensitive char with a `%` char in the original path. With this method, two different files at two different paths (each containing `%` chars) can erroneously resolve to the very same cache path in certain edge-cases. Solution: derive cache paths by url-encoding the original (path) instead using `vim.uri_encode()` with `"rfc2396"`. Increment `Loader.VERSION` to denote this change.
* Merge #24504 feat(lsp): protocol.MethodsJustin M. Keyes2023-08-01
|\
| * feat(gen_lsp.lua): sort by name, handle failure #24504Justin M. Keyes2023-08-01
| |
| * feat(gen_lsp.lua): protocol.Methods #24504mathew2023-08-01
| |
* | feat(lua-types): types for vim.api.* (#24523)Lewis Russell2023-08-01
|/
* fix(lsp): inlay hints: "Failed to delete autocmd" when closing buffer #24469Chris AtLee2023-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: "Failed to delete autocmd" error when deleting LspNotify autocmd. #24456 Solution: Change a few things in the inlay_hint and diagnostic LSP code: 1. Re-introduce the `enabled` flag for the buffer state tables. Previously I was relying on the presence of an autocmd id in the state table to track whether inlay_hint / diagnostic was enabled for a buffer. There are two reasons why this doesn't work well: - Each time inlay_hint / diagnostic is enabled, we call `nvim_buf_attach` on the buffer, resulting in multiple `on_reload` or `on_detach` callbacks being registered. - Commands like `bwipeout` delete buffer local autocmds, sometimes before our `on_detach` callbacks have a chance to delete them first. This causes the - Use module local enabled state for diagnostic as well. bwipeout can race with on_detach callbacks for deleting autocmds. Error referenced in #24456. 2. Change the `LspDetach` autocmd to run each time (i.e., remove the `once` flag). Since we're only registering autocmds once per buffer now, we need to make sure that we set the enabled flag properly each time the LSP client detaches from the buffer. - Remove `once` from the LspDetach autocmds for inlay_hint and diagnostic. We only set up the autocmd once now. Gets removed when buffer is deleted. 3. Have the `LspNotify` handler also refresh the inlay_hint / diagnostics when receiving the `textDocument/didOpen` event. Before this point, the LSP backend doesn't have the contents of the buffer, so can't provide inlay hints or diagnostics. Downsides of this approach: * When inlay_hint / diagnostics are disabled on a buffer, it will continue to receive `LspNotify` events for that buffer. The callback exits early since the `enabled` flag is false. Alternatives: * Can we wrap the call to `nvim_del_autocmd` in `pcall` to swallow any errors resulting from trying to delete the autocmd? Fixes #24456 Helped-by: Maria José Solano <majosolano99@gmail.com>
* docs(builtin): right align tags (#24522)Lewis Russell2023-08-01
|
* fix(defaults): don't use nvim_feedkeys in default mappings (#24520)zeertzjq2023-08-01
| | | | | | | Problem: Using nvim_feedkeys in default mappings makes it hard to use them as a part of another mapping. Solution: Use an expression mapping and stop Visual mode later. Fix #24518.
* docs(builtin): fix and annotate language blocks (#24506)Lewis Russell2023-08-01
|
* build: fix --luamod-dev not working properly (#24519)zeertzjq2023-08-01
| | | Fixes a regression from #23112.
* feat(lsp): add actionable advice to lsp client quit error msg (#24510)Mathias Fußenegger2023-07-29
| | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* docs(lua): vim.str_utf_{start,end,pos} #24424altermo2023-07-29
| | | Closes #24422
* feat(docs): generate builtin.txt (#24493)Lewis Russell2023-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - eval.lua is now the source of truth. - Formatting is much more consistent. - Fixed Lua type generation for polymorphic functions (get(), etc). - Removed "Overview" section from builtin.txt - Can generate this if we really want it. - Moved functions from sign.txt and testing.txt into builtin.txt. - Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred. - Removed the temp-file-name tag from tempname() - Moved lueval() from lua.txt to builtin.txt. * Fix indent * fixup! * fixup! fixup! * fixup! better tag formatting * fixup: revert changes no longer needed * fixup! CI --------- Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(inccommand): don't save information of a buffer twice (#24501)zeertzjq2023-07-28
| | | | | Problem: 'inccommand' doesn't restore 'undolevels' properly for a buffer shown in multiple windows. Solution: Don't save information of a buffer twice.
* fix(editorconfig): highlight properties with dashes (#24407)ObserverOfTime2023-07-27
| | | also add metadata comment and update Lua code in syntax file
* build(deps): bump tree-sitter-c to v0.20.4 (#24495)Christian Clason2023-07-27
|
* Merge pull request #24457 from seandewar/relax-cmdwinSean Dewar2023-07-26
|\ | | | | feat(api): relax cmdwin restrictions for a few functions
| * fix(window): prevent win_size_restore from changing cmdheightSean Dewar2023-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it only skips if `Rows` changed, but it's possible for the height of the usable area for windows to change (e.g: via `&ch`, `&stal` or `&ls`), which can cause the value of `&cmdheight` to change when the sizes are restored. This is a Vim bug, so I've submitted a PR there too. No telling when it'll be merged though, given the current lack of activity there. `ROWS_AVAIL` is convenient here, but also subtracts the `global_stl_height()`. Not ideal, as we also care about the height of the last statusline for other values of `&ls`. Meh. Introduce `last_stl_height` for getting the height of the last statusline and use it in `win_size_save/restore` and `last_status` (means `last_status_rec`'s `statusline` argument will now be true if `&ls` is 3, but that does not change the behaviour). Also corrects the logic in `comp_col` to not assume there's a last statusline if `&ls` is 1 and the last window is floating.