Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-ssr/src/search.rs')
-rw-r--r--crates/ide-ssr/src/search.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ide-ssr/src/search.rs b/crates/ide-ssr/src/search.rs
index 9afbedbb1a..99a98fb2a7 100644
--- a/crates/ide-ssr/src/search.rs
+++ b/crates/ide-ssr/src/search.rs
@@ -21,13 +21,13 @@ pub(crate) struct UsageCache {
usages: Vec<(Definition, UsageSearchResult)>,
}
-impl MatchFinder<'_> {
+impl<'db> MatchFinder<'db> {
/// Adds all matches for `rule` to `matches_out`. Matches may overlap in ways that make
/// replacement impossible, so further processing is required in order to properly nest matches
/// and remove overlapping matches. This is done in the `nesting` module.
pub(crate) fn find_matches_for_rule(
&self,
- rule: &ResolvedRule,
+ rule: &ResolvedRule<'db>,
usage_cache: &mut UsageCache,
matches_out: &mut Vec<Match>,
) {
@@ -49,8 +49,8 @@ impl MatchFinder<'_> {
fn find_matches_for_pattern_tree(
&self,
- rule: &ResolvedRule,
- pattern: &ResolvedPattern,
+ rule: &ResolvedRule<'db>,
+ pattern: &ResolvedPattern<'db>,
usage_cache: &mut UsageCache,
matches_out: &mut Vec<Match>,
) {
@@ -144,7 +144,7 @@ impl MatchFinder<'_> {
SearchScope::files(&files)
}
- fn slow_scan(&self, rule: &ResolvedRule, matches_out: &mut Vec<Match>) {
+ fn slow_scan(&self, rule: &ResolvedRule<'db>, matches_out: &mut Vec<Match>) {
self.search_files_do(|file_id| {
let file = self.sema.parse_guess_edition(file_id);
let code = file.syntax();
@@ -177,7 +177,7 @@ impl MatchFinder<'_> {
fn slow_scan_node(
&self,
code: &SyntaxNode,
- rule: &ResolvedRule,
+ rule: &ResolvedRule<'db>,
restrict_range: &Option<FileRange>,
matches_out: &mut Vec<Match>,
) {
@@ -206,7 +206,7 @@ impl MatchFinder<'_> {
fn try_add_match(
&self,
- rule: &ResolvedRule,
+ rule: &ResolvedRule<'db>,
code: &SyntaxNode,
restrict_range: &Option<FileRange>,
matches_out: &mut Vec<Match>,
@@ -274,7 +274,7 @@ impl UsageCache {
/// 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.
-fn pick_path_for_usages(pattern: &ResolvedPattern) -> Option<&ResolvedPath> {
+fn pick_path_for_usages<'a>(pattern: &'a ResolvedPattern<'_>) -> Option<&'a ResolvedPath> {
// FIXME: Take the scope of the resolved path into account. e.g. if there are any paths that are
// private to the current module, then we definitely would want to pick them over say a path
// from std. Possibly we should go further than this and intersect the search scopes for all