aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* Merge #28637 more support for vim.lsp.ListOpts.loclistJustin M. Keyes2024-05-07
|\
| * feat(lsp): support vim.lsp.ListOpts.loclist in location_handler()tom-anders2024-05-07
| |
| * docs(lsp): document vim.lsp.ListOpts.loclisttom-anders2024-05-07
| |
| * refactor(lsp): use vim.cmd instead of api.nvim_commandtom-anders2024-05-07
| | | | | | | | | | | | As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1586878457 and https://github.com/neovim/neovim/pull/28483#discussion_r1586878226
| * docs(lsp): fix type annotations in response_to_list(...)tom-anders2024-05-07
| |
| * refactor(lsp): move repeated table construction into a variabletom-anders2024-05-07
| | | | | | | | As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1581712828
| * refactor(lsp): use vim.is_callable()tom-anders2024-05-07
| |
| * refactor(lsp): s/options/opts for parameters in vim.lsp.buftom-anders2024-05-07
| | | | | | | | See https://github.com/neovim/neovim/pull/28483#discussion_r1583344120
* | fix(lsp): rename LspProgress data.result => data.params #28632Jongwook Choi2024-05-07
|/ | | | | | | | | | | | Rename the field `result` to `params` in the `data` table for `LspProgress` autocmds. This aligns with LspNotify. The previous name was chosen because the initial handler implementation mistakenly had a parameter name `result` instead of `params` for the `$/progress` LSP "notification" handler. However, `params` would be a more appropriate name that is more consistent with the underlying LSP type (`ProgressParams`). See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#progress
* fix(treesitter): clip end row earlyJaehwang Jung2024-05-07
| | | | | | | | Problem: UINT32_MAX + 1 passed to vim._foldupdate. Solution: Clip the end row from treesitter asap to avoid such issues.
* fix(lsp): enable() does not activate inlay hints on open buffers #28629Yi Ming2024-05-07
| | | | | | | | | | | Problem: inlay_hint `enable(<no args>)` does not activate inlay hints on open buffers. If a buffer does not have a corresponding `bufstate` in `bufstates`, then `enable` all buffers will not take effect on it. Solution: Make the effective range determined by the loaded buffers. Fix #28624
* revert: default LSP mappings (#28649)Gregory Anders2024-05-06
| | | | | | | | | Revert the default LSP mappings before the 0.10 release as these might need some further consideration. In particular, it's not clear if "c" prefixed maps in Normal mode are acceptable as defaults since they interfere with text objects or operator ranges. We will re-introduce default mappings at the beginning of the 0.11 release cycle, this reversion is only for the imminent 0.10 release.
* refactor(snippet): rename exit() => stop() #28628Justin M. Keyes2024-05-06
|
* fix(defaults): diagnostic mappings descriptions #28646Evgeni Chasnovski2024-05-05
|
* docs: fix lua type warnings (#28633)Maria José Solano2024-05-05
|
* vim-patch:ad4881cb3c04 (#28636)zeertzjq2024-05-04
| | | | | | | runtime(doc): correct getscriptinfo() example (vim/vim#14718) When "sid" is specified, it returns a List with a single item. https://github.com/vim/vim/commit/ad4881cb3c04048242f69dc77af2dde889c9beea
* fix(treesitter): escape "\" in :InspectTree #28613Riley Bruins2024-05-03
| | | Some parsers for, e.g., LaTeX or PHP have anonymous nodes like `"\"` or `"\text"` that behave wonkily (especially the first example) in the `InspectTree` window, so this PR escapes them by adding another backslash in front of them
* fix(lsp): replace bug-prone ternary operation #28627Yi Ming2024-05-03
| | | ref #28624
* fix(vim.ui)!: change open() to return `result|nil, errmsg|nil` #28612Justin M. Keyes2024-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverts e0d92b9cc20b58179599f53dfa74ca821935a539 #28502 Problem: `vim.ui.open()` has a `pcall()` like signature, under the assumption that this is the Lua idiom for returning result-or-error. However, the `result|nil, errmsg|nil` pattern: - has precedent in: - `io.open` - `vim.uv` (`:help luv-error-handling`) - has these advantages: - Can be used with `assert()`: ``` local result, err = assert(foobar()) ``` - Allows LuaLS to infer the type of `result`: ``` local result, err = foobar() if err then ... elseif result then ... end ``` Solution: - Revert to the `result|nil, errmsg|nil` pattern. - Document the pattern in our guidelines.
* perf(extmarks): better track whether namespace has extmarks (#28615)zeertzjq2024-05-03
| | | | | | This avoids redraw when adding/removing an empty namespace for a window. This also avoids marktree traversal when clearing a namespace that has already been cleared, which is added as a benchmark.
* Merge #28101 nvim__redrawJustin M. Keyes2024-05-02
|\
| * feat(api): add nvim__redraw for more granular redrawingLuuk van Baal2024-05-02
| | | | | | | | | | | | | | | | | | | | | | Experimental and subject to future changes. Add a way to redraw certain elements that are not redrawn while Nvim is waiting for input, or currently have no API to do so. This API covers all that can be done with the :redraw* commands, in addition to the following new features: - Immediately move the cursor to a (non-current) window. - Target a specific window or buffer to mark for redraw. - Mark a buffer range for redraw (replaces nvim__buf_redraw_range()). - Redraw the 'statuscolumn'.
* | feat(lsp): inlay_hint.is_enabled({filter}) #28523Yi Ming2024-05-02
|/ | | vim.diagnostic.enable and vim.diagnostic.is_enabled() use the same pattern.
* feat(lsp): vim.lsp.inlay_hint.enable(nil) applies to all buffers #28543Yi Ming2024-05-02
| | | | | | | | | | | | | | | | | | Problem: Inlay hints `enable()` does not fully implement the `:help dev-lua` guidelines: Interface conventions ~ - When accepting a buffer id, etc., 0 means "current buffer", nil means "all buffers". Likewise for window id, tabpage id, etc. - Examples: |vim.lsp.codelens.clear()| |vim.diagnostic.enable()| Solution: Implement globally enabling inlay hints. * refactor(lsp): do not rely on `enable` to create autocmds * refactor(lsp): make `bufstates` a defaulttable * refactor(lsp): make `bufstate` inherit values from `globalstate` * feat(lsp): `vim.lsp.inlay_hints` now take effect on all buffers by default * test(lsp): add basic tests for enable inlay hints for all buffers * test(lsp): add test cases cover more than one buffer
* vim-patch:9.1.0390: filetype: inko files are not recognizedChristian Clason2024-05-02
| | | | | | | | | | | | | | | | Problem: filetype: inko files are not recognized Solution: Detect '*.inko' as ink filetype (Yorick Peterse) See: - https://github.com/inko-lang/inko.vim - https://inko-lang.org/ closes: vim/vim#14699 https://github.com/vim/vim/commit/a01968448a0bdf04d9e4a822d32732a304849238 Co-authored-by: Yorick Peterse <git@yorickpeterse.com>
* vim-patch:9.1.0389: filetype: templ files are not recognizedChristian Clason2024-05-02
| | | | | | | | | | | | | | | | Problem: filetype: templ files are not recognized Solution: Detect '*.templ' files as filetype templ (Tristan Knight) See: - https://github.com/a-h/templ - https://templ.guide/ closes: vim/vim#14697 https://github.com/vim/vim/commit/54e79157c536c631b2f9b3dfefec30b9b966ed97 Co-authored-by: tris203 <admin@snappeh.com>
* docs: add `hl-SnippetTabstop` tagEvgeni Chasnovski2024-05-02
|
* vim-patch:9.1.0386: filetype: stylus files not recognizedChristian Clason2024-05-02
| | | | | | | | | | | | | Problem: filetype: stylus files not recognized Solution: Detect '*.styl' and '*.stylus' as stylus filetype, include indent, filetype and syntax plugin (Philip H) closes: vim/vim#14656 https://github.com/vim/vim/commit/2d919d2744a99c9bb9e79984e85b8e8f5ec14c07 Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
* revert: "feat(extmarks): subpriorities (relative to declaration order) ↵Gregory Anders2024-05-01
| | | | | | | | | | | | (#27131)" (#28585) This reverts commit 15e77a56b711102fdc123e15b3f37d49bc0b1df1. Subpriorities were added in https://github.com/neovim/neovim/pull/27131 as a mechanism for enforcing query order when using iter_matches in the Tree-sitter highlighter. However, iter_matches proved to have too many complications to use in the highlighter so we eventually reverted back to using iter_captures (https://github.com/neovim/neovim/pull/27901). Thus, subpriorities are no longer needed and can be removed.
* vim-patch:9.1.0383: filetype: .out files recognized as tex filesChristian Clason2024-05-01
| | | | | | | | | | | | Problem: filetype: .out files recognized as tex files Solution: Do not set an explicit filetype until it is clear what this should be (shane.xb.qian) closes: vim/vim#14670 https://github.com/vim/vim/commit/e35478bc9d48189322432248105d3b24e0efb3d0 Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
* vim-patch:9.1.0382: filetype: Kbuild files are not recognizedChristian Clason2024-05-01
| | | | | | | | | | | | Problem: Kbuild files are not recognized. Solution: Detect Kbuild files as make files. (Bruno Belanyi) closes: vim/vim#14676 https://github.com/vim/vim/commit/5cbc9a69e529361e1725f422b8cd6157fe0adc33 Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
* docs(api): sort unreleased nvim__ functions last #28580Justin M. Keyes2024-04-30
|
* feat(diagnostic): revert default behaviour of goto_next/prev()Lewis Russell2024-04-30
| | | | | | | | | | | | | | | | | Follow-up to #28490 Problem: The new behaviour of goto_next/prev() of navigating to the next highest severity doesn't work well when diagnostic providers have different interpretations of severities. E.g. the user may be blocked from navigating to a useful LSP warning, due to some linter error. Solution: The behaviour of next highest severity is now a hidden option `_highest = true`. We can revisit how to integrate this behaviour during the 0.11 cycle.
* fix(api): mark nvim__complete_set as experimental #28579Justin M. Keyes2024-04-30
| | | | | | | | Problem: nvim_complete_set was added in 5ed55ff14c8b7e346811cb6228bf63fb5106bae9 but needs more bake time. Solution: Rename it, mark it as experimental.
* docs: misc #24163Justin M. Keyes2024-04-30
| | | | | | | | | | - Also delete old perl scripts which are not used since 8+ years ago. fix #23251 fix #27367 ref https://github.com/neovim/neovim/issues/2252#issuecomment-1902662577 Helped-by: Daniel Kongsgaard <dakongsgaard@gmail.com> Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
* docs: various fixes (#28208)dundargoc2024-04-30
| | | | | | | | | | Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Famiu Haque <famiuhaque@proton.me> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Guilherme Soares <guilhermesoares1970@gmail.com> Co-authored-by: Jannik Buhr <jannik.m.buhr@gmail.com> Co-authored-by: thomaswuhoileong <72001875+thomaswuhoileong@users.noreply.github.com> Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(lsp): redundant vim.snippet.jumpable #28560Maria José Solano2024-04-29
|
* feat(defaults): visual CTRL-R for LSP mappings #28537Justin M. Keyes2024-04-28
| | | | | | | | | | Problem: The new LSP "refactor menu" keybinding "crr" is also defined in visual mode, which overlaps with the builtin "c". Solution: Use CTRL-R instead of "crr" for visual mode. fix #28528
* feat(defaults): improve :grep defaults #28545Luna Saphie Mittelbach2024-04-28
| | | | | | Based on feedback from #28324, pass -H and -I to regular grep (available on all platforms officially supported by Neovim), and only pass -uu to ripgrep. This makes :grep ignore binary files by default in both cases.
* fix(diagnostic): get border from config (#28531)glepnir2024-04-28
| | | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com>
* fix(treesitter): enforce lowercase language names (#28546)Christian Clason2024-04-28
| | | | | | | | | | | * fix(treesitter): enforce lowercase language names Problem: On case-insensitive file systems (e.g., macOS), `has_parser` will return `true` for uppercase aliases, which will then try to inject the uppercase language unsuccessfully. Solution: Enforce and assume parser names to be lowercase when resolving language names.
* fix(snippet): do not add extra indent on newlines (#28538)Mathias Fußenegger2024-04-28
| | | | | | | | | | | | | | | | | | | | | | | Reverts parts of https://github.com/neovim/neovim/pull/27674 LSP snippets typically do include tabs or spaces to add extra indentation and don't rely on the client using `autoindent` functionality. For example: public static void main(String[] args) {\n\t${0}\n} Notice the `\t` after `{\n` Adding spaces or tabs independent of that breaks snippets for languages like Haskell where you can have snippets like: ${1:name} :: ${2}\n${1:name} ${3}= ${0:undefined} To generate: name :: name = undefined
* fix(diagnostic): invalid col number compare in next_diagnostic (#28397)Raphael2024-04-27
| | | | | Problem: when line is blank link then there will got an invalid column number in math.min compare. Solution: make sure the min column number is 0 not an illegal number.
* vim-patch:fe1e2b5e2d65zeertzjq2024-04-27
| | | | | | | | | | runtime(doc): clarify syntax vs matching mechanism fixes: vim/vim#14643 https://github.com/vim/vim/commit/fe1e2b5e2d65f05d820f17db935b15454a63be06 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(lsp): change `silent` in lsp.start.Opts to optional (#28524)Mathias Fußenegger2024-04-26
|
* feat(diagnostic): add default mappings for diagnostics (#16230)Gregory Anders2024-04-26
|
* feat(lsp): add more LSP defaults (#28500)Gregory Anders2024-04-26
| | | | | | - crn for rename - crr for code actions - gr for references - <C-S> (in Insert mode) for signature help
* refactor(vim.iter)!: rename xxback() => rxx() #28503Justin M. Keyes2024-04-26
| | | | | | | | | | | | | | | | Problem: vim.iter has both `rfind()` and various `*back()` methods, which work in "reverse" or "backwards" order. It's inconsistent to have both kinds of names, and "back" is fairly uncommon (rust) compared to python (rfind, rstrip, rsplit, …). Solution: - Remove `nthback()` and let `nth()` take a negative index. - Because `rnth()` looks pretty obscure, and because it's intuitive for a function named `nth()` to take negative indexes. - Rename `xxback()` methods to `rxx()`. - This informally groups the "list-iterator" functions under a common `r` prefix, which helps discoverability. - Rename `peekback()` to `pop()`, in duality with the existing `peek`.
* fix(lsp): ensure buffer is not attached more than onceLewis Russell2024-04-26
| | | | | | | | | | | | | | Fixes regression introduced in #28030 If an LSP server is restarted, then the associated `nvim_buf_attach` call will not detach if no buffer changes are sent between the client stopping and a new one being created. This leads to `nvim_buf_attach` being called multiple times for the same buffer, which then leads to changetracking sending duplicate requests to the server (one per attach). To solve this, introduce separate tracking (client agnostic) on which buffers have had calls to `nvim_buf_attach`.
* fix: lua annotationsLewis Russell2024-04-26
|