mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
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)
This commit is contained in:
@@ -528,10 +528,15 @@ void vim_register_provider(uint64_t channel_id, String feature, Error *err)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a feature->method list dictionary for all pluggable features
|
||||
Dictionary vim_discover_features(void)
|
||||
Array vim_get_api_info(uint64_t channel_id)
|
||||
{
|
||||
return provider_get_all();
|
||||
Array rv = ARRAY_DICT_INIT;
|
||||
|
||||
assert(channel_id <= INT64_MAX);
|
||||
ADD(rv, INTEGER_OBJ((int64_t)channel_id));
|
||||
ADD(rv, DICTIONARY_OBJ(api_metadata()));
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/// Writes a message to vim output or error buffer. The string is split
|
||||
|
Reference in New Issue
Block a user