Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-ssr/src/from_comment.rs')
-rw-r--r--crates/ide-ssr/src/from_comment.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ide-ssr/src/from_comment.rs b/crates/ide-ssr/src/from_comment.rs
index a14e69030e..181cc74a51 100644
--- a/crates/ide-ssr/src/from_comment.rs
+++ b/crates/ide-ssr/src/from_comment.rs
@@ -1,10 +1,10 @@
//! This module allows building an SSR MatchFinder by parsing the SSR rule
//! from a comment.
-use ide_db::{base_db::SourceDatabase, EditionedFileId, FilePosition, FileRange, RootDatabase};
+use ide_db::{EditionedFileId, FilePosition, FileRange, RootDatabase, base_db::RootQueryDb};
use syntax::{
- ast::{self, AstNode, AstToken},
TextRange,
+ ast::{self, AstNode, AstToken},
};
use crate::MatchFinder;
@@ -17,7 +17,9 @@ pub fn ssr_from_comment(
frange: FileRange,
) -> Option<(MatchFinder<'_>, TextRange)> {
let comment = {
- let file = db.parse(EditionedFileId::current_edition(frange.file_id));
+ let file_id = EditionedFileId::current_edition(db, frange.file_id);
+
+ let file = db.parse(file_id);
file.tree().syntax().token_at_offset(frange.range.start()).find_map(ast::Comment::cast)
}?;
let comment_text_without_prefix = comment.text().strip_prefix(comment.prefix()).unwrap();