aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/provider.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-09-11 21:56:52 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-09-12 13:50:07 -0300
commitcd2e46c0785d40b9ea15f6d722a3fad54c007b9b (patch)
tree57503e18a1a685545750748b7fc854cb6ec85062 /src/nvim/os/provider.c
parent15ca58d79f8cc8565c1a2b2581029cf7901b5fbd (diff)
downloadrneovim-cd2e46c0785d40b9ea15f6d722a3fad54c007b9b.tar.gz
rneovim-cd2e46c0785d40b9ea15f6d722a3fad54c007b9b.tar.bz2
rneovim-cd2e46c0785d40b9ea15f6d722a3fad54c007b9b.zip
api/msgpack-rpc: Refactor metadata object construction
Instead of building all metadata from msgpack-gen.lua, we now merge the generated part with manual information(such as types and features). The metadata is accessible through the api method `vim_get_api_info`. This was done to simplify the generator while also increasing flexibility(by being able to add more metadata)
Diffstat (limited to 'src/nvim/os/provider.c')
-rw-r--r--src/nvim/os/provider.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/os/provider.c b/src/nvim/os/provider.c
index 9d8f6f297c..2e7a677793 100644
--- a/src/nvim/os/provider.c
+++ b/src/nvim/os/provider.c
@@ -120,9 +120,9 @@ Object provider_call(char *method, Array args)
return result;
}
-Dictionary provider_get_all(void)
+void provider_init_feature_metadata(Dictionary *metadata)
{
- Dictionary rv = ARRAY_DICT_INIT;
+ Dictionary md = ARRAY_DICT_INIT;
for (size_t i = 0; i < FEATURE_COUNT; i++) {
Array methods = ARRAY_DICT_INIT;
@@ -134,10 +134,10 @@ Dictionary provider_get_all(void)
ADD(methods, STRING_OBJ(cstr_to_string(method)));
}
- PUT(rv, f->name, ARRAY_OBJ(methods));
+ PUT(md, f->name, ARRAY_OBJ(methods));
}
- return rv;
+ PUT(*metadata, "features", DICTIONARY_OBJ(md));
}
static Feature * find_feature(char *name)