zls
zls copied to clipboard
Proposal: Only show missing fields in autocompletion on struct initialization
So right now I'm in the process of learning Vulkan and it has a ton of large configuration structs. Now I would like to know what fields are missing so far and it would be nice if autocomplete would only show missing members. Since it isn't allowed to initialize a field twice it doesn't even make sense to show already present fields.
Current:
Proposed:
The completion tests for struct initialization have some examples of this here.
Initial support in https://github.com/zigtools/zls/tree/nullptrdevs/c012,
Excludes fields/switch cases that precede the current source_index, ie
S{ .a = 1, .b = 2, . // ^--- excluded from completions list .fields_here = 3, .are_shown = 4, };