diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-12-02 04:16:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-02 04:16:44 -0800 |
commit | 716adbcc4563f5b4d1b7bc0301530296c538a33c (patch) | |
tree | 7b2b4750bc17f7019029ac28f4fa276756e79e88 /src/nvim/generators/c_grammar.lua | |
parent | c1378413c142e1762b80132c41b10c16c4aa7c13 (diff) | |
download | rneovim-716adbcc4563f5b4d1b7bc0301530296c538a33c.tar.gz rneovim-716adbcc4563f5b4d1b7bc0301530296c538a33c.tar.bz2 rneovim-716adbcc4563f5b4d1b7bc0301530296c538a33c.zip |
fix(api): deprecate nvim_subscribe, nvim_unsubscribe #30456
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
```
Diffstat (limited to 'src/nvim/generators/c_grammar.lua')
-rw-r--r-- | src/nvim/generators/c_grammar.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/generators/c_grammar.lua b/src/nvim/generators/c_grammar.lua index 9b1c284c1e..890c260843 100644 --- a/src/nvim/generators/c_grammar.lua +++ b/src/nvim/generators/c_grammar.lua @@ -257,6 +257,11 @@ if arg[1] == '--test' then 'char *xstpcpy(char *restrict dst, const char *restrict src) {}', 'bool try_leave(const TryState *const tstate, Error *const err) {}', 'void api_set_error(ErrorType errType) {}', + { + 'void nvim_subscribe(uint64_t channel_id, String event)', + 'FUNC_API_SINCE(1) FUNC_API_DEPRECATED_SINCE(13) FUNC_API_REMOTE_ONLY', + '{}', + }, -- Do not consume leading preproc statements { |