summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim
AgeCommit message (Collapse)AuthorFiles
2024-01-14docs(builtin): fix mapset() signature (#27008)zeertzjq1
2024-01-11fix(doc): improve doc generation of types using lpegLewis Russell10
Added a lpeg grammar for LuaCATS and use it in lua2dox.lua
2024-01-10feat(vim.iter): add Iter:flatten (#26786)JD1
Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-09feat(terminal): trigger TermRequest autocommand events (#22159)Ghjuvan Lacambre1
This commit implements a new TermRequest autocommand event and has Neovim emit this event when children of terminal buffers emit an OSC or DCS sequence libvterm does not handle. The TermRequest autocommand event has additional data in the v:termrequest variable. Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-09fix(docs): make lines not overflow in vim docsJongwook Choi1
Problem: Some lines in the generated vim doc are overflowing, not correctly wrapped at 78 characters. This happens when docs body contains several consecutive 'inline' elements generated by doxygen. Solution: Take into account the current column offset of the last line, and prepend some padding before doc_wrap().
2024-01-08docs(treesitter): improve 'no parser' error message for InspectTreeJongwook Choi2
Improve error messages for `:InspectTree`, when no parsers are available for the current buffer and filetype. We can show more informative and helpful error message for users (e.g., which lang was searched for): ``` ... No parser available for the given buffer: +... no parser for 'custom_ft' language, see :help treesitter-parsers ``` Also improve the relevant docs for *treesitter-parsers*.
2024-01-06fix(defaults): use augroup for default autocommands (#26933)Gregory Anders1
2024-01-05vim-patch:9.1.0010: Keymap completion is not available (#26888)zeertzjq1
Problem: Keymap completion is not available Solution: Add keymap completion (Doug Kearns) Add keymap completion to the 'keymap' option, user commands and builtin completion functions. closes: vim/vim#13692 https://github.com/vim/vim/commit/81642d9d6ff5cd6a90a012b1b98632ce51eeb1a8 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-01-04Merge pull request #26791 from wookayin/gendocLewis Russell4
refactor(gen_vimdoc): general refactoring on vimdoc generation
2024-01-04refactor(column): define and use maximum 'statuscolumn' widthLuuk van Baal1
Problem: The maximum 'statuscolumn' width and grow behavior is undocumented. Solution: Define, use and document the maximum 'statuscolumn' width and grow behavior.
2024-01-04fix(decorations): validate botline for on_winJaehwang Jung1
Problem: Many decoration providers (treesitter injection highlighting, semantic token highlighting, inlay hint) rely on the correctness of the `botline` argument of `on_win` callback. However, `botline` can be smaller than the actual line number of the last displayed line if some lines are folded. In such cases, some decorations will be missing in the lines not covered by `botline`. Solution: Validate `botline` when invoking `on_win`. NOTE: It seems that the old code was deliberately avoiding this presumably due to performance reasons. However, I haven't experienced noticeable lag after this change, and I believe the cost of botline computation would be much smaller than the cost of decoration providers.
2024-01-03feat(lua): add noref to deepcopyLewis Russell6
Problem: Currently `deepcopy` hashes every single tables it copies so it can be reused. For tables of mostly unique items that are non recursive, this hashing is unnecessarily expensive Solution: Port the `noref` argument from Vimscripts `deepcopy()`. The below benchmark demonstrates the results for two extreme cases of tables of different sizes. One table that uses the same table lots of times and one with all unique tables. | test | `noref=false` (ms) | `noref=true` (ms) | | -------------------- | ------------------ | ----------------- | | unique tables (50) | 6.59 | 2.62 | | shared tables (50) | 3.24 | 6.40 | | unique tables (2000) | 23381.48 | 2884.53 | | shared tables (2000) | 3505.54 | 14038.80 | The results are basically the inverse of each other where `noref` is much more performance on tables with unique fields, and `not noref` is more performant on tables that reuse fields.
2024-01-02docs(lsp): add supports_method to vim.lsp.client docs (#26852)Mathias Fußenegger1
2024-01-02refactor(gen_vimdoc): generate function doc from metadata, not from xmlJongwook Choi1
Problem: For function definitions to be included in the vimdoc (formatted) and to be exported as mpack data (unformatted), we had two internal representations of the same function/API metadata in duplicate; one is FunctionDoc (which was previously a dict), and the other is doxygen XML DOM from which vimdoc (functions sections) was generated. Solution: We should have a single path and unified data representation (i.e. FunctionDoc) that contains all the metadata and information about function APIs, from which both of mpack export and vimdoc are generated. I.e., vimdocs are no longer generated directly from doxygen XML nodes, but generated via: (XML DOM Nodes) ------------> FunctionDoc ------> mpack (unformatted) Recursive Internal | Formatting Metadata +---> vimdoc (formatted) This refactoring eliminates the hacky and ugly use of `fmt_vimhelp` in `fmt_node_as_vimhelp()` and all other helper functions! This way, `fmt_node_as_vimhelp()` can simplified as it no longer needs to handle generating of function docs, which needs to be done only in the topmost level of recursion.
2024-01-02fix(docs): clean up non-docstring comments for vimdoc genJongwook Choi3
These non-docstring comments can be included into doxygen's brief description and then appear in the succeeding function documentation.
2024-01-02docs(glob): add glob module (#26853)Mathias Fußenegger1
2024-01-02vim-patch:10b4f75d4c03 (#26846)zeertzjq1
runtime(dist/ft): improve filetype detection for *.v (V/Verilog/Coq) Patch provided by Dan Alt closes: vim/vim#13793 https://github.com/vim/vim/commit/10b4f75d4c03c1cd4f579be5fdc812ba41b72fef Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-02refactor(lsp): fix remaining luals warnings in lsp.rpcMathias Fussenegger1
2024-01-02feat(lsp): support connect via named pipes/unix domain sockets (#26032)TheLeoP1
Closes https://github.com/neovim/neovim/issues/26031 Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-01-01feature(diagnostic): add `vim.diagnostic.count()` (#26807)Evgeni Chasnovski1
feat(diagnostic): add `vim.diagnostic.count()` Problem: Getting diagnostic count based on the output of `vim.diagnostic.get()` might become costly as number of diagnostic entries grows. This is because it returns a copy of diagnostic cache entries (so as to not allow users to change them in place). Getting information about diagnostic count is frequently used in statusline, so it is important to be as fast as reasonbly possible. Solution: Add `vim.diagnostic.count()` which computes severity counts without making copies.
2024-01-01refactor(health): refactor provider healthchecksGregory Anders1
* Prefer pure Lua functions over vim.fn * Split up provider healthchecks into separate modules to help manage complexity
2024-01-01docs: clarify on_bytes argumentsJaehwang Jung1
based on extmark_splice doc
2023-12-31fix(builtin): parameter mismatch between winsaveview and winrestviewaltermo1
2023-12-30refactor: fix luals warningsdundargoc11
2023-12-28docs(eval): add parameter type for vim.fn.mode() (#26776)xvzc1
2023-12-28docs: small fixes (#26651)dundargoc3
Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: WillLillis <wlillis@umass.edu>
2023-12-27revert: "fix: correct versions in deprecation warnings"dundargoc1
This reverts commit 5cb906e91cb56302d0737aa80e2d890dde452029. They were intentionally fast-tracked. - `parse_snippet()` because of limited scope, and given that it's kinda semi-broken (arbitrary formatting rules, not that useful for what it was used for) - `extract_completion_items()` doesn't work if we want to add the LSP completionlist capability - `text_document_completion_list_to_complete_items()` also doesn't work for completionlist
2023-12-27fix(gen_lsp.lua): improve type name, and fix wrong type inheritanceJongwook Choi1
Style improvements: 1. Anonymous classes derived from `StructureLiteralType` should have a better name. The class name can be also nested. Examples: ```diff ----@field serverInfo? anonym1 +---@field serverInfo? lsp._anonym1.serverInfo ``` ```diff ----@field insertTextModeSupport? anonym26 +---@field insertTextModeSupport? lsp._anonym26.completionItem.insertTextModeSupport ``` 2. Add one separate empty line before each `@field` definition. Without these, empty lines the doc can look confusing because descriptions also may contain empty lines. See `lsp.CompletionItem` for example: ```lua ---The kind of this completion item. Based of the kind ---an icon is chosen by the editor. ---@field kind? lsp.CompletionItemKind ---Tags for this completion item. --- ---@since 3.15.0 ---@field tags? lsp.CompletionItemTag[] ``` It might feel like "Tags for this completion item" belongs to `kind`, not `tags` due to the lack of separator blank lines. The following (after this commit) should look much better: ```diff ---The kind of this completion item. Based of the kind ---an icon is chosen by the editor. ---@field kind? lsp.CompletionItemKind +--- ---Tags for this completion item. --- ---@since 3.15.0 ---@field tags? lsp.CompletionItemTag[] ``` 3. Escape some LSP-specific annotations that can't be recognized by lua-ls. It'd be better to make them visible in LSP hover doc windows. Example: `@sample ...`. Fixes: 1. A type may extend from more than one base types (as well as mixin types). Previously only the first base class was being considered, resulting incomplete base classes for `@class` definitions. Example: `InlayHintOptions` (should have both of `resolveProvider` and `workDoneProgress`, the latter is from `WorkDoneProgressOptions`) ```diff ----@class lsp.InlayHintOptions +---@class lsp.InlayHintOptions: lsp.WorkDoneProgressOptions ``` 2. Remove `<200b>` (zero-width space) unicode characters. 3. Add the missing newline at EOF.
2023-12-27docs(gen_lsp.lua): re-generate vim.lsp._meta.protocol type annotationsJongwook Choi2
The purpose of this commit is to make diff clean and easy to read; to see the diff resulted from actual changes in gen_lsp.lua, not from the updated LSP protocol JSON data. Ran: `nvim -l scripts/gen_lsp.lua gen --methods` Based on 3.18.0 (2023-12-23)
2023-12-27feat(defaults): map Q and @x to repeat in Visual mode (#26495)Nacho Nieva1
2023-12-27fix: correct versions in deprecation warningsdundargoc1
The following functions should be removed in 0.12 according to the deprecation strategy in MAINTAIN.md: - vim.lsp.util.extract_completion_items() - vim.lsp.util.parse_snippet() - vim.lsp.util.text_document_completion_list_to_complete_items()
2023-12-27refactor: use vim.deprecate on all deprecated functionsdundargoc6
2023-12-26feat(extmarks): add virt_text_repeat_linebreak flag (#26625)luukvbaal2
Problem: Unable to predict which byte-offset to place virtual text to make it repeat visually in the wrapped part of a line. Solution: Add a flag to nvim_buf_set_extmark() that causes virtual text to repeat in wrapped lines.
2023-12-25feat(vim.deprecate): only issue warning if neovim version is high enoughdundargoc1
As specified by MAINTAIN.md, features should be soft deprecated at first (meaning no warnings) to give people a chance to adjust. The problem with this approach is that deprecating a feature becomes harder than usual as during the soft deprecation period you need to remember not to issue a warning, and during the hard deprecation period you need to remember to start issuing a warning. This behavior is only enforced if the `plugin` parameter is `nil` as plugins may not want this specific behavior.
2023-12-25refactor(cpoptions): remove 'p'bfredl1
Deleting a cpo flag a day keeps the doctor away We don't need two different ways to indent LISP code
2023-12-25feat(health): make :checkhealth support more split modifiers (#26731)zeertzjq1
2023-12-25feat(health): checkhealth buffer can show in a split window (#26714)Pablo Arias1
:checkhealth now respects :vertical and :horizontal. For example: :vertical checkhealth foo bar will open the healthcheck buffer in a vertical split.
2023-12-24fix(treesitter): outdated highlight due to tree with outdated regionJaehwang Jung1
Problem: A region managed by an injected parser may shrink after re-running the injection query. If the updated region goes out of the range to be parsed, then the corresponding tree will remain outdated, possibly retaining the nodes that shouldn't exist anymore. This results in outdated highlights. Solution: Re-parse an invalid tree if its region intersects the range to be parsed.
2023-12-22fix(lsp): filetype matching to documentSelector in dynamic capabilities (#25425)Michal Liszcz2
Use the get_language_id client option to resolve the filetype when matching the document selector in a dynamic capability. Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-12-22refactor(lsp): move glob parsing to util (#26519)Steven Arcangeli5
refactor(lsp): move glob parsing to vim.glob Moving the logic for using vim.lpeg to create a match pattern from a glob into `vim.glob`. There are several places in the LSP spec that use globs, and it's very useful to have glob matching as a generally-available utility.
2023-12-22feat(lsp): add type annotations for lsp.util.locations_to_items (#26694)Mathias Fußenegger1
Problem: luals reported many warnings Solution: Add type annotations
2023-12-22docs(options): add codeblock annotations to options.lua (#26696)Christian Clason1
Also consistently remove leading colons in examples Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-12-22vim-patch:9.0.2183: Maximum callback depth is not configurable (#26703)zeertzjq1
Problem: Maximum callback depth is not configurable. Solution: Revert patch 9.0.2103. Set 'maxfuncdepth' in test. fixes: vim/vim#13732 closes: vim/vim#13736 https://github.com/vim/vim/commit/fe583b1e5987fbfdb5f2141c133dbff9665ed301
2023-12-21feat: generate types and docs for v variablesLewis Russell1
2023-12-21fix(osc52): use nvim_chan_send() to stderr for copying (#26690)zeertzjq1
The data to be written can be very long, so use nvim_chan_send() instead of io.stdout:write() as the latter doesn't handle EAGAIN. A difference of these two approaches is that nvim_chan_send() writes to stderr, not stdout, so it won't work if client stderr is redirected.
2023-12-20docs: apply current colorscheme to default highlight groupsChristian Clason1
Problem: Not all default highlight groups show their actual colors. Solution: Refactor `vimhelp.lua` and apply it to all relevant lists (UI groups, syntax groups, treesitter groups, LSP groups, diagnostic groups).
2023-12-20refactor(treesitter): cleanup highlighterLewis Russell1
- Remove some unused fields - Prefix classes with `vim.` - Move around some functions so the query stuff is at the top. - Improve type hints - Rework how hl_cache is implemented
2023-12-19vim-patch:9.0.2179: no filetype detection for execline scriptsChristian Clason2
Problem: no filetype detection for execline scripts Solution: Add filetype detection for execline as a prior to adding syntax support for execline (see https://github.com/djpohly/vim-execline/issues/2), i went ahead and made the filetype detection for execline scripts. closes: vim/vim#13689 Signed-Off-By: Mazunki Hoksaas <rolferen@gmail.com> https://github.com/vim/vim/commit/63210c214afa6589b6132bd060908a8711f4567f Co-authored-by: Mazunki Hoksaas <rolferen@gmail.com>
2023-12-19fix(treesitter): prepare highlight states for [s, ]sJaehwang Jung1
2023-12-19docs: small fixes (#26448)dundargoc1
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com> Co-authored-by: Jordan Mandel <jordan.mandel@live.com>