feat(daemon): list editor generation history
This commit is contained in:
1 parent
ba682e8bd1
commit
41a74bc925
8 files changed
+217
-2
No files matched your search
@@ -1569,6 +1569,13 @@ int execute_daemon_command(std::string_view sub, const DaemonCmdOptions &opts) {
|
||||
request_json = R"({"op":"workspace_members"})";
|
||||
} else if (sub == "ide_configs") {
|
||||
request_json = R"({"op":"ide_configs"})";
|
||||
} else if (sub == "compdb_generations") {
|
||||
if (opts.profile_arg.empty()) {
|
||||
std::cerr << "vbs daemon compdb generations: --profile must not be empty\n";
|
||||
return 2;
|
||||
}
|
||||
request_json = std::format(R"({{"op":"compdb_generations","profile":{}}})",
|
||||
Util::json_quote(opts.profile_arg));
|
||||
} else if (sub == "compdb_entries") {
|
||||
request_json =
|
||||
std::format(R"({{"op":"compdb_entries","limit":{}{}}})", opts.limit_arg,
|
||||
@@ -2646,6 +2653,11 @@ int main(int argc, char **argv) {
|
||||
daemon_opts.jobs_arg, "0");
|
||||
auto &daemon_compdb_cmd =
|
||||
daemon_cmd.subcommand("compdb", "Editor compilation database served by the daemon");
|
||||
auto &daemon_compdb_generations_cmd = daemon_compdb_cmd.subcommand(
|
||||
"generations", "List immutable editor generations for a profile");
|
||||
configure_daemon_common(daemon_compdb_generations_cmd);
|
||||
daemon_compdb_generations_cmd.option_default("--profile", "-p", "Profile to inspect",
|
||||
daemon_opts.profile_arg, "debug");
|
||||
auto &daemon_compdb_entries_cmd = daemon_compdb_cmd.subcommand(
|
||||
"entries", "Query bounded compile_commands entries for editor extensions");
|
||||
configure_daemon_common(daemon_compdb_entries_cmd);
|
||||
@@ -2839,6 +2851,9 @@ int main(int argc, char **argv) {
|
||||
} else if (daemon_sub == "ide" && parsed.matched_command_path.size() > 2 &&
|
||||
parsed.matched_command_path[2] == "configs") {
|
||||
daemon_sub = "ide_configs";
|
||||
} else if (daemon_sub == "compdb" && parsed.matched_command_path.size() > 2 &&
|
||||
parsed.matched_command_path[2] == "generations") {
|
||||
daemon_sub = "compdb_generations";
|
||||
}
|
||||
return execute_daemon_command(daemon_sub, daemon_opts);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user