aboutsummaryrefslogtreecommitdiff
path: root/src/gen/gen_eval_files.lua
Commit message (Collapse)AuthorAge
* docs(help): specify h4 "function signature" format #42434masterJustin M. Keyes2 days
| | | | | | | | | | | | | | | | | | | | | Work towards enabling ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88) in all `:help` files. Problem: The final boss of vimdoc pseudo-structure: Vim's quasi-headings on function signatures and excmd docs is visually distinctive but too inconsistent for a nice parse rule. Solution: - Define the quasi-heading format as an "h4" variant, specified at `:help help-tag-heading`. - For simplicity and predictability, it is defined as any line that ends with a help tag(s) preceded by 2 or more spaces (or 1 tab). - Update existing docs. - This one-time update has a lot of changes, but is very unlikely to conflict with ported Vim-patches because (1) Vim rarely adds new *excmds* that we want, and (2) *function* docs are auto-generated. ref https://github.com/neovim/tree-sitter-vimdoc/issues/110
* docs: cleanup tables, highlights.scm #42381Justin M. Keyes4 days
| | | highlights.scm: `#match` is slow, prefer `#lua-match`.
* fix(api): correct Lua command and completion typesLewis Russell2026-09-28
| | | | | | | | | | | Problem: Command inputs and parsed modifiers have different optional fields, and completion window IDs are annotated as floating-point values. Solution: Separate modifier input and return types, correct integer IDs, and update the metadata generators and their output. AI-assisted
* fix(lua): generate explicit overloads for vim.fnLewis Russell2026-09-25
| | | | | | | | | | | | | | | | The generated vim.fn stubs represent overloads as repeated function declarations. EmmyLua merges their return types, so getline(lnum) is inferred as string|string[] even though it always returns a string. Generate one declaration with @overload annotations from the existing __N entries, while keeping separate Vimdoc signatures. Parenthesize the overload return list so types such as (0|-1)[] remain arrays. Correct getline()'s single-line and range signatures, and add typed getqflist() signatures for its entry-list and property-query forms. This lets callers infer quickfix results without local type overrides. AI-assisted
* fix(types): emmylua warning about `params` fieldJustin M. Keyes2026-08-04
|
* feat(options): lua closure/function optionsJustin M. Keyes2026-07-31
| | | | | | | | | | | | | | | Problem: Cannot assign Lua functions/closures to "func" ('completefunc', 'tagfun', …) or "expr" ('foldexpr', 'indentexpr', …) options. Solution: - Store "func"/"expr" options as `Callback` instead of string. - Delete oceans of copy-pasted code. - BREAKING: LuaRef returned via RPC/Vimscript is now represented as `"<Lua N: file:line>"` (like what `:map` shows) instead of `nil`. - Note: `man.vim` still uses `v:lua` string, bc it's a vimscript ftplugin. Helped-by: Lewis Russell <lewis6991@gmail.com>
* feat(options): schema, "dict" options, messagesJustin M. Keyes2026-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Options parsing is still painful for dict-style options. Solution: schema-maxxing => better `opt:get()` (will be the basis for `vim.o()`), unified (and more-detailed) err msgs. - Drop bespoke structure-builder in `_core/options.lua`. - Define `schema` for all non-primitive options (except 'guicursor' and statusline-style options); generate reified keysets `OptKeyDict`). - Generate 'fillchars' => `fcs_tab`, 'listchars' => `lcs_tab`. - `nvim_set_option_value`: - Return the improved structures. Also from `vim.opt.x:get()`. - Eliminate api <=> lua roundtrip, centralize option structure handling. - Improve/unify errors. - Bump ERR_BUFLEN 80 → 256 so the "one of" list isn't truncated. - Eliminate old 'diffopt' order-dependence (`iwhiteall` before `iwhite`) Error samples: Typed-key path (opt_strings_check → diffopt/mousescroll/breakindentopt): E474: Unknown item 'foo' E474: 'context' requires a number E474: 'ver' number is out of range E474: 'algorithm' must be one of: myers, minimal, patience, histogram E474: 'filler' does not take a value Related: - #31084 - #34661 - #31820 - #14739 - #20107 - fix #18875 - :get() returns `{ sbr = true, shift = '3' }` (reified-keyset) instead of `{'sbr', 'shift:3'}` - Setting via table now works too. `object_as_optval_for` `is_map` now recognizes struct options. - fix #30296 - instead of `E474: Invalid argument`, errors now look like: ``` E474: Invalid value 'x', expected one of: single, double: ambiwidth=x E474: Unknown item 'foo': diffopt=foo E474: 'context' requires a number: diffopt=context:x ``` simplify `win_float_parse_option` from #26799.
* feat(eval): declare more "fast" functions #40834Justin M. Keyes2026-07-19
|
* docs: misc #39817Justin M. Keyes2026-05-17
|
* feat(doc): document Lua alternative for vim.fnLewis Russell2026-04-27
| | | | AI-assisted: Codex
* build(docs): sort/lint class fields and keysetsJustin M. Keyes2026-04-26
| | | | | | | | | | | Problem: Fields (key names) in classes, keysets, and quasi-keysets are ordered randomly, which adds friction when reading docs. Solution: - Sort class fields and keysets when generating docs. - Add a lint check for quasi-keysets (keysets defined as unstructured markdown lists within a docstring).
* feat(options): add 'winpinned' to pin a window #39157luukvbaal2026-04-19
| | | | | | | | | | | | | | Problem: - Unable to "pin" a window to prevent closing without specifically being targeted. - :fclose closes hidden windows (even before visible windows). Solution: - Add 'winpinned' window-local option. When set, window is skipped by :fclose and :only. Pin the ui2 cmdline window (which should always be visible), so that it is not closed by :only/fclose. - Skip over hidden (and pinned) windows with :fclose. Co-authored-by: glepnir <glephunter@gmail.com>
* test: lint naming conventions #39117Justin M. Keyes2026-04-16
| | | | | | | | | | | | Problem: Naming conventions are not automatically checked. Solution: Add a check to the doc generator. Eventually we should extract this somehow, but that will require refactoring the doc generator... Note: this also checks non-public functions, basically anything that passes through `gen_eval_files.lua` and `gen_vimdoc.lua`. And that's a good thing.
* fix(lua): not obvious which _meta/ files are generated #39035Justin M. Keyes2026-04-14
| | | | | | | | | | | | Problem: - Not obvious which _meta/ are generated and which should be edited manually. - The require guard (`error('Cannot require a meta file')`) is not consistently present in all meta files. Solution: - Update headers. - Add require() guard to all meta files. - Rename generated meta files with `.gen.lua`.
* refactor(options): generate "modeline disallowed" doc text #39019Justin M. Keyes2026-04-14
| | | | | | | | | | | Problem: - Lots of redundant text in options docs for "not allowed in a modeline", even though we already have a flag that indicates that. - `deny_in_modelines` is an old vestigial flag only used by 'encoding' (which never changes). Solution: - Generate docs based on the `secure` flag. - Remove the `deny_in_modelines` flag (`kOptFlagNoML`).
* docs: api, plugins, ui2Justin M. Keyes2026-03-24
|
* fix: resolve all remaining LuaLS warnings in `src/`Riccardo Mazzarini2026-03-09
|
* fix(gen): prevent "make doc" failure due to temporary filesbfredl2025-09-10
| | | | | | Notably, the existence of a swap file like .buffer.c.swp might cause mayhem. As a reasonable filter, only process *.c and *.h files using the c grammar.
* fix(types): nvim_get_win_config return type #35639Lewis Russell2025-09-06
|
* docs(autocmd): generate events enum type #34883luukvbaal2025-07-12
|
* docs: api, pack, events, developJustin M. Keyes2025-07-10
|
* docs(api): document types using LuaCATS typesLewis Russell2025-06-26
| | | | | | | | | | | | | | | | | | | | - Render Lua types in api.txt. - Added `DictAs(name)` API type which acts the same as `Dict` (no parens) when generating the dispatchers, but acts the same as `Dict(name)` when generating docs. - Added `Tuple(...)` API type which is the treated the as `Array` for generating the dispatchers, but is used to document richer types. - Added `Enum(...)` API type to better document enums - Improve typing of some API functions. - Improve c_grammar to properly parse API types and replace string pattern logic in the parsers. - Removed all the hardcoded type overrides in gen_eval_files.lua
* refactor(generator): use fmt() for string.format() more (#34528)zeertzjq2025-06-17
|
* vim-patch:631a50c: runtime(doc): mention cannot ignored events in ↵zeertzjq2025-06-16
| | | | | | | | | eventignorewin (#34522) closes: vim/vim#17545 https://github.com/vim/vim/commit/631a50ceb9a312a9042a8e8420afd8e948497d90 Co-authored-by: glepnir <glephunter@gmail.com>
* docs(meta): fix incorrect bar -> backtick replacement (#34520)zeertzjq2025-06-16
|
* fix: type fixesLewis Russell2025-06-06
| | | | Type fixes caught by emmylua
* docs: rename builtin.txt, eval.txt #34212Phạm Bình An2025-05-30
| | | | | | | | | | | | Problem: Despite the name, `builtin.txt` only includes Vimscript functions, which is confusing, especially to people who only use Lua to configure Nvim Solution: From justinmk's suggestion - Rename `builtin.txt` to `vimfn.txt` - Rename `eval.txt` to `vimeval.txt` - The tags `*builtin.txt*` and `*eval.txt*` should be kept for Vim-patches Closes #33743
* feat(build): build.zig MVP: build and run functionaltests on linuxbfredl2025-05-02
| | | | | | | | | | | | | | | | | | | | | NEW BUILD SYSTEM! This is a MVP implementation which supports building the "nvim" binary, including cross-compilation for some targets. As an example, you can build a aarch64-macos binary from an x86-64-linux-gnu host, or vice versa Add CI target for build.zig currently for functionaltests on linux x86_64 only Follow up items: - praxis for version and dependency bumping - windows 💀 - full integration of libintl and gettext (or a desicion not to) - update help and API metadata files - installation into a $PREFIX - more tests and linters
* feat: render tuple types for API methodsLewis Russell2025-04-23
|
* fix(lua): types for vim.api.keyset.win_config #32700Tomasz N2025-03-10
|
* fix(types): do not mark unstable API as privateLewis Russell2025-03-08
| | | | | These functions are allowed to be used downstream, they are just not API stable.
* feat(lua): vim.text.indent()Justin M. Keyes2025-02-26
| | | | | | | | | | | | | Problem: Indenting text is a common task in plugins/scripts for presentation/formatting, yet vim has no way of doing it (especially "dedent", and especially non-buffer text). Solution: Introduce `vim.text.indent()`. It sets the *exact* indentation because that's a more difficult (and thus more useful) task than merely "increasing the current indent" (which is somewhat easy with a `gsub()` one-liner).
* build: move all generator scripts to `src/gen/`Lewis Russell2025-02-26
- Move all generator Lua scripts to the `src/gen/` - Add a `.luarc.json` to `src/gen/` - Add a `preload.lua` to `src/gen/` - Add `src` to `package.path` so it aligns with `.luarc.json' - Fix all `require` statements in `src/gen/` so they are consistent: - `require('scripts.foo')` -> `require('gen.foo')` - `require('src.nvim.options')` -> `require('nvim.options')` - `require('api.dispatch_deprecated')` -> `require('nvim.api.dispatch_deprecated')`