aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_eval_files.lua
Commit message (Collapse)AuthorAge
* fix: resolve all remaining LuaLS diagnosticsLewis Russell2025-01-27
|
* fix(options): better handling of empty valuesLewis Russell2025-01-13
| | | | | | | | | | | | | | | Problem: Whether an option is allowed to be empty isn't well defined and isn't properly checked. Solution: - For non-list string options, explicitly check the option value if it is empty. - Annotate non-list string options that can accept an empty value. - Adjust command completion to ignore the empty value. - Render values in Lua meta files
* docs(api): return type of nvim_get_keymap() #31708Shihua Zeng2024-12-24
|
* docs(annotations): added `---@generic` supportColin Kennedy2024-12-13
|
* docs: do not escape Lua keywords #31467Gregory Anders2024-12-06
|
* feat(keysets): teach Union and LuaRefOfLewis Russell2024-11-25
|
* refactor(options): remove `.indir`, redesign option scopes #31066Famiu Haque2024-11-16
| | | | | | | | | | | | | | | | | | | | | | Problem: The way option scopes currently work is inflexible and does not allow for nested option scopes or easily finding the value of an option at any arbitrary scope without having to do long handwritten switch-case statements like in `get_varp()`. `.indir` is also confusing and redundant since option indices for each scope can be autogenerated. Solution: Expand option scopes in such a way that an option can support any amount of scopes using a set of scope flags, similarly to how it's already done for option types. Also make options contain information about its index at each scope it supports. This allows for massively simplifying `get_varp()` and `get_varp_scope()` in the future by just using a struct for options at each scope. This would be done by creating a table that stores the offset of an option's variable at a scope by using the option's index at that scope as a key. This PR also autogenerates enums for option indices at each scope to remove the need for `.indir` entirely, and also to allow easily iterating over options all options that support any scope. Ref: #29314
* feat(options)!: disallow setting hidden options #28400Famiu Haque2024-11-04
| | | | | | | | | | | | | | | | | Problem: There are three different ways of marking an option as hidden, `enable_if = false`, `hidden = true` and `immutable = true`. These also have different behaviors. Options hidden with `enable_if = false` can't have their value fetched using Vim script or the API, but options hidden with `hidden = true` or `immutable = true` can. On the other hand, options with `hidden = true` do not error when trying to set their value, but options with `immutable = true` do. Solution: Remove `enable_if = false`, remove the `hidden` property for options, and use `immutable = true` to mark an option as hidden instead. Also make hidden option variable pointers always point to the default value, which allows fetching the value of every hidden option using Vim script and the API. This does also mean that trying to set a hidden option will now give an error instead of just being ignored.
* docs(options): remove description for hidden options #30903Famiu Haque2024-10-22
| | | | | | | | | Problem: Hidden options are documented despite being no-ops. Solution: Remove docs for hidden options. Move tags for options that we plan to restore, to ":help nvim-missing". Move tags for permanently removed options, to ":help nvim-removed".
* vim-patch:9.1.0797: testing of options can be further improved (#30893)zeertzjq2024-10-22
| | | | | | | | | | | Problem: testing of options can be further improved Solution: split the generated option test into test_options_all.vim, add more test cases, save and restore values, fix use-after-free closes: vim/vim#15894 https://github.com/vim/vim/commit/6eca04e9f1d446dc509ba51e32da56fa413fe2f0 Co-authored-by: Milly <milly.ca@gmail.com>
* docs: generate params/returns in builtin.txt #30654Justin M. Keyes2024-10-07
|
* feat(docs): improve `@see` meta docstrings #30693Justin M. Keyes2024-10-06
|
* fix(docs): markdown instead of vimdoc in meta docstrings #30680Justin M. Keyes2024-10-06
| | | | | LuaLS/meta docstrings expect markdown, not vimdoc. This matters for lists, codeblocks, etc. Also, line length doesn't matter for docstrings.
* fix(docs): missing `@returns` desc in _meta/api.lua #30673Justin M. Keyes2024-10-05
|
* docs: render `@since` versions, 0 means experimental #30649Justin M. Keyes2024-10-04
| | | | | | | | An implication of this current approach is that `NVIM_API_LEVEL` should be bumped when a new Lua function is added. TODO(future): add a lint check which requires `@since` on all new functions. ref #25416
* docs: render @see, @note items in _meta/api.lua #30494Justin M. Keyes2024-09-25
|
* refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
* fix(docs): wrong return value annotation for `nvim_buf_get_extmarks`JonnyKong2024-08-25
|
* fix(docs): add missing properties to hl_info #30032Maria José Solano2024-08-16
|
* refactor(shada): rework msgpack decoding without msgpack-cbfredl2024-08-05
| | | | | | | This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
* vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)zeertzjq2024-07-10
| | | | | | | | | | | | | Problem: No way to get the arity of a Vim function (Austin Ziegler) Solution: Enhance get() Vim script function to return the function argument info using get(func, "arity") (LemonBoy) fixes: vim/vim#15097 closes: vim/vim#15109 https://github.com/vim/vim/commit/48b7d05a4f88c4326bd5d7a73a523f2d953b3e51 Co-authored-by: LemonBoy <thatlemon@gmail.com>
* refactor(lua): use tuple syntax everywhere #29111Ilia Choly2024-06-04
|
* fix(types): rename win_get_config return type to win_configWill Hopkins2024-03-02
| | | Follow-up to #27397
* refactor(metadata): generate all metadata in luabfredl2024-02-28
| | | | | | | | Then we can just load metadata in C as a single msgpack blob. Which also can be used directly as binarly data, instead of first unpacking all the functions and ui_events metadata to immediately pack it again, which was a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object` which will get yak shaved in the next PR)
* feat(docs): replace lua2dox.luaLewis Russell2024-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The documentation flow (`gen_vimdoc.py`) has several issues: - it's not very versatile - depends on doxygen - doesn't work well with Lua code as it requires an awkward filter script to convert it into pseudo-C. - The intermediate XML files and filters makes it too much like a rube goldberg machine. Solution: Re-implement the flow using Lua, LPEG and treesitter. - `gen_vimdoc.py` is now replaced with `gen_vimdoc.lua` and replicates a portion of the logic. - `lua2dox.lua` is gone! - No more XML files. - Doxygen is now longer used and instead we now use: - LPEG for comment parsing (see `scripts/luacats_grammar.lua` and `scripts/cdoc_grammar.lua`). - LPEG for C parsing (see `scripts/cdoc_parser.lua`) - Lua patterns for Lua parsing (see `scripts/luacats_parser.lua`). - Treesitter for Markdown parsing (see `scripts/text_utils.lua`). - The generated `runtime/doc/*.mpack` files have been removed. - `scripts/gen_eval_files.lua` now instead uses `scripts/cdoc_parser.lua` directly. - Text wrapping is implemented in `scripts/text_utils.lua` and appears to produce more consistent results (the main contributer to the diff of this change).
* docs(builtin): show tag at first line with multiple signatures (#27577)zeertzjq2024-02-22
| | | | | | | | Problem: When a function has multiple signatures, putting its tag at the last one may make one think that's its only signature. Solution: When a function has multiple signatures, put its tag at the first one.
* feat: improve return type annotations for vim.api.*Lewis Russell2024-01-26
|
* refactor(api): give "hl_group" more accurate _meta typebfredl2024-01-22
| | | | | These can either be number or string in lua, so we can specify this directly as "number|string".
* docs(builtin): overload functions with union return typesaltermo2024-01-14
|
* feat: generate types and docs for v variablesLewis Russell2023-12-21
|
* refactor(options): remove option type macrosFamiu Haque2023-12-14
| | | | | | | | Problem: We have `P_(BOOL|NUM|STRING)` macros to represent an option's type, which is redundant because `OptValType` can already do that. The current implementation of option type flags is also too limited to allow adding multitype options in the future. Solution: Remove `P_(BOOL|NUM|STRING)` and replace it with a new `type_flags` attribute in `vimoption_T`. Also do some groundwork for adding multitype options in the future. Side-effects: Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer gives an error.
* build: enable lintlua for scripts/ dir #26391Justin M. Keyes2023-12-04
| | | | | | | | | | | Problem: We don't enable stylua for many Lua scripts. Automating code-style is an important tool for reducing time spent on accidental (non-essential) complexity. Solution: - Enable lintlua for `scripts/` directory. - Specify `call_parentheses = "Input"`, we should allow kwargs-style function invocations.
* docs(lua): don't include remote-only API functions (#26266)zeertzjq2023-11-28
|
* build: use built nvim artifact to generate eval files (#25875)Gregory Anders2023-11-02
| | | | | | | | | | | In cases where the generated files depend on changes to Nvim itself, generating the files with an older version of Nvim will fail because those changes are not present in the older version. For example, if a new option is added then the generator script should be run with the version of Nvim that contains the new option, or else the generation will fail. Co-authored-by: dundargoc <gocdundar@gmail.com>
* docs: miscellaneous doc and type fixes (#25554)Maria José Solano2023-10-10
|
* docs: replace <pre> with ``` (#25136)Gregory Anders2023-09-14
|
* vim-patch:596ad66d1ddb (#25102)zeertzjq2023-09-12
| | | | | | | | | | | | | | runtime(doc): documentation updates This is a collection of various improvements to the help pages closes vim/vim#12790 https://github.com/vim/vim/commit/596ad66d1ddb742ef349e98eb06b8e4052f68f51 Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Houl <anwoku@yahoo.de> Co-authored-by: Doug Kearns <dougkearns@gmail.com> Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
* docs(builtin): small fixes (#24861)Sean Dewar2023-08-24
| | | | Also make gen_eval_files.lua render vimdoc helpExamples properly if the line begins with the `>` marker.
* docs(generators): bake into cmakeLewis Russell2023-08-23
|
* vim-patch:9.0.1710: scrolloff options work slightly differentzeertzjq2023-08-23
| | | | | | | | | | | | | | | | | | | | | | | Problem: sidescrolloff and scrolloff options work slightly different than other global-local options Solution: Make it behave consistent for all global-local options It was noticed, that sidescrolloff and scrolloff options behave differently in comparison to other global-local window options like 'listchars' So make those two behave like other global-local options. Also add some extra documentation for a few special local-window options. Add a few tests to make sure all global-local window options behave similar closes: vim/vim#12956 closes: vim/vim#12643 https://github.com/vim/vim/commit/4a8eb6e7a9df10f79bf95301ced012f0d6a13088 Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs(lua): the keyset nilocalypsebfredl2023-08-08
| | | | This is needed to give recent LuaLS the right idea about optional fields.
* Merge pull request #24524 from bfredl/typed_keysbfredl2023-08-07
|\ | | | | refactor(api): use typed keysets
| * refactor(api): use typed keysetsbfredl2023-08-07
| | | | | | | | | | Initially this is just for geting rid of boilerplate, but eventually the types could get exposed as metadata
* | 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
* docs: drop "Can also be used as a method" #24508Justin M. Keyes2023-08-01
| | | | | | | | Now that we "own" builtin.txt, we cant remove the repetitive mention of Vimscript's UFCS syntax. It's noisy to mention this for each function, and it's also not a Vimscript feature that should be encouraged. Also change the builtin.txt heading to "NVIM REFERENCE MANUAL", which indicates when a help file is Nvim-owned.
* feat(lua-types): types for vim.api.* (#24523)Lewis Russell2023-08-01
|
* docs(builtin): right align tags (#24522)Lewis Russell2023-08-01
|
* docs(builtin): fix and annotate language blocks (#24506)Lewis Russell2023-08-01
|
* feat(docs): generate builtin.txt (#24493)Lewis Russell2023-07-28
- eval.lua is now the source of truth. - Formatting is much more consistent. - Fixed Lua type generation for polymorphic functions (get(), etc). - Removed "Overview" section from builtin.txt - Can generate this if we really want it. - Moved functions from sign.txt and testing.txt into builtin.txt. - Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred. - Removed the temp-file-name tag from tempname() - Moved lueval() from lua.txt to builtin.txt. * Fix indent * fixup! * fixup! fixup! * fixup! better tag formatting * fixup: revert changes no longer needed * fixup! CI --------- Co-authored-by: zeertzjq <zeertzjq@outlook.com>