aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
| * Merge pull request #27420 from MariaSolOs/warning-anxietyLewis Russell2024-02-11
| |\ | | | | | | refactor(lsp): fix type annotations and add shared diagnostic helper
| | * refactor(lsp): add vim.lsp.sync.Range typeMaria José Solano2024-02-10
| | |
| | * refactor(lsp): add shared diagnostic handlerMaria José Solano2024-02-10
| | |
| | * refactor(lsp): add type annotationsMaria José Solano2024-02-10
| | |
| * | feat(shortmess): "q" flag fully hides recording message (#27415)Trevor Arjeski2024-02-11
| | | | | | | | | | | | | | | | | | | | | 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
| * | Merge pull request #27253 from MariaSolOs/codelens-refreshbfredl2024-02-10
| |\ \ | | |/ | |/| feat(lsp): add opts to vim.lsp.codelens.refresh
| | * feat(lsp): add opts paramater to vim.lsp.codelens.refreshMaria José Solano2024-02-08
| | |
| * | refactor: rename FloatConfig to WinConfig #27397Will Hopkins2024-02-09
| |/ | | | | | | | | `FloatConfig` is no longer used only for floats, so the name is counterintuitive. Followup to #25550
| * fix(lsp): rename fails on missing parent directory #27291Tomasz N2024-02-08
| | | | | | | | | | | | | | | | 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.
| * feat(lsp): deprecate severity_limitLewis Russell2024-02-08
| | | | | | | | | | | | | | | | | | | | | | 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.
| * refactor(treesitter): {start,stop} are optional in Query:iter_* methodsJongwook Choi2024-02-08
| | | | | | | | | | | | | | | | 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".
| * refactor(treesitter): typing for Query, TSQuery, and TSQueryInfoJongwook Choi2024-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `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()`.
| * refactor(lsp): tidy up loggingLewis Russell2024-02-08
| |
| * feat(api): pass 0 to nvim_get_chan_info for current channel (#27321)nikolightsaber2024-02-08
| | | | | | | | | | | | | | | | | | | | | | 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.
| * fix(lsp): set fallback client name properlyzeertzjq2024-02-08
| |
| * refactor(lsp): move client code to a regular Lua classLewis Russell2024-02-07
| | | | | | | | | | | | | | | | | | | | 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.
| * feat(treesitter): show root nodes in :InspectTree (#26944)altermo2024-02-06
| | | | | | | | Co-authored-by: altermo <> Co-authored-by: Jongwook Choi <wookayin@gmail.com>
| * fix(lsp): send back diagnostic tags to the serverLewis Russell2024-02-06
| | | | | | | | Fixes: #27318
| * docs: small fixes (#27213)dundargoc2024-02-06
| | | | | | Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
| * feat(treesitter): use 0-based indexing to show ranges in `:InspectTree`Jongwook Choi2024-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * fix(lsp): handle adjacent snippet tabstopsMaria José Solano2024-02-05
| |
| * Merge pull request #27328 from wookayin/fix/lsp-tagfuncLewis Russell2024-02-05
| |\
| | * fix(lsp): fix infinite loop on vim.lsp.tagfuncJongwook Choi2024-02-03
| | | | | | | | | | | | | | | | | | | | | | | | 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`.
| * | fix(treesitter): inspect-tree remember opts on buf changealtermo2024-02-04
| | |
| * | vim-patch:9.1.0076: luau config file not detectedChristian Clason2024-02-04
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * refactor: create function for deferred loadingdundargoc2024-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * fix(vim.system): don't process non-fast events during wait() (#27300)zeertzjq2024-02-02
| | | | | | | | | | | | | | | | 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().
| * feat(api): make nvim_open_win support non-floating windows (#25550)Will Hopkins2024-02-01
| | | | | | | | Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows.
| * feat(api): add nvim_tabpage_set_win (#27222)Will Hopkins2024-01-29
| | | | | | | | Allows setting the current window of a non-current tabpage without switching tabpages.
| * feat(extmarks): subpriorities (relative to declaration order) (#27131)Gregory Anders2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "priority" field of extmarks can be used to set priorities of extmarks which dictates which highlight group a range will actually have when there are multiple extmarks applied. However, when multiple extmarks have the same priority, the only way to enforce an actual priority is through the order in which the extmarks are set. It is not always possible or desirable to set extmarks in a specific order, however, so we add a new "subpriority" field that explicitly enforces the ordering of extmarks that have the same priority. For now this will be used only to enforce priority of treesitter highlights. A single node in a treesitter tree may match multiple captures, in which case that node will have multiple extmarks set. The order in which captures are returned from the treesitter API is not _necessarily_ in the same order they are defined in a query file, so we use the new subpriority field to force that ordering. For now subpriorites are not documented and are not meant to be used by external code, and it only applies to ephemeral extmarks. We indicate the "private" nature of subpriorities by prefixing the field name with an "_".
| * refactor(lsp): client_hints typo #27250Maria José Solano2024-01-28
| |
| * docs: enforce "treesitter" spelling #27110Jongwook Choi2024-01-28
| | | | | | It's the "tree-sitter" project, but "treesitter" in our code and docs.
| * vim-patch:9.1.0049: Make "[Command Line]" a special buffer nameSean Dewar2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: E95 is possible if a buffer called "[Command Line]" already exists when opening the cmdwin. This can also happen if the cmdwin's buffer could not be deleted when closing. Solution: Un-name the cmdwin buffer, and give it a special name instead, similar to what's done for quickfix buffers and for unnamed prompt and scratch buffers. As a result, BufFilePre/Post are no longer fired when opening the cmdwin. Add a "command" key to the dictionary returned by getbufinfo() to differentiate the cmdwin buffer instead. (Sean Dewar) Cherry-pick test_normal changes from v9.0.0954. https://github.com/vim/vim/commit/1fb41032060df09ca2640dc49541f11062f6dfaa
| * revert: "feat(treesitter): add foldtext with treesitter highlighting"Till Bungert2024-01-27
| | | | | | This reverts commit 9ce1623 in favor of #20750.
| * feat: improve return type annotations for vim.api.*Lewis Russell2024-01-26
| |
| * vim-patch:9.1.0058: Cannot map Super Keys in GTK UI (#27204)zeertzjq2024-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot map Super Keys in GTK UI (Casey Tucker) Solution: Enable Super Key mappings in GTK using <D-Key> (Casey Tucker) As a developer who works in both Mac and Linux using the same keyboard, it can be frustrating having to remember different key combinations or having to rely on system utilities to remap keys. This change allows `<D-z>` `<D-x>` `<D-c>` `<D-v>` etc. to be recognized by the `map` commands, along with the `<D-S-...>` shifted variants. ```vimrc if has('gui_gtk') nnoremap <D-z> u nnoremap <D-S-Z> <C-r> vnoremap <D-x> "+d vnoremap <D-c> "+y cnoremap <D-v> <C-R>+ inoremap <D-v> <C-o>"+gP nnoremap <D-v> "+P vnoremap <D-v> "-d"+P nnoremap <D-s> :w<CR> inoremap <D-s> <C-o>:w<CR> nnoremap <D-w> :q<CR> nnoremap <D-q> :qa<CR> nnoremap <D-t> :tabe<CR> nnoremap <D-S-T> :vs#<CR><C-w>T nnoremap <D-a> ggVG vnoremap <D-a> <ESC>ggVG inoremap <D-a> <ESC>ggVG nnoremap <D-f> / nnoremap <D-g> n nnoremap <D-S-G> N vnoremap <D-x> "+x endif ``` closes: vim/vim#12698 https://github.com/vim/vim/commit/92e90a1e102825aa9149262cacfc991264db05df Co-authored-by: Casey Tucker <dctucker@hotmail.com>
| * docs: various fixes (#27063)dundargoc2024-01-25
| | | | | | | | | | | | Co-authored-by: lmenou <menl94629@gmail.com> Co-authored-by: altermo <107814000+altermo@users.noreply.github.com> Co-authored-by: VanaIgr <vanaigranov@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com>
| * feat(ui): add support for OSC 8 hyperlinks (#27109)Gregory Anders2024-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extmarks can contain URLs which can then be drawn in any supporting UI. In the TUI, for example, URLs are "drawn" by emitting the OSC 8 control sequence to the TTY. On terminals which support the OSC 8 sequence this will create clickable hyperlinks. URLs are treated as inline highlights in the decoration subsystem, so are included in the `DecorSignHighlight` structure. However, unlike other inline highlights they use allocated memory which must be freed, so they set the `ext` flag in `DecorInline` so that their lifetimes are managed along with other allocated memory like virtual text. The decoration subsystem then adds the URLs as a new highlight attribute. The highlight subsystem maintains a set of unique URLs to avoid duplicating allocations for the same string. To attach a URL to an existing highlight attribute we call `hl_add_url` which finds the URL in the set (allocating and adding it if it does not exist) and sets the `url` highlight attribute to the index of the URL in the set (using an index helps keep the size of the `HlAttrs` struct small). This has the potential to lead to an increase in highlight attributes if a URL is used over a range that contains many different highlight attributes, because now each existing attribute must be combined with the URL. In practice, however, URLs typically span a range containing a single highlight (e.g. link text in Markdown), so this is likely just a pathological edge case. When a new highlight attribute is defined with a URL it is copied to all attached UIs with the `hl_attr_define` UI event. The TUI manages its own set of URLs (just like the highlight subsystem) to minimize allocations. The TUI keeps track of which URL is "active" for the cell it is printing. If no URL is active and a cell containing a URL is printed, the opening OSC 8 sequence is emitted and that URL becomes the actively tracked URL. If the cursor is moved while in the middle of a URL span, we emit the terminating OSC sequence to prevent the hyperlink from spanning multiple lines. This does not support nested hyperlinks, but that is a rare (and, frankly, bizarre) use case. If a valid use case for nested hyperlinks ever presents itself we can address that issue then.
| * refactor: rewrite ruby provider in luadundargoc2024-01-24
| |
| * fix(treesitter): avoid # of nil in _query_linterDaniel Kongsgaard2024-01-24
| |
| * refactor: rewrite perl provider in luadundargoc2024-01-24
| |
| * fix(spell): always accept ':' as filename char in 'spellfile' (#27172)zeertzjq2024-01-24
| | | | | | Follow-up to #25236
| * fix(treesitter): prefix treesitter types with vimPhạm Huy Hoàng2024-01-24
| |
| * test: typing for screen.luaLewis Russell2024-01-23
| | | | | | | | | | Very rough buts resolves most diagnostic errors and should provide some useful hovers.
| * fix(diagnostic): fix typing on field |diagnostic-severity|Jongwook Choi2024-01-23
| | | | | | | | | | | | | | | | Problem: vim.diagnostic.{underline,float,virtual_text...}.severity will have a type warning on list-like or table (min-max) inputs, e.g. `vim.diagnostic.config { float = { severity = { min = INFO } } }`. Solution: Correct the typing as documented in |diagnostic-severity|.
| * refactor: rewrite python provider in luadundargoc2024-01-22
| |
| * docs(options): remove misleading sentence (#27129)zeertzjq2024-01-22
| | | | | | | | Setting 'verbose' to 1 doesn't cause Nvim to produce messages. It adds more information to existing messages, which is documented above.
| * feat(fold): transparent foldtextLewis Russell2024-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'foldtext' can be set to an empty string to disable and render the line with: - extmark highlight - syntax highlighting - search highlighting - no line wrapping - spelling - conceal - inline virtual text - respects `fillchars:fold` Currently normal virtual text is not displayed Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * Merge pull request #27076 from glepnir/extmark_hlgroupbfredl2024-01-22
| |\ | | | | | | refactor(api): use hl id directly in nvim_buf_set_extmark
| | * refactor(api): give "hl_group" more accurate _meta typebfredl2024-01-22
| | | | | | | | | | | | | | | These can either be number or string in lua, so we can specify this directly as "number|string".