Struct ra_ap_ide_ssr::MatchFinder [−][src]
pub struct MatchFinder<'db> { /* fields omitted */ }
Expand description
Searches a crate for pattern matches and possibly replaces them with something else.
Implementations
pub fn in_context(
db: &'db RootDatabase,
lookup_context: FilePosition,
restrict_ranges: Vec<FileRange>
) -> MatchFinder<'db>
pub fn in_context(
db: &'db RootDatabase,
lookup_context: FilePosition,
restrict_ranges: Vec<FileRange>
) -> MatchFinder<'db>
Constructs a new instance where names will be looked up as if they appeared at
lookup_context
.
Constructs an instance using the start of the first file in db
as the lookup context.
Adds a rule to be applied. The order in which rules are added matters. Earlier rules take precedence. If a node is matched by an earlier rule, then later rules won’t be permitted to match to it.
Finds matches for all added rules and returns edits for all found matches.
Adds a search pattern. For use if you intend to only call find_matches_in_file
. If you
intend to do replacement, use add_rule
instead.
Returns matches for all added rules.
Finds all nodes in file_id
whose text is exactly equal to snippet
and attempts to match
them, while recording reasons why they don’t match. This API is useful for command
line-based debugging where providing a range is difficult.
Auto Trait Implementations
impl<'db> !RefUnwindSafe for MatchFinder<'db>
impl<'db> !Send for MatchFinder<'db>
impl<'db> !Sync for MatchFinder<'db>
impl<'db> Unpin for MatchFinder<'db>
impl<'db> !UnwindSafe for MatchFinder<'db>
Blanket Implementations
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more