aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/src/scope
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-31 14:30:42 +0100
committerAleksey Kladov <[email protected]>2018-08-31 14:30:42 +0100
commit7a5bc94774a50837f8c9bf8b96c8272882aca640 (patch)
tree7d96566cbbf7bdd636fd095acb6bff12bba1ec13 /crates/libeditor/src/scope
parentcdb9b4cbf417976739de5147938e2c3080e497b9 (diff)
complete self
Diffstat (limited to 'crates/libeditor/src/scope')
-rw-r--r--crates/libeditor/src/scope/fn_scope.rs4
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)]
15pub struct FnScopes { 15pub 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 {
20impl FnScopes { 21impl 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 };