The marker must be followed by '(' on its line, so MF_DESCRIBE does not match MF_DESCRIBE_FUNCTION and the reverse. Generated sidecars are skipped.
52{
53 std::vector<std::filesystem::path> found;
54 std::error_code code;
55 for (const auto& root : roots) {
56 if (std::filesystem::is_regular_file(root, code)) {
57 if (is_header(root) && has_request(root, marker)) {
58 found.push_back(std::filesystem::canonical(root, code));
59 }
60 continue;
61 }
62 for (std::filesystem::recursive_directory_iterator it(root, code), end; it != end; it.increment(code)) {
63 if (code) {
64 break;
65 }
66 if (it->is_regular_file(code) && is_header(it->path()) && has_request(it->path(), marker)) {
67 found.push_back(std::filesystem::canonical(it->path(), code));
68 }
69 }
70 }
71 std::ranges::sort(found);
72 found.erase(std::ranges::unique(found).begin(), found.end());
73 return found;
74}