aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
| * | vim-patch:9.1.0421: filetype: hyprlang files are not recognizedChristian Clason2024-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: hyprlang files are not recognized Solution: recognize 'hypr{land,paper,idle,lock}.conf' files as 'hyprlang' filetype, add hyprlang ftplugin (Riley Bruins) closes: vim/vim#14803 https://github.com/vim/vim/commit/5f1b115afd92544ce64d563da0d8ee9844abb10a Co-authored-by: Riley Bruins <ribru17@hotmail.com>
| * | fix(diagnostic): show backtrace for deprecation warningsJongwook Choi2024-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: On nvim 11.0-dev, deprecation warnings due to an use of hard-deprecated APIs such as: - `vim.diagnostic.disable()` - `vim.diagnostic.is_disabled()` etc. are not accompanied by backtrace information. It makes difficult for users to figure out which lines or which plugins are still using deprecated APIs. Solution: use `backtrace = true` in vim.deprecate() call.
| * | refactor!: remove `nvim` and `provider` module for checkhealthdundargoc2024-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The namespacing for healthchecks for neovim modules is inconsistent and confusing. The completion for `:checkhealth` with `--clean` gives ``` nvim provider.clipboard provider.node provider.perl provider.python provider.ruby vim.lsp vim.treesitter ``` There are now three top-level module names for nvim: `nvim`, `provider` and `vim` with no signs of stopping. The `nvim` name is especially confusing as it does not contain all neovim checkhealths, which makes it almost a decoy healthcheck. The confusion only worsens if you add plugins to the mix: ``` lazy mason nvim nvim-treesitter provider.clipboard provider.node provider.perl provider.python provider.ruby telescope vim.lsp vim.treesitter ``` Another problem with the current approach is that it's not easy to run nvim-only healthchecks since they don't share the same namespace. The current approach would be to run `:che nvim vim.* provider.*` and would also require the user to know these are the neovim modules. Instead, use this alternative structure: ``` vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` and ``` lazy mason nvim-treesitter telescope vim.health vim.lsp vim.provider.clipboard vim.provider.node vim.provider.perl vim.provider.python vim.provider.ruby vim.treesitter ``` Now, the entries are properly sorted and running nvim-only healthchecks requires running only `:che vim.*`.
| * | fix(vim.iter): enable optimizations for arrays (lists with holes) (#28781)Gregory Anders2024-05-17
| | | | | | | | | | | | | | | | | | | | | | | | The optimizations that vim.iter uses for array-like tables don't require that the source table has no holes. The only thing that needs to change is the determination if a table is "list-like": rather than requiring consecutive, integer keys, we can simply test for (positive) integer keys only, and remove any holes in the original array when we make a copy for the iterator.
| * | fix(health): broken ruby detect #28804MoonFruit2024-05-17
| | |
| * | fix: extend the life of vim.tbl_flatten to 0.13Lewis Russell2024-05-16
| | | | | | | | | | | | | | | `vim.iter(t):flatten():totable()` doesn't handle nil so isn't a good enough replacement.
| * | feat: remove deprecated featuresdundargoc2024-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove following functions: - vim.lsp.util.extract_completion_items - vim.lsp.util.get_progress_messages - vim.lsp.util.parse_snippet() - vim.lsp.util.text_document_completion_list_to_complete_items - LanguageTree:for_each_child - health#report_error - health#report_info - health#report_ok - health#report_start - health#report_warn - vim.health.report_error - vim.health.report_info - vim.health.report_ok - vim.health.report_start - vim.health.report_warn
| * | perf(treesitter): use child_containing_descendant() in has-ancestor? (#28512)vanaigr2024-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `has-ancestor?` is O(n²) for the depth of the tree since it iterates over each of the node's ancestors (bottom-up), and each ancestor takes O(n) time. This happens because tree-sitter's nodes don't store their parent nodes, and the tree is searched (top-down) each time a new parent is requested. Solution: Make use of new `ts_node_child_containing_descendant()` in tree-sitter v0.22.6 (which is now the minimum required version) to rewrite the `has-ancestor?` predicate in C to become O(n). For a sample file, decreases the time taken by `has-ancestor?` from 360ms to 6ms.
| * | docs: misc (#28761)dundargoc2024-05-16
| | | | | | | | | Co-authored-by: Florian Zeitz <florob@babelmonkeys.de>
| * | vim-patch:5faeb60480c6 (#28768)zeertzjq2024-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime(doc): clarify {special} argument for shellescape() closes: vim/vim#14770 https://github.com/vim/vim/commit/5faeb60480c6efba5c0468c01275120b6ace5a09 N/A patch: vim-patch:c0e038b59f84 Co-authored-by: Enno <Konfekt@users.noreply.github.com>
| * | docs: newsJustin M. Keyes2024-05-15
| | | | | | | | | | | | Set dev_xx.txt help files to use "flow" layout.
| * | perf(lua): avoid spairs in vim.validate happy pathLewis Russell2024-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.validate` is too slow, mainly because of `vim.spairs`. Solution: Collect all errors in via `pairs`, and sort the errors via `spairs`.
| * | perf(vim.fs.normalize): use iteratorLewis Russell2024-05-15
| | | | | | | | | | | | ~10% faster.
| * | perf(loader): use a quicker version of vim.fs.normalizeLewis Russell2024-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: vim.fs.normalize() normalizes too much vim.loader and is slow. Solution: Make it faster by doing less. This reduces the times spent in vim.fs.normalize in vim.loader from ~13ms -> 1-2ms. Numbers from a relative benchmark: - Skipping `vim.validate()`: 285ms -> 230ms - Skipping `path_resolve_dot()`: 285ms -> 60ms - Skipping `double_slash`: 60ms -> 35ms
| * | docs: misc (#28609)dundargoc2024-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/neovim/neovim/issues/28484. Closes https://github.com/neovim/neovim/issues/28719. Co-authored-by: Chris <crwebb85@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jake B <16889000+jakethedev@users.noreply.github.com> Co-authored-by: Jonathan Raines <jonathan.s.raines@gmail.com> Co-authored-by: Yi Ming <ofseed@foxmail.com> Co-authored-by: Zane Dufour <zane@znd4.me> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * | fix(lsp): don't start additional client if attach failed (#28744)Mathias Fußenegger2024-05-14
| | | | | | | | | | | | If a client for a server was already running and lsp.start was called in an unloaded buffer it started another client instead of bailing out.
| * | fix(treesitter): allow optional directive captures (#28664)Riley Bruins2024-05-14
| | |
| * | fix(health): clients may not support watchfiles #28710Maria José Solano2024-05-14
| | |
| * | feat(lsp): update LSP protocol 3.18 typings to date (#28730)Jongwook Choi2024-05-14
| | | | | | | | | | | | Make the LSP protocol typings up-to-date with LSP protocol (upcoming) version 3.18, before and in preparation for the Nvim 0.10.0 release.
| * | perf(lsp): only joinpath for dirs in watchdirsMathias Fussenegger2024-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doesn't have a huge impact, but showed up in profile output using `require("jit.p").start("i1", "/tmp/profile")` before: 31% joinpath 25% fs.lua:0 13% normalize 13% skip 8% _watchfunc 5% gsplit 3% spairs after: 34% skip 29% fs.lua:0 12% joinpath 7% normalize 5% _watchfunc 5% spairs
| * | perf(fs): normalize path only once in fs.dirMathias Fussenegger2024-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-normalizing a path after a `joinpath` isn't necessary. Calling `normalize` on each child directory had quite a bit of impact when traversing a large directory. A simple test showed: Before: ~144ms After: ~80ms running the following logic against a dir with 4367 child folders and 25826 files: local files = {} local start = uv.hrtime() for name, type in vim.fs.dir(path, { depth = max_depth }) do table.insert(files, { name, type }) end local duration = uv.hrtime() - start Relates to https://github.com/neovim/neovim/issues/23291
| * | refactor(lua): remove deprecated features #28725Justin M. Keyes2024-05-13
| | |
| * | fix(treesitter): text alignment in checkhealth vim.treesitterJongwook Choi2024-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The column width 10 for parser name (lang) is too short. For example, `markdown_inline` has 15 characters, which results in a slight misalignment with other lines. e.g. it looked like: ``` - OK Parser: markdown ABI: 14, path: .../parser/markdown.so - OK Parser: markdown_inline ABI: 14, path: .../parser/markdown_inline.so - OK Parser: php ABI: 14, path: .../parser/php.so ``` Solution: Use column width 20. As of now, the longest name among those available in nvim-treesitter has length 18 (`haskell_persistent`). e.g.: ``` - OK Parser: markdown ABI: 14, path: .../parser/markdown.so - OK Parser: markdown_inline ABI: 14, path: .../parser/markdown_inline.so - OK Parser: php ABI: 14, path: .../parser/php.so ```
| * | refactor(api): nvim_win_xx_ns are EXPERIMENTALJustin M. Keyes2024-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The nvim_win_xx_ns function family introduced in ba0370b1d718d473d0ef51c35d88b98ba220082b needs more bake-time. Currently it's narrowly defined for windows, but other scopes ("buffer") and features are likely in the future. Solution: - Rename the API with double-underscore to mark it as EXPERIMENTAL. TODO/FUTURE: - Rename and change the signature to support more than just "window" scope, and for other flexibility. - Open question: we could choose either: - "store scopes on namespaces", or - "store namespaces on scopes (w:/b:/…)"
| * | refactor(api): rename nvim_win_remove_nsJustin M. Keyes2024-05-12
| |/ | | | | | | | | | | | | | | Problem: nvim_win_remove_ns does not follow `help dev-naming` API naming conventions. Solution: Rename it.
| * vim-patch:9.1.0402: filetype: mdd files detected as zsh filetypeChristian Clason2024-05-11
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: mdd files detected as zsh filetype Solution: detect '*.mdd' files as sh filetype, add links to reference documentation (Wu, Zhenyu) closes: vim/vim#14741 https://github.com/vim/vim/commit/63f2a5b8adfb570792b9a7cbfff1c350913bbe3e Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
| * vim-patch:9.1.0401: filetype: zsh module files are not recognizedChristian Clason2024-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: zsh module files are not recognized Solution: Detect '*.mdh' and '*.epro' as C filetype, '*.mdd' as zsh filetype, determine zsh-modules '*.pro' from from it's content (Wu, Zhenyu) closes: vim/vim#14737 https://github.com/vim/vim/commit/887a38cee78c472fe406da60751fbba4a6ec19dd Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
| * fix(lsp): disable didChangeWatchedFiles on LinuxLewis Russell2024-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The file watcher backends for Linux have too many limitations and doesn't work reliably. Solution: disable didChangeWatchedFiles on Linux Ref: #27807, #28058, #23291, #26520
| * vim-patch:9.1.0396: filetype: jj files are not recognized (#28672)Gregory Anders2024-05-08
| | | | | | | | | | | | | | | | | | | | | | Problem: jj files are not recognized Solution: recognize '*.jjdescription' files as jj filetype (Gregory Anders) See: https://github.com/martinvonz/jj closes: vim/vim#14733 https://github.com/vim/vim/commit/6a4ea471d28107c4078e106ace1bdc0c54bf946b
| * 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
| |\