MCPcopy Create free account
hub / github.com/csskit/csskit / find_queryable_nodes

Function find_queryable_nodes

crates/csskit_source_finder/src/lib.rs:198–203  ·  view source on GitHub ↗

Find types that are queryable (have `#[visit]`, `#[visit(self)]`, or `#[visit(all)]` - not skip/children) Queryable nodes are those that get a NodeId and can be matched by selectors.

(dir: &str, matches: &mut HashSet<VisitableNode>, path_callback: impl Fn(&PathBuf) + Copy)

Source from the content-addressed store, hash-verified

196///
197/// Queryable nodes are those that get a NodeId and can be matched by selectors.
198pub fn find_queryable_nodes(dir: &str, matches: &mut HashSet<VisitableNode>, path_callback: impl Fn(&PathBuf) + Copy) {
199 let mut all_visitable = HashSet::new();
200 find_visitable_nodes(dir, &mut all_visitable, path_callback);
201 // Filter to only queryable modes
202 matches.extend(all_visitable.into_iter().filter(|node| node.visit_mode.is_queryable()));
203}
204
205#[test]
206fn test_find_visitable_nodes() {

Callers 1

mainFunction · 0.85

Calls 3

find_visitable_nodesFunction · 0.85
into_iterMethod · 0.80
is_queryableMethod · 0.80

Tested by

no test coverage detected