aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/c_grammar.lua
Commit message (Collapse)AuthorAge
* fix(api): deprecate nvim_subscribe, nvim_unsubscribe #30456Justin M. Keyes2024-12-02
| | | | | | | | | | | | | | | | | | | | | | | | Problem: - nvim_subscribe, nvim_unsubscribe were deprecated in aec4938a21a02d279d13a9eb64ef3b7cc592c374 but this wasn't set in the API metadata. - The function annotations ``` FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY FUNC_API_DEPRECATED_SINCE(13) ``` cause this test to fail: ``` RUN T3 api metadata functions are compatible with old metadata or have new level: 3.00 ms ERR test/functional/api/version_spec.lua:135: function vim_subscribe was removed but exists in level 0 which nvim should be compatible with stack traceback: test/functional/api/version_spec.lua:135: in function <test/functional/api/version_spec.lua:128> ``` Solution: - Set the API metadata. - Rearrange the annotations so that FUNC_API_DEPRECATED_SINCE is 2nd: ``` FUNC_API_SINCE(1) FUNC_API_DEPRECATED_SINCE(13) FUNC_API_REMOTE_ONLY ```
* refactor: gen_declarations.luaLewis Russell2024-11-29
| | | | | | | | | Problem: gen_declarations.lua is complex and has duplicate logic with c_grammar.lua Solution: Move all lpeg logic to c_grammar.lua and refactor gen_declarations.lua.
* feat(keysets): teach Union and LuaRefOfLewis Russell2024-11-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.
* 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.
* 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).
* refactor(api): make freeing of return-value opt-in instead of opt outbfredl2024-02-21
| | | | | | | | | As only a few API functions make use of explicit freeing of the return value, make it opt-in instead. The arena is always present under the hood, so `Arena *arena` arg now doesn't mean anything other than getting access to this arena. Also it is in principle possible to return an allocated value while still using the arena as scratch space for other stuff (unlikely, but there no reason to not allow it).
* build: enable lintlua for src/ dir #26395Justin M. Keyes2023-12-04
| | | | | | | | | | | Problem: Not all Lua code is checked by stylua. Automating code-style is an important mechanism for reducing time spent on accidental (non-essential) complexity. Solution: - Enable lintlua for `src/` directory. followup to 517f0cc634b985057da5b95cf4ad659ee456a77e
* fix(api): use text_locked() to check textlockSean Dewar2023-07-05
| | | | | | | | | | | | | | | Problem: some API functions that check textlock (usually those that can change curwin or curbuf) can break the cmdwin. Solution: make FUNC_API_CHECK_TEXTLOCK call text_locked() instead, which already checks for textlock, cmdwin and `<expr>` status. Add FUNC_API_TEXTLOCK_ALLOW_CMDWIN to allow such functions to be usable in the cmdwin if they can work properly there; the opt-in nature of this attribute should hopefully help mitigate future bugs. Also fix a regression in #22634 that made functions checking textlock usable in `<expr>` mappings, and rename FUNC_API_CHECK_TEXTLOCK to FUNC_API_TEXTLOCK.
* refactor(build): include lpeg as a librarybfredl2023-04-27
|
* refactor(api): make typed dicts appear as types in the source codebfredl2023-04-07
| | | | | | | | | | | | | | | | | | | | | problem: can we have Serde? solution: we have Serde at home This by itself is just a change of notation, that could be quickly merged to avoid messy merge conflicts, but upcoming changes are planned: - keysets no longer need to be defined in one single file. `keysets.h` is just the initial automatic conversion of the previous `keysets.lua`. keysets just used in a single api/{scope}.h can be moved to that file, later on. - Typed dicts will have more specific types than Object. this will enable most of the existing manual typechecking boilerplate to be eliminated. We will need some annotation for missing value, i e a boolean will need to be represented as a TriState (none/false/true) in some cases. - Eventually: optional parameters in form of a `Dict opts` final parameter will get added in some form to metadata. this will require a discussion/desicion about type forward compatibility.
* refactor(ui): devirtualize the ui layerbfredl2023-01-05
| | | | | | | | | | | | | | | | | - The defined interface for the UI is only the RPC protocol. The original UI interface as an array of function pointers fill no function. - On the server, all the UI:s are all RPC channels. - ui.c is only used on the server. - The compositor is a preprocessing step for single-grid UI:s - on the client, ui_client and tui talk directly to each other - we still do module separation, as ui_client.c could form the basis of a libnvim client module later. Items for later PR:s - vim.ui_attach is still an unhappy child, reconsider based on plugin experience. - the flags in ui_events.in.h are still a mess. Can be simplified now. - UX for remote attachment needs more work. - startup for client can be simplified further (think of the millisecs we can save)
* feat(lua-api): avoid unnecessary allocations (#19877)Lewis Russell2022-11-14
| | | | Lua makes (or reuses) an internal copy of strings, so we can safely push buf pointers onto the stack.
* perf(api): allow to use an arena for return valuesbfredl2022-08-23
|
* feat(ui): implement ui_client event handlershlpr982022-03-15
|
* fix(build): export symbols on WindowsFamiu Haque2021-10-17
| | | | | | Closes https://github.com/neovim/neovim/issues/15063 Allows using Neovim core functions using LuaJIT FFI on Windows.
* refactor(api): handle option dicts properlyBjörn Linse2021-10-03
| | | | | | | Do not copy a lot of lua strings (dict keys) to just strequal() them Just compare them directly to a dedicated hash function. feat(generators): HASHY McHASHFACE
* api: add textlock checknotomo2020-12-15
|
* tree-sitter: implement query functionality and highlighting prototype ↵Björn Linse2019-12-22
| | | | [skip.lint]
* Fix luacheck errors for all Lua source filesSameed Ali2019-07-04
|
* rename: FUNC_API_ASYNC => FUNC_API_FASTBjörn Linse2019-06-30
|
* UI: add "compositor" layer to merge grids for TUI use in a correct wayBjörn Linse2019-02-02
| | | | | | | | Initially we will use this for the popupmenu, floating windows will follow soon NB: writedelay + compositor is weird, we need more flexible redraw introspection.
* api: always use prefix FUNC_API, also change NOEVAL to REMOTE_ONLYBjörn Linse2017-05-10
|
* generators: separate source generators from scriptsBjörn Linse2017-05-10