Skip to main content

Module search

Module search 

Source
Expand description

Searching for matches.

Structs§

UsageCache 🔒
A cache for the results of find_usages. This is for when we have multiple patterns that have the same path. e.g. if the pattern was foo::Bar that can parse as a path, an expression, a type and as a pattern. In each, the usages of foo::Bar are the same and we’d like to avoid finding them more than once.

Functions§

is_search_permitted 🔒
Returns whether we support matching within this kind of node.
is_search_permitted_ancestors 🔒
Returns whether we support matching within node and all of its ancestors.
pick_path_for_usages 🔒
Returns a path that’s suitable for path resolution. We exclude builtin types, since they aren’t something that we can find references to. We then somewhat arbitrarily pick the path that is the longest as this is hopefully more likely to be less common, making it faster to find.