aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* vim-patch:9.1.0983: not able to get the displayed items in complete_i… ↵glepnir2024-12-31
| | | | | | | | | | | | | | | (#31796) vim-patch:9.1.0983: not able to get the displayed items in complete_info() Problem: not able to get the displayed items in complete_info() (Evgeni Chasnovski) Solution: return the visible items via the "matches" key for complete_info() (glepnir) fixes: vim/vim#10007 closes: vim/vim#16307 https://github.com/vim/vim/commit/d4088edae21659e14ab5f763c820f4eab9d36981
* vim-patch:9.1.0977: filetype: msbuild filetypes are not recognizedChristian Clason2024-12-30
| | | | | | | | | | | | Problem: filetype: msbuild filetypes are not recognized Solution: detect msbuild files as xml filetype (Gustav Eikaas) closes: vim/vim#16339 https://github.com/vim/vim/commit/32b7e3a8c99d369b02154df74cbe42a37c7c7e68 Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
* fix(treesitter.foldexpr): only refresh valid buffersIgor2024-12-29
| | | | | | | | | Problem: autocmd to refresh folds always uses the current buffer if the option type is local. However, the current buffer may not have a parser, and thus the assert that checks for a parser could fail. Solution: check if the foldinfo contains the buffer, and only refresh if so.
* fix(lsp): check if sig_help window is focusable when configuring cycle keymapMaria José Solano2024-12-29
|
* vim-patch:9.1.0972: filetype: TI linker map files are not recognizedChristian Clason2024-12-29
| | | | | | | | | | | | | | | Problem: filetype: TI linker map files are not recognized Solution: detect TI linker map files as lnkmap filetype (Wu, Zhenyu) References: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html closes: vim/vim#16324 https://github.com/vim/vim/commit/5113831d16c05f3a8b47da0c6f95a641d5fc7b2e Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0971: filetype: SLNX files are not recognizedChristian Clason2024-12-29
| | | | | | | | | | | | | | | | Problem: filetype: SLNX files are not recognized Solution: detect '*.slnx' files as xml filetype (Gustav Eikaas) References: https://blog.ndepend.com/slnx-the-new-net-solution-xml-file-format/ https://blog.jetbrains.com/dotnet/2024/10/04/support-for-slnx-solution-files/ closes: vim/vim#16334 https://github.com/vim/vim/commit/3b3318b64043dcf29d6f06322739f695a5cc257e Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
* fix(treesitter.foldexpr): refresh in the buffers affected by OptionSetJaehwang Jung2024-12-29
|
* vim-patch:9.1.0965: filetype: sh filetype set when detecting the use of bash ↵Luca Saccarola2024-12-28
| | | | | | | | | | | (#31749) Problem: filetype: sh filetype set when detecting the use of bash Solution: when bash is detected, use 'bash' filetype instead (Luca Saccarola) closes: vim/vim#16309 https://github.com/vim/vim/commit/b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721
* feat(lua): add `vim.fs.abspath`Famiu Haque2024-12-28
| | | | | | Problem: There is currently no way to check if a given path is absolute or convert a relative path to an absolute path through the Lua stdlib. `vim.fs.joinpath` does not work when the path is absolute. There is also currently no way to resolve `C:foo\bar` style paths in Windows. Solution: Add `vim.fs.abspath`, which allows converting any path to an absolute path. This also allows checking if current path is absolute by doing `vim.fs.abspath(path) == path`. It also has support for `C:foo\bar` style paths in Windows.
* feat(lsp): support function for client root_dir (#31630)Gregory Anders2024-12-27
| | | | | | | | If root_dir is a function it is evaluated when the client is created to determine the root directory. This enables dynamically determining the root directory based on e.g. project or directory structure (example: finding a parent Cargo.toml file that contains "[workspace]" in a Rust project).
* vim-patch:9.1.0962: filetype: bun.lock file is not recognizedChristian Clason2024-12-27
| | | | | | | | | | | | Problem: filetype: bun.lock file is not recognized Solution: detect 'bun.lock' file as jsonc filetype (Anton Kastritskii) closes: vim/vim#16308 https://github.com/vim/vim/commit/f07ae5b3bdb7331ee0e65adcb74402eef74f0a2b Co-authored-by: Anton Kastritskii <halloy52@gmail.com>
* vim-patch:9.1.0961: filetype: TI gel files are not recognizedChristian Clason2024-12-25
| | | | | | | | | | | | | | | | Problem: filetype: TI gel files are not recognized Solution: detect '*.gel' files as gel filetype, include get filetype and syntax plugins (Wu, Zhenyu) References: https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html closes: vim/vim#16226 https://github.com/vim/vim/commit/9360de9027aa286e802363ede59c9e97025ae123 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0960: filetype: hy history files are not recognizedChristian Clason2024-12-25
| | | | | | | | | | | | | Problem: filetype: hy history files are not recognized Solution: detect '*.hy', '.hy-history' files as hy filetype, detect '.lips_repl_history' files are scheme filetype (Wu, Zhenyu) closes: vim/vim#16298 https://github.com/vim/vim/commit/a32daed55933df49a7aed571cc6e400ae01c7976 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* docs(api): return type of nvim_get_keymap() #31708Shihua Zeng2024-12-24
|
* vim-patch:9.1.0958: filetype: supertux2 config files detected as lispChristian Clason2024-12-24
| | | | | | | | | | | | | | | | | | Problem: filetype: supertux2 config files detected as lisp Solution: detect supertux2 config files as scheme instead (Wu, Zhenyu) References: https://github.com/SuperTux/supertux/wiki/S-Expression supertux uses #t and #f as bool type, which is same as scheme, not common lisp closes: vim/vim#16287 https://github.com/vim/vim/commit/e62d93ead10b4c5818e3c0b7551f1784d24bfe33 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* fix(diagnostic): silence :chistory #31701Yorick Peterse2024-12-23
| | | | | | | vim.diagnostic.set_list() uses chistory to restore the actively selected entry whenever necessary. This however also results in it displaying some output in the message bar, but this output isn't useful (and can even be distracting) when opening the quickfix window. This fixes this by silencing the chistory command.
* docs(api): vim.version.range():has() method #31622Lukasz Piepiora2024-12-23
| | | | | | | | Problem: The :has() method of the vim.version.range() result is not documented though it's mentioned in examples. Solution: Mention it in the range() result doc.
* vim-patch:9.1.0953: filetype: APKBUILD files not correctly detectedChristian Clason2024-12-22
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: APKBUILD files not correctly detected Solution: detect 'APKBUILD' files as apkbuild filetype, include a apkbuild syntax script (which basically just sources the sh.vim syntax file) (Hugo Osvaldo Barrera) Vim plugins (e.g.: ALE, nvim-lspconfig, etc) rely on filetype to determine which integrations/helpers are applicable. They expect filetype=apkbuild for APKBUILD files. On the other hand, plugins also enable bash-specific linters and functionality when filetype=bash, but APKBUILD files are POSIX sh, not bash, so these often provide bogus results. Change the filetype for APKBUILD to a 'apkbuild', so that tools and ftplugin can properly target these files. This filetype will use the existing `sh` syntax rules, since these are applicable for them. https://github.com/vim/vim/commit/7cb24917a112ba473cb351bdcdc48b8adbd46793 Co-authored-by: Hugo Osvaldo Barrera' via vim_dev <vim_dev@googlegroups.com>
* vim-patch:9.1.0951: filetype: jshell files are not recognizedChristian Clason2024-12-22
| | | | | | | | | | | | Problem: filetype: jshell files are not recognized Solution: detect '*.jsh' files as java filetype (Konfekt) closes: vim/vim#16260 https://github.com/vim/vim/commit/62e3014ab1146d7f78694c97fc6974f1af2cc5af Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
* feat(lsp): return table from lsp/ files on runtimepath (#31663)Gregory Anders2024-12-21
| | | | | | | | Problem: LSP configs on the runtimepath must have the same name as the LSP server and must also explicitly set the name in vim.lsp.config. This is redundant and creates a footgun where a user may accidentally use the wrong name when assigning to the vim.lsp.config table. Solution: Return a table from lsp/ runtimepath files instead
* vim-patch:9.1.0950: filetype: fennelrc files are not recognizedChristian Clason2024-12-21
| | | | | | | | | | | | | | | Problem: filetype: fennelrc files are not recognized Solution: detect 'fennelrc' files as fennel filetype (Wu Zhenyu) References: https://github.com/bakpakin/Fennel/issues/193 closes: vim/vim#16262 https://github.com/vim/vim/commit/f173f4249fc785fb3e2b341bcfb0f21192cd4bf5 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* fix(vim.system): invalid MAX_TIMEOUT for 32-bit systems #31638Dan Pascu2024-12-20
| | | | | | The maximum signed value on 32-bit systems is 2 ^ 31 - 1. When using 2 ^ 31 for the default timeout, the value would overflow on such systems resulting in a negative value, which caused a stack trace when calling wait() without a timeout.
* feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343Justin M. Keyes2024-12-19
| | | | | | | | | | | | Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`.
* docs(api): specify when decor provider on_buf is called #31634luukvbaal2024-12-19
|
* fix(lsp): vim.lsp.start fails if existing client has no workspace_folders #31608phanium2024-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: regression since https://github.com/neovim/neovim/pull/31340 `nvim -l repro.lua`: ```lua vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls' } vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls', root_dir = 'foo' } -- swapped case will be ok: -- vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls', root_dir = 'foo' } -- vim.lsp.start { cmd = { 'lua-language-server' }, name = 'lua_ls' } ``` Failure: ``` E5113: Error while calling lua chunk: /…/lua/vim/lsp.lua:214: bad argument #1 to 'ipairs' (table expected, got nil) stack traceback: [C]: in function 'ipairs' /…/lua/vim/lsp.lua:214: in function 'reuse_client' /…/lua/vim/lsp.lua:629: in function 'start' repro.lua:34: in main chunk ```
* feat(lsp): show server version in `:checkhealth` #31611Peter Lithammer2024-12-18
| | | | | | | | Problem: Language server version information missing from `:checkhealth vim.lsp`. Solution: Store `InitializeResult.serverInfo.version` from the `initialize` response and display for each client in `:checkhealth vim.lsp`.
* feat(terminal)!: cursor shape and blink (#31562)Gregory Anders2024-12-17
| | | | | | | | | | | | | | | | | | | | | When a terminal application running inside the terminal emulator sets the cursor shape or blink status of the cursor, update the cursor in the parent terminal to match. This removes the "virtual cursor" that has been in use by the terminal emulator since the beginning. The original rationale for using the virtual cursor was to avoid having to support additional UI methods to change the cursor color for other (non-TUI) UIs, instead relying on the TermCursor and TermCursorNC highlight groups. The TermCursor highlight group is now used in the default 'guicursor' value, which has a new entry for Terminal mode. However, the TermCursorNC highlight group is no longer supported: since terminal windows now use the real cursor, when the window is not focused there is no cursor displayed in the window at all, so there is nothing to highlight. Users can still use the StatusLineTermNC highlight group to differentiate non-focused terminal windows. BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
* fix(api): generic error messages, not using TRY_WRAP #31596Justin M. Keyes2024-12-16
| | | | | | | | | | | Problem: - API functions using `try_start` directly, do not surface the underlying error message, and instead show generic messages. - Error-handling code is duplicated in the API impl. - Failure modes are not tested. Solution: - Use `TRY_WRAP`. - Add tests.
* fix(diagnostic): vim.diagnostic.setqflist() opens loclist on first call #31585Juan Cruz De La Torre2024-12-16
| | | | | | | | | | | | Problem: Regression from de794f2d2409: `vim.diagnostic.setqflist{open=true}` attempts to open the location list instead of the diagnostics quickfix list if it didn't exist before. This is because we are using `qf_id` to decide which to open, but `qf_id=nil` when there is no existing diagnostics quickfix list with a given title ("Diagnostics" by default). Solution: - Revert to using `loclist` to decide which to open. - Add tests.
* vim-patch:9.1.0929: filetype: lalrpop files are not recognizedChristian Clason2024-12-16
| | | | | | | | | | | | | | | Problem: filetype: lalrpop files are not recognized Solution: detect '*.lalrpop' files as lalrpop filetype (David Thievon) References: https://github.com/lalrpop/lalrpop closes: vim/vim#16223 https://github.com/vim/vim/commit/5a2e0cf5f11c611c9b01f1bd6e7294edf0dd2bf4 Co-authored-by: David Thievon <pdkfan@gmail.com>
* vim-patch:9.1.0926: filetype: Pixi lock files are not recognizedChristian Clason2024-12-15
| | | | | | | | | | | | | | | Problem: filetype: Pixi lock files are not recognized Solution: detect "pixi.lock" file as yaml filetype (Brandon Maier) Reference: https://pixi.sh/latest/features/lockfile/ closes: vim/vim#16212 https://github.com/vim/vim/commit/7d1bb90dcf711c732a49e0a45e56028a4853a17d Co-authored-by: Brandon Maier <brandon.maier@gmail.com>
* vim-patch:ed89206: runtime(doc): add a note about inclusive motions and ↵zeertzjq2024-12-15
| | | | | | | | | | exclusive selection related: vim/vim#16202 https://github.com/vim/vim/commit/ed89206efe404a94e8424ccfe03c978fd93470f1 Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs(annotations): added `---@generic` supportColin Kennedy2024-12-13
|
* fix(lsp): reuse client if configs match and no root dirLewis Russell2024-12-13
| | | | | | | | | | | | Problem: An LSP configuration that creates client with no root_dir or workspace_folders can result in vim.lsp.enable attaching to it multiple times. Solution: When checking existing clients, reuse a client if it wasn't initially configured have any workspace_folders. This more closely matches the behaviour we had prior to d9235ef
* vim-patch:9.1.0919: filetype: some assembler files are not recognizedChristian Clason2024-12-13
| | | | | | | | | | | | Problem: filetype: some assembler are files not recognized Solution: detect '*.nasm' files as nasm filetype and '*.masm' as masm filetype (Wu, Zhenyu) closes: vim/vim#16194 https://github.com/vim/vim/commit/d66d68763d0947c292a9fdda4da6fda3650fa563 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* fix(diagnostic): broken variable reference #31557Jeremy Fleischman2024-12-12
|
* refactor(lsp/rpc): move transport logic to separate moduleLewis Russell2024-12-12
|
* fix(diagnostic): setqflist() is stuck after vim.lsp.buf.document_symbol #31553Jeremy Fleischman2024-12-11
| | | | | | | | | | | | | Previously, when updating the quickfix diagnostics list, we'd update it, and then open the quickfix buffer, but there was no guarantee that the quickfix buffer would be displaying the quickfix diagnostics list (it could very possibly be displaying some other quickfix list!). This fixes things so we first select the quickfix list before opening the quickfix buffer. If `open` is not specified, the behavior is the same as before: we update the diagnostics quickfix list, but do not navigate to it. fixes https://github.com/neovim/neovim/issues/31540
* feat(diagnostic): update quickfix list by title #31486Jeremy Fleischman2024-12-11
| | | | | | | Previously, there was a singleton diagnostics quickfix list. Now there's effectively one per title (up to vim's internal limit on quickfix lists). Suggested by mfussenegger https://github.com/neovim/neovim/pull/30868#pullrequestreview-2385761374.
* fix(uri): uri_encode encodes brackets incorrectly for RFC2732 #31284Jonny Kong2024-12-11
| | | | | | | | | | **Problem:** The brackets in the RFC2732 regular expression are currently unescaped, causing them to be misinterpreted as special characters denoting character groups rather than as literal characters. **Solution:** Escape the brackets. Fix #31270
* feat(treesitter): include capture id in return value of ↵Riley Bruins2024-12-11
| | | | | | | | | | | | | | | `get_captures_at_pos()` #30559 **Problem:** Currently, it is difficult to get node(s)-level metadata for a capture returned by `get_captures_at_pos()`. This is because it is stored in `metadata[id]` and we do not have access to the value of `id`, so to get this value we have to iterate over the keys of `metadata`. See [this commit](https://github.com/neovim/neovim/commit/d63622930001b39b12f14112fc3abb55b760c447#diff-8bd4742121c2f359d0345f3c6c253a58220f1a28670cc4e1c957992232059a6cR16). Things would be much simpler if we were given the `id` of the capture so we could use it to just index `metadata` directly. **Solution:** Include `id` in the data returned by `get_captures_at_pos()`
* docs(annotation): return types for Vimscript functions #31546Colin Kennedy2024-12-11
|
* feat(lsp): add vim.lsp.config and vim.lsp.enableLewis Russell2024-12-10
| | | | | | | | | | | | | | | | | | | | Design goals/requirements: - Default configuration of a server can be distributed across multiple sources. - And via RTP discovery. - Default configuration can be specified for all servers. - Configuration _can_ be project specific. Solution: - Two new API's: - `vim.lsp.config(name, cfg)`: - Used to define default configurations for servers of name. - Can be used like a table or called as a function. - Use `vim.lsp.confg('*', cfg)` to specify default config for all servers. - `vim.lsp.enable(name)` - Used to enable servers of name. Uses configuration defined via `vim.lsp.config()`.
* docs(vvars): adjust lua types for vim.v variables #31510luukvbaal2024-12-09
| | | | - classes for v:event and v:completed_item - add remaining unknown types
* docs: fix type of vim.validate valueMaria José Solano2024-12-09
|
* refactor(lsp): better tracking of requestsLewis Russell2024-12-08
| | | | | Not essential, but adds robustness and hardening for future changes.
* vim-patch:9.1.0911: Variable name for 'messagesopt' doesn't match short namezeertzjq2024-12-08
| | | | | | | | | | Problem: Variable name for 'messagesopt' doesn't match short name (after v9.1.0908) Solution: Change p_meo to p_mopt. Add more details to docs. closes: vim/vim#16182 https://github.com/vim/vim/commit/8cc43daee1f485c9abf1de3c638cce7835b9f861
* vim-patch:9.1.0910: 'messagesopt' does not check max wait timezeertzjq2024-12-08
| | | | | | | | | | | | | Problem: 'messagesopt' does not check max wait time (after v9.1.0908) Solution: Check for max wait value (Shougo Matsushita) closes: vim/vim#16183 https://github.com/vim/vim/commit/d9e9f89e0ffd6e7ce5e2a7f8f1ace5471e37c210 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* refactor: add vim._resolve_bufnrLewis Russell2024-12-07
|
* fix(inspect): always show priorityChristian Clason2024-12-07
| | | | | | | | Problem: It is not obvious if a treesitter highlight priority shown in `:Inspect` is higher or lower than the default. Solution: Also print default priority (`vim.hl.priorities.treesitter`). Add padding for better readability.