refactor(api)!: rename Dictionary => Dict

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.
This commit is contained in:
Justin M. Keyes
2024-09-20 07:34:50 +02:00
parent 5acdc4499e
commit 737f58e232
77 changed files with 606 additions and 622 deletions

View File

@@ -128,8 +128,7 @@ void remote_ui_wait_for_attach(bool only_stdio)
/// @param height Requested screen rows
/// @param options |ui-option| map
/// @param[out] err Error details, if any
void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dictionary options,
Error *err)
void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dict options, Error *err)
FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY
{
if (map_has(uint64_t, &connected_uis, channel_id)) {
@@ -687,8 +686,8 @@ void remote_ui_hl_attr_define(RemoteUI *ui, Integer id, HlAttrs rgb_attrs, HlAtt
PUT_C(rgb, "url", CSTR_AS_OBJ(url));
}
ADD_C(args, DICTIONARY_OBJ(rgb));
ADD_C(args, DICTIONARY_OBJ(cterm));
ADD_C(args, DICT_OBJ(rgb));
ADD_C(args, DICT_OBJ(cterm));
if (ui->ui_ext[kUIHlState]) {
ADD_C(args, ARRAY_OBJ(info));
@@ -709,7 +708,7 @@ void remote_ui_highlight_set(RemoteUI *ui, int id)
MAXSIZE_TEMP_DICT(dict, HLATTRS_DICT_SIZE);
hlattrs2dict(&dict, NULL, syn_attr2entry(id), ui->rgb, false);
MAXSIZE_TEMP_ARRAY(args, 1);
ADD_C(args, DICTIONARY_OBJ(dict));
ADD_C(args, DICT_OBJ(dict));
push_call(ui, "highlight_set", args);
}
@@ -920,11 +919,11 @@ static Array translate_contents(RemoteUI *ui, Array contents, Arena *arena)
Array new_item = arena_array(arena, 2);
int attr = (int)item.items[0].data.integer;
if (attr) {
Dictionary rgb_attrs = arena_dict(arena, HLATTRS_DICT_SIZE);
Dict rgb_attrs = arena_dict(arena, HLATTRS_DICT_SIZE);
hlattrs2dict(&rgb_attrs, NULL, syn_attr2entry(attr), ui->rgb, false);
ADD_C(new_item, DICTIONARY_OBJ(rgb_attrs));
ADD_C(new_item, DICT_OBJ(rgb_attrs));
} else {
ADD_C(new_item, DICTIONARY_OBJ((Dictionary)ARRAY_DICT_INIT));
ADD_C(new_item, DICT_OBJ((Dict)ARRAY_DICT_INIT));
}
ADD_C(new_item, item.items[1]);
ADD_C(new_contents, ARRAY_OBJ(new_item));