diff options
Diffstat (limited to 'crates/libeditor/src/scope')
-rw-r--r-- | crates/libeditor/src/scope/fn_scope.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/libeditor/src/scope/fn_scope.rs b/crates/libeditor/src/scope/fn_scope.rs index 5c04e2f9b..78e9c061c 100644 --- a/crates/libeditor/src/scope/fn_scope.rs +++ b/crates/libeditor/src/scope/fn_scope.rs | |||
@@ -13,6 +13,7 @@ type ScopeId = usize; | |||
13 | 13 | ||
14 | #[derive(Debug)] | 14 | #[derive(Debug)] |
15 | pub struct FnScopes { | 15 | pub struct FnScopes { |
16 | pub self_param: Option<SyntaxNode>, | ||
16 | scopes: Vec<ScopeData>, | 17 | scopes: Vec<ScopeData>, |
17 | scope_for: HashMap<SyntaxNode, ScopeId>, | 18 | scope_for: HashMap<SyntaxNode, ScopeId>, |
18 | } | 19 | } |
@@ -20,6 +21,9 @@ pub struct FnScopes { | |||
20 | impl FnScopes { | 21 | impl FnScopes { |
21 | pub fn new(fn_def: ast::FnDef) -> FnScopes { | 22 | pub fn new(fn_def: ast::FnDef) -> FnScopes { |
22 | let mut scopes = FnScopes { | 23 | let mut scopes = FnScopes { |
24 | self_param: fn_def.param_list() | ||
25 | .and_then(|it| it.self_param()) | ||
26 | .map(|it| it.syntax().owned()), | ||
23 | scopes: Vec::new(), | 27 | scopes: Vec::new(), |
24 | scope_for: HashMap::new() | 28 | scope_for: HashMap::new() |
25 | }; | 29 | }; |