mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Added defWithBody
This commit is contained in:
parent
2a770190b0
commit
7f3bf7cc73
7 changed files with 120 additions and 24 deletions
|
@ -10,7 +10,7 @@ use ra_syntax::{
|
|||
use ra_arena::{Arena, RawId, impl_arena_id};
|
||||
|
||||
use crate::{
|
||||
Name, AsName, Function,
|
||||
Name, AsName, Function,DefWithBody,
|
||||
expr::{PatId, ExprId, Pat, Expr, Body, Statement, BodySourceMap},
|
||||
HirDatabase,
|
||||
};
|
||||
|
@ -40,8 +40,8 @@ pub struct ScopeData {
|
|||
|
||||
impl ExprScopes {
|
||||
// FIXME: This should take something more general than Function
|
||||
pub(crate) fn expr_scopes_query(db: &impl HirDatabase, function: Function) -> Arc<ExprScopes> {
|
||||
let body = db.body_hir(function);
|
||||
pub(crate) fn expr_scopes_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<ExprScopes> {
|
||||
let body = db.body_hir(def);
|
||||
let res = ExprScopes::new(body);
|
||||
Arc::new(res)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue