mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:17:36 +00:00
LibGUI: Allow completion suggestions to fill and display different text
There are times when it is nice to display one suggestion but fill something different. This lays the groundwork for allowing GMLAutocompleteProvider to automatically add ': ' to the end of suggested properties, while keeping the ': ' suffix from cluttering up the suggestion UI.
This commit is contained in:
parent
96029a4ac6
commit
a5b3c3f85f
3 changed files with 14 additions and 4 deletions
|
@ -22,6 +22,7 @@ inline bool encode(IPC::Encoder& encoder, const GUI::AutocompleteProvider::Entry
|
|||
encoder << (u64)response.partial_input_length;
|
||||
encoder << (u32)response.kind;
|
||||
encoder << (u32)response.language;
|
||||
encoder << response.display_text;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -34,7 +35,8 @@ inline bool decode(IPC::Decoder& decoder, GUI::AutocompleteProvider::Entry& resp
|
|||
bool ok = decoder.decode(response.completion)
|
||||
&& decoder.decode(partial_input_length)
|
||||
&& decoder.decode(kind)
|
||||
&& decoder.decode(language);
|
||||
&& decoder.decode(language)
|
||||
&& decoder.decode(response.display_text);
|
||||
|
||||
if (ok) {
|
||||
response.kind = static_cast<GUI::AutocompleteProvider::CompletionKind>(kind);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue