mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
AK+Everywhere: Store JSON object keys as String
This commit is contained in:
parent
70eb0ba1cd
commit
e591636419
Notes:
github-actions[bot]
2025-02-21 00:29:28 +00:00
Author: https://github.com/trflynn89
Commit: e591636419
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3631
Reviewed-by: https://github.com/awesomekling ✅
23 changed files with 119 additions and 111 deletions
|
@ -749,11 +749,11 @@ void ArgsParser::autocomplete(FILE* file, StringView program_name, ReadonlySpan<
|
|||
|
||||
auto write_completion = [&](auto format, auto& option, auto has_invariant, auto... args) {
|
||||
JsonObject object;
|
||||
object.set("completion", ByteString::formatted(StringView { format, strlen(format) }, args...));
|
||||
object.set("static_offset", 0);
|
||||
object.set("invariant_offset", has_invariant ? option_to_complete.length() : 0u);
|
||||
object.set("display_trivia", StringView { option.help_string, strlen(option.help_string) });
|
||||
object.set("trailing_trivia", option.argument_mode == OptionArgumentMode::Required ? " "sv : ""sv);
|
||||
object.set("completion"sv, ByteString::formatted(StringView { format, strlen(format) }, args...));
|
||||
object.set("static_offset"sv, 0);
|
||||
object.set("invariant_offset"sv, has_invariant ? option_to_complete.length() : 0u);
|
||||
object.set("display_trivia"sv, StringView { option.help_string, strlen(option.help_string) });
|
||||
object.set("trailing_trivia"sv, option.argument_mode == OptionArgumentMode::Required ? " "sv : ""sv);
|
||||
outln(file, "{}", object.to_byte_string());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue