aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* docs(builtin): fix some missing lines (#24759)Sean Dewar2023-08-17
| | | | Some things got chopped off in the PR that removed method syntax examples. These were all that I found.
* vim-patch:8.2.4455: accepting one and zero for second sort() argument is strangezeertzjq2023-08-17
| | | | | | | | | Problem: Accepting one and zero for the second sort() argument is strange. Solution: Disallow using one and zero in Vim9 script. https://github.com/vim/vim/commit/2007dd49f5cb36f944cab1cfbceb0f864e625f74 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:8.2.3849: functions implementing reduce and map are too longzeertzjq2023-08-17
| | | | | | | | | | | | Problem: Functions implementing reduce and map are too long. Solution: Use a function for each type of value. Add a few more test cases and add to the help. (Yegappan Lakshmanan, closes vim/vim#9370) https://github.com/vim/vim/commit/389b72196e6aaeafe3f907c73d271f2c6b931140 Partial port as this doesn't include handling for non-materialized List. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.3848: cannot use reduce() for a stringzeertzjq2023-08-17
| | | | | | | | | | | Problem: Cannot use reduce() for a string. Solution: Make reduce() work with a string. (Naruhiko Nishino, closes vim/vim#9366) https://github.com/vim/vim/commit/0ccb5842f5fb103763d106c7aa364d758343c35a Omit tv_get_first_char() as it doesn't really save much code. Co-authored-by: rbtnn <naru123456789@gmail.com>
* vim-patch:8.2.3818: cannot filter or map characters in a stringzeertzjq2023-08-17
| | | | | | | | | | Problem: Cannot filter or map characters in a string. Solution: Make filter() and map() work on a string. (Naruhiko Nishino, closes vim/vim#9327) https://github.com/vim/vim/commit/c479ce032f5d4d14bab9e479acbf42d758879893 Co-authored-by: rbtnn <naru123456789@gmail.com>
* vim-patch:1b884a005398zeertzjq2023-08-17
| | | | | | | | Update runtime files. https://github.com/vim/vim/commit/1b884a0053982335f644eec6c71027706bf3c522 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1969: Vim9: map() may change the list or dict item typezeertzjq2023-08-17
| | | | | | | | | Problem: Vim9: map() may change the list or dict item type. Solution: Add mapnew(). https://github.com/vim/vim/commit/ea696852e7abcdebaf7f17a7f23dc90df1f5e2ed Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat(diagnostic): filter diagnostics by specific severities (#24736)Michael Strobel2023-08-16
| | | Allow users to filter diagnostics by specifying severities
* feat(diagnostic): provide more control over virtual text display (#24724)Gregory Anders2023-08-16
| | | | | | Allow users to pass virtual text options to nvim_buf_set_extmark through the "virtual_text" table in vim.diagnostic.config(). Fixes: https://github.com/neovim/neovim/issues/16545
* docs(lua): add missing fields to treesitter/_metaPham Huy Hoang2023-08-16
| | | | | | | | According to `:h TSNode` docs, there's also `TSNode:sexpr()` and `TSNode:has_error()` that is part of `TSNode` class, but this wasn't documented in `treesitter/_meta.lua`. Adding missing fields in so the types is similar to `:h TSNode`
* vim-patch:9.0.1717: virtcol2col returns last byte of a multi-byte char (#24729)zeertzjq2023-08-16
| | | | | | | | | | | Problem: virtcol2col returns last byte of a multi-byte char Solution: Make it return the first byte for a multi-byte char closes: vim/vim#12786 closes: vim/vim#12799 https://github.com/vim/vim/commit/b209b86e6636a16088ccacdac98213416c065bf2 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)zeertzjq2023-08-15
| | | | | | | | | | Problem: Cannot use positional arguments for printf() Solution: Support positional arguments in string formatting closes: vim/vim#12140 https://github.com/vim/vim/commit/0c6181fec4c362eb9682d5af583341eb20cb1af5 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* fix(treesitter)!: remove deprecated legacy injection formatChristian Clason2023-08-14
|
* Merge #15440 close 'shell' :terminal automaticallyJustin M. Keyes2023-08-13
|\
| * Use Lua autocommand and make TermClose autocommand globalGregory Anders2023-08-10
| |
* | fix(treesitter): logger memory leakLewis Russell2023-08-13
| |
* | feat(treesitter)!: incremental injection parsingLewis Russell2023-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Treesitter highlighting is slow for large files with lots of injections. Solution: Only parse injections we are going to render during a redraw cycle. --- - `LanguageTree:parse()` will no longer parse injections by default and now requires an explicit range argument to be passed. - `TSHighlighter` now parses injections incrementally during on_win callbacks for the line range being rendered. - Plugins which require certain injections to be parsed must run `parser:parse({ start_row, end_row })` before using the tree.
* | vim-patch:9.0.1688: cannot store custom data in quickfix list (#24673)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | | | Problem: cannot store custom data in quickfix list Solution: add `user_data` field for the quickfix list closes: vim/vim#11818 https://github.com/vim/vim/commit/ca6ac99077d2e6d020a34267aa5e0fbc4d23dc38 Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
* | vim-patch:9.0.1686: undotree() only works for the current buffer (#24665)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | | | | | | | Problem: undotree() only works for the current buffer Solution: Add an optional "buffer number" parameter to undotree(). If omitted, use the current buffer for backwards compatibility. closes: vim/vim#4001 closes: vim/vim#12292 https://github.com/vim/vim/commit/5fee11114975b7405b7ccd3ee8758e54bf559760 Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
* | feat(treesitter): add injection language fallback (#24659)Christian Clason2023-08-11
| | | | | | | | | | | | | | | | | | | | | | | | * feat(treesitter): add injection language fallback Problem: injection languages are often specified via aliases (e.g., filetype or in upper case), requiring custom directives. Solution: include lookup logic (try as parser name, then filetype, then lowercase) in LanguageTree itself and remove `#inject-language` directive. Co-authored-by: Lewis Russell <me@lewisr.dev>
* | fix(lsp): extra "." when completing with tsserver #24646Raphael2023-08-11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: With tsserver LSP, omni completion after "." inserts an extra "." Solution: Apply adjust_start_col() regardless of `filterText`. adjust_start_col() is explained here: https://github.com/neovim/neovim/blob/0ea8dfeb3dc347579753169d9e3588f6306ab703/runtime/lua/vim/lsp.lua#L2334-L2351 The `filterText` field is used in the following situations rather than as a condition for obtaining column values: 1. Real-time filtering: When the user types characters in the editor, the language server can use the filterText field to filter the list of suggestions and only return suggestions that match the typed characters. This helps to provide more precise recommendations. 2. Fuzzy matching: The filterText field can be used to perform fuzzy matching, allowing matching in the middle or beginning of input characters, not limited to prefix matching. This can provide a more flexible code completion experience. Inspecting usage of `filtertext` in vim-lsp and coc and lsp-mode: - vim-lsp uses a `refresh_pattern` to judge filterText as completionitem word (although I think this is not the correct usage). - coc uses it for filtering. Fix #22803
* vim-patch:9.0.1683: Updated runtime files (#24638)zeertzjq2023-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a collection of various PRs from github that all require a minor patch number: 1) https://github.com/vim/vim/pull/12612 Do not conflate dictionary key with end of block 2) https://github.com/vim/vim/pull/12729: When saving and restoring 'undolevels', the constructs `&undolevels` and `:set undolevels` are problematic. The construct `&undolevels` reads an unpredictable value; it will be the local option value (if one has been set), or the global option value (otherwise), making it unsuitable for saving a value for later restoration. Similarly, if a local option value has been set for 'undolevels', temporarily modifying the option via `:set undolevels` changes the local value as well as the global value, requiring extra work to restore both values. Saving and restoring the option value in one step via the construct `:let &undolevels = &undolevels` appears to make no changes to the 'undolevels' option, but if a local option has been set to a different value than the global option, it has the unintended effect of changing the global 'undolevels' value to the local value. Update the documentation to explain these issues and recommend explicit use of global and local option values when saving and restoring. Update some unit tests to use `g:undolevels`. 3) https://github.com/vim/vim/pull/12702: Problem: Pip requirements files are not recognized. Solution: Add a pattern to match pip requirements files. 4) https://github.com/vim/vim/pull/12688: Add indent file and tests for ABB Rapid 5) https://github.com/vim/vim/pull/12668: Use Lua 5.1 numeric escapes in tests and add to CI Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings. Lua 5.1 only supports decimal escapes: > A character in a string can also be specified by its numerical value > using the escape sequence \ddd, where ddd is a sequence of up to three > decimal digits. (Note that if a numerical escape is to be followed by a > digit, it must be expressed using exactly three digits.) Strings in Lua > can contain any 8-bit value, including embedded zeros, which can be > specified as '\0'. To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to run with Lua 5.1 as well as Lua 5.4 6) https://github.com/vim/vim/pull/12631: Add hurl filetype detection 7) https://github.com/vim/vim/pull/12573: Problem: Files for haskell persistent library are not recognized Solution: Add pattern persistentmodels for haskell persistent library closes: vim/vim#12612 closes: vim/vim#12729 closes: vim/vim#12702 closes: vim/vim#12688 closes: vim/vim#12668 closes: vim/vim#12631 closes: vim/vim#12573 Already ported but wasn't marked: vim-patch:ad34abee2583 https://github.com/vim/vim/commit/6efb1980336ff324e9c57a4e282530b952fca816 Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: lacygoill <lacygoill@lacygoill.me> Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com> Co-authored-by: ObserverOfTime <chronobserver@disroot.org> Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de> Co-authored-by: James McCoy <jamessan@jamessan.com> Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev> Co-authored-by: Borys Lykah <lykahb@fastmail.com>
* feat(defaults): treat "•" as a list item prefix #24623Justin M. Keyes2023-08-09
| | | | | | | | Problem: Nvim docs use "•" as a list item prefix but `gw{motion}` doesn't format such lists by default. Solution: Change the 'comments' option to include "fb:•" by default.
* fix(types): make filetype.add parameters optionalMaria José Solano2023-08-09
|
* vim-patch:2eb413f89b97 (#24627)Christian Clason2023-08-09
| | | | | | | | | | | | * vim-patch:2eb413f89b97 detect filetype for `*.vsh` and `*.vv` files (vim/vim#12692) Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com> https://github.com/vim/vim/commit/2eb413f89b97a498679fbe68c7564b9e41c5af7f Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(iter): make pipeline termination conditions consistent (#24614)Gregory Anders2023-08-09
| | | | | | | | If an iterator pipeline stage returns nil as its first return value, the other return values are ignored and it is treated as if that stage returned only nil (the semantics of returning nil are different between different stages). This is consistent with how for loops work in Lua more generally, where the for loop breaks when the first return value from the function iterator is nil (see :h for-in for details).
* vim-patch:077ade4f6703 (#24629)Christian Clason2023-08-09
| | | | | | | feat: recognize geojson extension as json filetype (vim/vim#12636) https://github.com/vim/vim/commit/077ade4f67036e652b99f8f858c9ca1c1dd22245 Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
* vim-patch:b69b9d5e1753 (#24628)Christian Clason2023-08-09
| | | | | | | | | | | | | | Add filetype detection for eyaml files (vim/vim#12659) https://github.com/voxpupuli/hiera-eyaml/ uses and produces the eyaml format, which is simply yaml with some encrypted values. It's convenient to edit the file without decrypting when not touching encrypted values (or when you don't have access to the decryption key), which is why vim should treat those files as yaml files. https://github.com/vim/vim/commit/b69b9d5e175351c9a25507139954f6211f37fdd9 Co-authored-by: Max Gautier <mg@max.gautier.name>
* vim-patch:44ff25d5243b (#24625)Christian Clason2023-08-09
| | | | | | | | | | | | | * vim-patch:44ff25d5243b PyPA manifest files are not recognized (vim/vim#12707) Problem: PyPA manifest files are not recognized. Solution: Add a pattern to match PyPA manifest files. https://github.com/vim/vim/commit/44ff25d5243b6d4f7ee88b46d1254aec0b27f4eb Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
* vim-patch:7159ac7fec28 (#24624)Christian Clason2023-08-09
| | | | | | | Unison support (vim/vim#12715) https://github.com/vim/vim/commit/7159ac7fec282ad7427795b4bcd5b769268c083d Co-authored-by: Anton Parkhomenko <chuwy@users.noreply.github.com>
* vim-patch:a13eb2b14791 (#24622)Christian Clason2023-08-09
| | | | | | | | | | | | | | | | | | | | | | | | Add WebGPU Shading Language (WGSL) filetype (vim/vim#12723) The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies 'text/wgsl' media type for WGSL modules with the '.wgsl' file extension: https://www.w3.org/TR/WGSL/#text-wgsl-media-type It has also been registered at the Internet Assigned Numbers Authority (IANA): https://www.iana.org/assignments/media-types/text/wgsl Neovim's nvim-lspconfig already associates wgsl language servers with 'filetype wgsl': https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim is blocked by adding this filetype to the vim project first: https://github.com/neovim/neovim/pull/23331 This commit adds this missing wgsl filetype. https://github.com/vim/vim/commit/a13eb2b147915e7e92a6de6c19ce448c7def4057 Co-authored-by: Gergő Sályi <87373293+gergo-salyi@users.noreply.github.com>
* Merge pull request #24631 from clason/vim-c2bd205254c8zeertzjq2023-08-10
|\ | | | | vim-patch:{c2bd205254c8,0401933a5be3}: typo fixes
| * vim-patch:c2bd205254c8Christian Clason2023-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Change "the" to "then" under ':help bufload()' (vim/vim#12662) https://github.com/vim/vim/commit/c2bd205254c89ecf46e08965f53d7991315d9c98 N/A commits: vim-patch:64dea84bb05a (we have our own manpager at home) vim-patch:958e15bb1c7d (we have our own editorconfig syntax file) vim-patch:c41b3c9f95ac (we don't have defaults.vim) Co-authored-by: Daniel Steinberg <dstein64@users.noreply.github.com>
* | fix(lua): annotate that TSNode functions can return nil (#24621)Kyuuhachi2023-08-09
|/
* fix(lua): improve annotations for stricter luals diagnostics (#24609)Christian Clason2023-08-09
| | | | | | | | | | | | | | | Problem: luals returns stricter diagnostics with bundled luarc.json Solution: Improve some function and type annotations: * use recognized uv.* types * disable diagnostic for global `vim` in shared.lua * docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type) * add type alias for lpeg pattern * fix return annotation for `vim.secure.trust` * rename local Range object in vim.version (shadows `Range` in vim.treesitter) * fix some "missing fields" warnings * add missing required fields for test functions in eval.lua * rename lsp meta files for consistency
* docs(builtin): fix some missing lines (#24615)Sean Dewar2023-08-08
| | | | | | These two functions seem to have previously had their docs start on the same line as the signature, which I guess contributed to the lines being lost (though I checked all other such functions from before again and these were the only two).
* fix(filetype): add typing and dry (#24573)Lewis Russell2023-08-08
|
* fix(lua): vim.fs typing (#24608)Lewis Russell2023-08-08
|
* docs(lua): the keyset nilocalypsebfredl2023-08-08
| | | | This is needed to give recent LuaLS the right idea about optional fields.
* fix(treesitter): make sure injections don't return empty ranges (#24595)Lewis Russell2023-08-07
| | | | | | | | | | | | | | | | | | | | When an injection has not set include children, make sure not to add the injection if no ranges are determined. This could happen when there is an injection with a child that has the same range as itself. e.g. consider this Makefile snippet ```make foo: $(VAR) ``` Line 2 has an injection for bash and a make variable reference. If include-children isn't set (default), then there is no range on line 2 to inject since the variable reference needs to be excluded. This caused the language tree to return an empty range, which the parser now interprets to mean the full buffer. This caused makefiles to have completely broken highlighting.
* vim-patch:9.0.1678: blade files are not recognized (#24601)ObserverOfTime2023-08-07
| | | | | | | | Problem: Blade files are not recognized. Solution: Add a pattern for Blade files. (closes vim/vim#12650) https://github.com/vim/vim/commit/ad34abee258322826146d597ac5b5fd2111c2b79 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat: add .luarc.json (#24592)Lewis Russell2023-08-07
|
* docs(lsp): fix references to protocol.constants #24578Maria José Solano2023-08-07
|
* fix(treesitter): escape quotes in :InspectTree view #24582ObserverOfTime2023-08-07
| | | | Problem: Anonymous nodes containing double quotes break the highlighting. Solution: Escape double quotes in anonymous nodes.
* Merge pull request #24524 from bfredl/typed_keysbfredl2023-08-07
|\ | | | | refactor(api): use typed keysets
| * feat(lua): use keyset type informationbfredl2023-08-07
| |
* | refactor(lsp): use protocol.Methods instead of strings #24570Raphael2023-08-05
| |
* | docs(options): take ownership of options.txt (#24528)Lewis Russell2023-08-04
|/ | | | | | | | | | | | | | * docs(options): take ownership of options.txt - `src/nvim/options.lua` is now the source of truth - generate runtime/lua/vim/_meta/options.lua * fixup! zeer comments * fixup! zeer comments (2) * fixup! re-enable luacheck * fixup! regen
* fix(lsp): do not assume client capability exists in watchfiles check (#24550)Sean Dewar2023-08-04
| | | | | | | | | | | | | | | | | | | | | PR #23689 assumes `client.config.capabilities.workspace.didChangeWatchedFiles` exists when checking `dynamicRegistration`, but thats's true only if it was passed to `vim.lsp.start{_client}`. This caused #23806 (still an issue in v0.9.1; needs manual backport), but #23681 fixed it by defaulting `config.capabilities` to `make_client_capabilities` if not passed to `vim.lsp.start{_client}`. However, the bug resurfaces on HEAD if you provide a non-nil `capabilities` to `vim.lsp.start{_client}` with missing fields (e.g: not made via `make_client_capabilities`). From what I see, the spec says such missing fields should be interpreted as an absence of the capability (including those indicated by missing sub-fields): https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities Also, suggest `vim.empty_dict()` for an empty dict in `:h vim.lsp.start_client()` (`{[vim.type_idx]=vim.types.dictionary}` no longer works anyway, probably since the cjson switch).
* docs: luaref cleanup #24541Justin M. Keyes2023-08-03
| | | | - drop "luaref-" prefix in favor of "lua-" or nothing, where possible. - remove redundant "luaref--lang…" and "luaref-api…" tags.