mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
internal: Don't parse files unnecessarily in scope_for_offset
This commit is contained in:
parent
84a6fac37a
commit
cb6703fe06
4 changed files with 10 additions and 6 deletions
|
@ -650,9 +650,7 @@ fn scope_for_offset(
|
|||
.filter_map(|(id, scope)| {
|
||||
let InFile { file_id, value } = source_map.expr_syntax(*id).ok()?;
|
||||
if from_file == file_id {
|
||||
let root = db.parse_or_expand(file_id)?;
|
||||
let node = value.to_node(&root);
|
||||
return Some((node.syntax().text_range(), scope));
|
||||
return Some((value.text_range(), scope));
|
||||
}
|
||||
|
||||
// FIXME handle attribute expansion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue