aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/source_binder.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-04-13 09:24:09 +0100
committerAleksey Kladov <[email protected]>2019-04-13 09:24:09 +0100
commitf9e825d95624129b66c34f25904f6ae46b9d5760 (patch)
treedd58a7e954b8479abf218a5da5245542c091f529 /crates/ra_hir/src/source_binder.rs
parentd387bdccba2b5bb681e5b6c84cc1b0efe5c1a79a (diff)
move ScopeEntryWithSyntax
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r--crates/ra_hir/src/source_binder.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index a50287339..34a00a300 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -19,7 +19,7 @@ use ra_syntax::{
19use crate::{ 19use crate::{
20 HirDatabase, Function, Struct, Enum, Const, Static, Either, DefWithBody, PerNs, Name, 20 HirDatabase, Function, Struct, Enum, Const, Static, Either, DefWithBody, PerNs, Name,
21 AsName, Module, HirFileId, Crate, Trait, Resolver, 21 AsName, Module, HirFileId, Crate, Trait, Resolver,
22 expr::{BodySourceMap, scope::{ReferenceDescriptor, ScopeEntryWithSyntax, ScopeId, ExprScopes}}, 22 expr::{BodySourceMap, scope::{ReferenceDescriptor, ScopeId, ExprScopes}},
23 ids::LocationCtx, 23 ids::LocationCtx,
24 expr, AstId 24 expr, AstId
25}; 25};
@@ -187,6 +187,22 @@ pub enum PathResolution {
187 AssocItem(crate::ImplItem), 187 AssocItem(crate::ImplItem),
188} 188}
189 189
190#[derive(Debug, Clone, PartialEq, Eq)]
191pub struct ScopeEntryWithSyntax {
192 pub(crate) name: Name,
193 pub(crate) ptr: Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>,
194}
195
196impl ScopeEntryWithSyntax {
197 pub fn name(&self) -> &Name {
198 &self.name
199 }
200
201 pub fn ptr(&self) -> Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>> {
202 self.ptr
203 }
204}
205
190impl SourceAnalyzer { 206impl SourceAnalyzer {
191 pub fn new( 207 pub fn new(
192 db: &impl HirDatabase, 208 db: &impl HirDatabase,