feat: filter daemon actions by kind; show registry release detail
This commit is contained in:
1 parent
624016d904
commit
691560a369
11 files changed
+228
-21
No files matched your search
+15
-4
@@ -1341,8 +1341,8 @@ std::string target_info_project(const DaemonOptions &options, std::string_view p
|
||||
// Lists the lowered graph's actions (bounded) for editor extensions and diagnostics.
|
||||
std::string actions_project(const DaemonOptions &options, std::string_view profile_name,
|
||||
std::optional<CompilerFamily> compiler_override,
|
||||
std::string_view target_filter, std::size_t limit,
|
||||
std::string_view member) {
|
||||
std::string_view target_filter, std::string_view kind_filter,
|
||||
std::size_t limit, std::string_view member) {
|
||||
auto effective_result = resolve_member_options(options, member);
|
||||
if (!effective_result) {
|
||||
return error_response(std::format("actions: {}", effective_result.error()));
|
||||
@@ -1363,6 +1363,9 @@ std::string actions_project(const DaemonOptions &options, std::string_view profi
|
||||
if (!target_filter.empty() && action.target_name != target_filter) {
|
||||
continue;
|
||||
}
|
||||
if (!kind_filter.empty() && action_kind_label(action.kind) != kind_filter) {
|
||||
continue;
|
||||
}
|
||||
++total;
|
||||
if (actions.size() >= limit) {
|
||||
continue;
|
||||
@@ -2372,6 +2375,14 @@ DaemonServer::Impl::DispatchResult DaemonServer::Impl::dispatch(std::string_view
|
||||
}
|
||||
target_filter = *value;
|
||||
}
|
||||
std::string kind_filter;
|
||||
if (const auto entry = object->find("kind"); entry != object->end()) {
|
||||
const auto *value = std::get_if<std::string>(&entry->second.value);
|
||||
if (value == nullptr || value->size() > 64) {
|
||||
return {error_response("\"kind\" must be a bounded string"), false};
|
||||
}
|
||||
kind_filter = *value;
|
||||
}
|
||||
std::size_t limit = 100;
|
||||
if (const auto entry = object->find("limit"); entry != object->end()) {
|
||||
const auto *value = std::get_if<std::int64_t>(&entry->second.value);
|
||||
@@ -2383,8 +2394,8 @@ DaemonServer::Impl::DispatchResult DaemonServer::Impl::dispatch(std::string_view
|
||||
}
|
||||
limit = static_cast<std::size_t>(*value);
|
||||
}
|
||||
return {actions_project(options, profile_name, compiler_override, target_filter, limit,
|
||||
member),
|
||||
return {actions_project(options, profile_name, compiler_override, target_filter,
|
||||
kind_filter, limit, member),
|
||||
false};
|
||||
}
|
||||
if (*name == "target_info" || *name == "target_flags") {
|
||||
|
||||
Reference in new issue
Block a user