summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/lua/api_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-20refactor(test): drop deprecated exc_exec #39242Justin M. Keyes1
2026-04-15refactor(api): rename "window" to "win" (positional parameters) #39083Justin M. Keyes1
continues d0af4cd9094f. This commit renames positional parameters. This is only "cosmetic", but is intended to make it extra clear which name is preferred, since people often copy existing code despite the guidelines in `:help dev-naming`.
2026-03-16fix(api): use standard error messagesJustin M. Keyes1
2025-05-04feat(messages): cleanup Lua error messagesJustin M. Keyes1
"Error" in error messages is redundant. Just provide the context, don't say "Error ...".
2024-09-23refactor(api)!: rename Dictionary => DictJustin M. Keyes1
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.
2024-08-02test: allow exec_lua to handle functionsLewis Russell1
Problem: Tests have lots of exec_lua calls which input blocks of code provided as unformatted strings. Solution: Teach exec_lua how to handle functions.
2024-04-23test: improve test conventionsdundargoc1
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: do not inject vim module into global helpersLewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-07fix(lua): allow nil values in serialized Lua arrays (#26329)Gregory Anders1
When we convert a Lua table to an Object, we consider the table a "dictionary" if it contains only string keys, and an array if it contains all numeric indices with no gaps. While rare, Lua tables can have both strictly numeric indices and gaps (e.g. { [2] = 2 }). These currently cannot be serialized because it is not considered an array. However, we know the maximum index of the table and as long as all of the keys in the table are numeric, it is still possible to serialize this table as an array. The missing indices will have nil values.
2023-08-09fix(api): revert unintended change of optional bool paramsbfredl1
Currently (as of nvim 0.9), the behavior of boolean params in vim.api lua wrappers is inconsistent for optional parameters (part of an `opts` dict) compared to positional parameters. This was inadvertently changed in #24524 . While cleaning up this inconsistency is something we might want eventually, it needs to be discussed separately and the impact of existing code considered.
2023-08-07test(api): update tests to new error messagesbfredl1
2023-04-16vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131)zeertzjq1
Problem: Vim9: exception in ISN_INSTR caught at wrong level. Solution: Set the starting trylevel in exec_instructions(). (closes vim/vim#8214) https://github.com/vim/vim/commit/ff65288aa89dcd50760ad942d58baff70c6e93e6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-14refactor(api): VALIDATE macros #22256Justin M. Keyes1
- VALIDATE() takes a format string - deduplicate check_string_array - VALIDATE_RANGE - validate UI args
2022-09-30docs: fix typos (#20394)dundargoc1
Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-02-26fix(api): convert blob to NUL-terminated API stringSean Dewar1
Looks like I did an oopsie; although API strings carry a size field, they should still be usable as C-strings! (even though they may contain embedded NULs)
2022-01-03fix(lua): stricter type check when calling API function (#16745)dundargoc1
Solves #13651 Co-authored-by: Gregory Anders <greg@gpanders.com>
2021-12-28feat(api): implement nvim_{add,del}_user_commandGregory Anders1
Add support for adding and removing custom user commands with the Nvim API.
2021-11-06feat(lua): enable stack traces in error output (#16228)Gregory Anders1
2021-10-08fix(api): check type in nlua_pop_keydict (#15940)virchau131
2021-09-15feat(decode_string): decode binary string with NULs to BlobSean Dewar1
Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
2021-09-15feat(api): convert Blobs to API stringsSean Dewar1
Note that these are not NUL-terminated; the API supports this.
2020-01-14API: include invalid buffer/window/tabpage in error message (#11712)Daniel Hahler1
2019-11-16Add v:lua.func() vimL syntax for calling luaBjörn Linse1
Also simplify error messages when calling lua from vimL.
2017-05-08functests: Fix testsZyX1
2017-05-08Merge branch 'master' into luaviml'/luaZyX1
2017-04-11functests: Check whether it is a problem with an arrayZyX1
2017-04-11functests: Add another check for the similar transformationZyX1
Reasoning is majorly the same: check whether lua has bug or API function has bug, but on the other side: previous commit is checking whether similar bug when using API via msgpack RPC, this commit is checking whether another API function used via lua bindings triggers the same bug. Should additionally give a hint about which lua code contains a bug.
2017-04-11functests: Make sure funcs.luaeval receives only one argumentZyX1
2017-04-08api: Rename _vim_id functions to nvim__idZyX1
2017-03-27functests: Some more testsZyX1
2017-03-27functests: Move existing tests from lua_spec to lua/*, fix themZyX1
2017-03-27functests: Add some testsZyX1