feat(daemon): export the target dependency graph as DOT or JSON
This commit is contained in:
1 parent
66d2fa6a2e
commit
ae57ee7666
9 files changed
+175
-4
No files matched your search
@@ -1470,6 +1470,7 @@ struct DaemonCmdOptions {
|
||||
std::string jobs_arg{"0"};
|
||||
std::string editor_arg{"all"};
|
||||
std::optional<std::string> member_arg;
|
||||
std::string graph_format_arg{"dot"};
|
||||
std::string timeout_ms_arg{"2000"};
|
||||
bool force{false};
|
||||
std::string max_bytes_arg{"0"};
|
||||
@@ -1551,6 +1552,10 @@ int execute_daemon_command(std::string_view sub, const DaemonCmdOptions &opts) {
|
||||
}
|
||||
request_json =
|
||||
std::format(R"({{"op":"describe","profile":{}}})", Util::json_quote(opts.profile_arg));
|
||||
} else if (sub == "graph") {
|
||||
request_json = std::format(R"({{"op":"graph","profile":{},"format":{}}})",
|
||||
Util::json_quote(opts.profile_arg),
|
||||
Util::json_quote(opts.graph_format_arg));
|
||||
} else if (sub == "editor_status") {
|
||||
request_json = R"({"op":"editor_status"})";
|
||||
} else if (sub == "watch_poll") {
|
||||
@@ -2627,6 +2632,15 @@ int main(int argc, char **argv) {
|
||||
.option_default("--profile", "-p", "Profile to export", daemon_opts.profile_arg, "debug")
|
||||
.option("--member", "", "Workspace member (required for workspace roots)",
|
||||
daemon_opts.member_arg);
|
||||
auto &daemon_graph_cmd =
|
||||
daemon_cmd.subcommand("graph", "Export the target dependency graph via the daemon");
|
||||
configure_daemon_common(daemon_graph_cmd);
|
||||
daemon_graph_cmd
|
||||
.option_default("--profile", "-p", "Profile to evaluate", daemon_opts.profile_arg, "debug")
|
||||
.option_default("--format", "-f", "Output format (dot|json)", daemon_opts.graph_format_arg,
|
||||
"dot")
|
||||
.option("--member", "", "Workspace member (required for workspace roots)",
|
||||
daemon_opts.member_arg);
|
||||
auto &daemon_ide_cmd = daemon_cmd.subcommand("ide", "Editor/IDE metadata served by the daemon");
|
||||
configure_daemon_common(daemon_ide_cmd);
|
||||
auto &daemon_ide_query_cmd =
|
||||
|
||||
Reference in new issue
Block a user