summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim
AgeCommit message (Collapse)AuthorFiles
2024-02-20fix(extmarks): priority order of inline and non-inline virt_text (#27532)zeertzjq1
2024-02-19refactor(lsp): typings for protocol constantsMaria José Solano1
2024-02-19docs: improve 'tabline' click label docs (#27529)zeertzjq1
2024-02-16fix: fix iter_matches call in query linter (#27496)Gregory Anders1
2024-02-16fix(treesitter): correctly handle query quantifiers (#24738)Thomas Vigouroux4
Query patterns can contain quantifiers (e.g. (foo)+ @bar), so a single capture can map to multiple nodes. The iter_matches API can not handle this situation because the match table incorrectly maps capture indices to a single node instead of to an array of nodes. The match table should be updated to map capture indices to an array of nodes. However, this is a massively breaking change, so must be done with a proper deprecation period. `iter_matches`, `add_predicate` and `add_directive` must opt-in to the correct behavior for backward compatibility. This is done with a new "all" option. This option will become the default and removed after the 0.10 release. Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: MDeiml <matthias@deiml.net> Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-02-15docs: document breaking change for nvim_create_autocmd callback (#27484)Gregory Anders1
https://github.com/neovim/neovim/pull/27428 changed the semantics of callbacks passed to nvim_create_autocmd such that any truthy value will delete the autocommand (rather than just the literal boolean value `true`). Update the documentation accordingly and add an entry to `news.txt`. The behavior is now consistent between nvim_create_autocmd and nvim_buf_attach.
2024-02-15fix: type warnings in shared.luaLewis Russell4
2024-02-15vim-patch:9.1.0111: filetype: no support for bats filesChristian Clason1
The '*.bats' file type is for Bash Automated Testing System (BATS) scripts. BATS scripts are Bash with a special '@test' extension but they otherwise work with Vim's bash filetype. See https://github.com/bats-core/bats-core closes: vim/vim#14039 https://github.com/vim/vim/commit/d00fb4b3a237b375de5a1f453c8453b8b3797d51 Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15vim-patch:9.1.0110: filetype: add 'Config.in' filetype detectionChristian Clason1
The 'Config.in' file type is for Buildroot configuration files. Buildroot Config.in files use the same Kconfig backend as the Linux kernel's Kconfig files. Buildroot also has other filename variants that follow "Config.in.*", they are used to distinguish multiple Config.in files in the same directory. See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file closes: vim/vim#14038 https://github.com/vim/vim/commit/5f20f050efed3431beaf85739f0113e9ef0abd8e Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15vim-patch:9.1.0109: filetype: no support for its filesChristian Clason1
Problem: filetype: no support for its files Solution: Add detection for *.its files as dts file type (Brandon Maier) The '*.its' file type is for U-Boot Flattened Image Trees (FIT) which use the flattened devicetree format. See https://github.com/u-boot/u-boot/blob/master/doc/usage/fit/source_file_format.rst#terminology closes: vim/vim#14037 https://github.com/vim/vim/commit/cf1d65e060e32ba8a0ba99fc299dc192fe4aa961 Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15vim-patch:9.1.0108: filetype: no support for dtso filesChristian Clason1
Problem: filetype: no support for dtso files Solution: Add detection for *.dtso files as dts file type (Markus Schneider-Pargmann) *.dtso files are devicetree overlay files which have the same syntax as dts or dtsi files. closes: vim/vim#14026 https://github.com/vim/vim/commit/b1700fb33fe02838d679b9215e501455cf4c1156 Co-authored-by: Markus Schneider-Pargmann <msp@baylibre.com>
2024-02-14fix(lsp): rename: load and list new buffer if attached to window (#27408)Tomasz N1
2024-02-13refactor(lsp): resolve the config-client entanglementLewis Russell9
Previously the LSP-Client object contained some fields that are also in the client config, but for a lot of other fields, the config was used directly making the two objects vaguely entangled with either not having a clear role. Now the config object is treated purely as config (read-only) from the client, and any fields the client needs from the config are now copied in as additional fields. This means: - the config object is no longet normalised and is left as the user provided it. - the client only reads the config on creation of the client and all other implementations now read the clients version of the fields. In addition, internal support for multiple callbacks has been added to the client so the client tracking logic (done in lua.lsp) can be done more robustly instead of wrapping the user callbacks which may error.
2024-02-13refactor(lua): use a keyset for vim.diff opts parsingbfredl1
2024-02-13fix(loader): remove cyclic dependency on vim.fs (when --luamod-dev)Jongwook Choi1
Problem: Loading `vim.fs` via the `vim.loader` Lua package loader will result in a stack overflow due to a cyclic dependency. This may happen when the `vim.fs` module isn't byte-compiled, i.e. when `--luamod-dev` is used (#27413). Solution: `vim.loader` depends on `vim.fs`. Therefore `vim.fs` should be loaded in advance.
2024-02-13docs(builtin): fix lua types for vim.fn.sign_getplacedJongwook Choi1
Per :help sign_getplaced(): - Parameter {dict}: lnum also accepts integer as well as string - Return value: item has field bufnr, not buf
2024-02-13docs: stricter bufname and bufnr types (#27454)Maria José Solano1
2024-02-12fix(lsp): re-add client.commands and mark privateLewis Russell1
2024-02-12docs: correct on_key docs (#27429)altermo1
2024-02-12fix(lsp): semantic token defer loadingLewis Russell2
Fixes #27424
2024-02-11refactor(lsp): move more code to client.luaLewis Russell3
The dispatchers used by the RPC client should be defined in the client, so they have been moved there. Due to this, it also made sense to move all code related to client configuration and the creation of the RPC client there too. Now vim.lsp.start_client is significantly simplified and now mostly contains logic for tracking open clients. - Renamed client.new -> client.start
2024-02-11Merge pull request #27420 from MariaSolOs/warning-anxietyLewis Russell7
refactor(lsp): fix type annotations and add shared diagnostic helper
2024-02-10refactor(lsp): add vim.lsp.sync.Range typeMaria José Solano1
2024-02-10refactor(lsp): add shared diagnostic handlerMaria José Solano1
2024-02-10refactor(lsp): add type annotationsMaria José Solano7
2024-02-11feat(shortmess): "q" flag fully hides recording message (#27415)Trevor Arjeski1
When "q" is set in 'shortmess' it now fully hides the "recording @a" message when you are recording a macro instead of just shortening to "recording". This removes duplication when using reg_recording() in the statusline. Related #19193
2024-02-10Merge pull request #27253 from MariaSolOs/codelens-refreshbfredl1
feat(lsp): add opts to vim.lsp.codelens.refresh
2024-02-09refactor: rename FloatConfig to WinConfig #27397Will Hopkins2
`FloatConfig` is no longer used only for floats, so the name is counterintuitive. Followup to #25550
2024-02-08feat(lsp): add opts paramater to vim.lsp.codelens.refreshMaria José Solano1
2024-02-08fix(lsp): rename fails on missing parent directory #27291Tomasz N1
Problem: If a rename results in a path that has missing parent directory(s), it will fail. Solution: Do a recursive mkdir before attempting the rename.
2024-02-08feat(lsp): deprecate severity_limitLewis Russell1
Problem: `vim.lsp.diagnostic.on_diagnostic` accepts an undocumented severity_limit option which is widely used. Solution: Deprecate it in favour of `{min = severity}` used in `vim.diagnostic`. Since this is undocumented, the schedule for removal is accelerated to 0.11.
2024-02-08refactor(treesitter): {start,stop} are optional in Query:iter_* methodsJongwook Choi1
Document that the `start` and `stop` parameters in `Query:iter_captures()` and `Query:iter_matches()` are optional. The tree-sitter lib has been bumped up to 0.20.9, so we also no longer need "Requires treesitter >= 0.20.9".
2024-02-08refactor(treesitter): typing for Query, TSQuery, and TSQueryInfoJongwook Choi3
- `TSQuery`: userdata object for parsed query. - `vim.treesitter.Query`: renamed from `Query`. - Add a new field `lang`. - `TSQueryInfo`: - Move to `vim/treesitter/_meta.lua`, because C code owns it. - Correct typing for `patterns`, should be a map from `integer` (pattern_id) to `(integer|string)[][]` (list of predicates or directives). - `vim.treesitter.QueryInfo` is added. - This currently has the same structure as `TSQueryInfo` (exported from C code). - Document the fields (see `TSQuery:inspect`). - Add typing for `vim._ts_parse_query()`.
2024-02-08refactor(lsp): tidy up loggingLewis Russell8
2024-02-08feat(api): pass 0 to nvim_get_chan_info for current channel (#27321)nikolightsaber1
Getting current channel info was kind of annoying via RPC. Two functions had to be called: 1. `nvim_get_api_info` which returns `[channel_id, meta_data]`. - This results in `channel_id = api.nvim_get_api_info()[0]`. - Here the meta_data is sent but never used. 2. Finally call `nvim_get_chan_info(channel_id)`. This commit reduces the need for `nvim_get_api_info` as passing 0 returns current channel info.
2024-02-08fix(lsp): set fallback client name properlyzeertzjq1
2024-02-07refactor(lsp): move client code to a regular Lua classLewis Russell6
Problem: The LSP client code is implemented as a complicated closure-class (class defined in a single function). Solution: Move LSP client code to a more conventional Lua class and move to a separate file.
2024-02-06feat(treesitter): show root nodes in :InspectTree (#26944)altermo1
Co-authored-by: altermo <> Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-02-06fix(lsp): send back diagnostic tags to the serverLewis Russell2
Fixes: #27318
2024-02-06docs: small fixes (#27213)dundargoc2
Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
2024-02-05feat(treesitter): use 0-based indexing to show ranges in `:InspectTree`Jongwook Choi1
Problem: - `:InspectTree` was showing node ranges in 1-based indexing, i.e., in vim cursor position (lnum, col). However, treesitter API adopts 0-based indexing to represent ranges (Range4). This can often be confusing for developers and plugin authors when debugging code written with treesiter APIs. Solution: - Change to 0-based indexing from 1-based indexing to show node ranges in `:InspectTree`. - Note: To make things not complicated, we do not provide an option or keymap to configure which indexing mode to use.
2024-02-05fix(lsp): handle adjacent snippet tabstopsMaria José Solano1
2024-02-05Merge pull request #27328 from wookayin/fix/lsp-tagfuncLewis Russell2
2024-02-04fix(treesitter): inspect-tree remember opts on buf changealtermo1
2024-02-04vim-patch:9.1.0076: luau config file not detectedChristian Clason1
Problem: luau config file not detected (lopy) Solution: Detect it as jsonc (lopy) fixes: vim/vim#13960 closes: vim/vim#13970 https://github.com/vim/vim/commit/de7f5bde6c598d4da4ce5b30328eb458962ba60a Co-authored-by: lopy <70210066+lopi-py@users.noreply.github.com>
2024-02-03fix(lsp): fix infinite loop on vim.lsp.tagfuncJongwook Choi2
Problem: vim.lsp.tagfunc() causes an infinite loop. This is a bug happened while introducing deferred loading. Solution: Rename the private module to `vim.lsp._tagfunc`.
2024-02-03refactor: create function for deferred loadingdundargoc17
The benefit of this is that users only pay for what they use. If e.g. only `vim.lsp.buf_get_clients()` is called then they don't need to load all modules under `vim.lsp` which could lead to significant startuptime saving. Also `vim.lsp.module` is a bit nicer to user compared to `require("vim.lsp.module")`. This isn't used for some nested modules such as `filetype` as it breaks tests with error messages such as "attempt to index field 'detect'". It's not entirely certain the reason for this, but it is likely it is due to filetype being precompiled which would imply deferred loading isn't needed for performance reasons.
2024-02-02fix(vim.system): don't process non-fast events during wait() (#27300)zeertzjq1
Problem: Processing non-fast events during SystemObj:wait() may cause two pieces of code to interfere with each other, and is different from jobwait(). Solution: Don't process non-fast events during SystemObj:wait().
2024-02-01feat(api): make nvim_open_win support non-floating windows (#25550)Will Hopkins2
Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows.
2024-01-29feat(api): add nvim_tabpage_set_win (#27222)Will Hopkins1
Allows setting the current window of a non-current tabpage without switching tabpages.