diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-21 23:28:47 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-21 23:28:47 +0000 |
commit | 4e4ca27eabac6a9c97dc07baf9a067efdfc63384 (patch) | |
tree | 83c75bdefa688a220054bf671ffe1692887d6dd4 /crates/ra_hir | |
parent | e4d0930d9c6478f7aa069401fb7e28ab7c80fd14 (diff) | |
parent | ea763c73b8d89edbf716805c62cf31b00e2e1a4f (diff) |
Merge #319
319: Completion icons r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/function/scope.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/module.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/module/nameres.rs | 2 |
4 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/function/scope.rs b/crates/ra_hir/src/function/scope.rs index 9f1aa1ef2..77be25f1a 100644 --- a/crates/ra_hir/src/function/scope.rs +++ b/crates/ra_hir/src/function/scope.rs | |||
@@ -95,7 +95,7 @@ impl FnScopes { | |||
95 | r1.start().cmp(&r2.start()) | 95 | r1.start().cmp(&r2.start()) |
96 | } | 96 | } |
97 | }) | 97 | }) |
98 | .map(|(ptr, scope)| *scope) | 98 | .map(|(_ptr, scope)| *scope) |
99 | .unwrap_or(original_scope) | 99 | .unwrap_or(original_scope) |
100 | } | 100 | } |
101 | 101 | ||
@@ -209,7 +209,6 @@ fn compute_block_scopes(block: ast::Block, scopes: &mut FnScopes, mut scope: Sco | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | if let Some(expr) = block.expr() { | 211 | if let Some(expr) = block.expr() { |
212 | eprintln!("{:?}", expr); | ||
213 | scopes.set_scope(expr.syntax(), scope); | 212 | scopes.set_scope(expr.syntax(), scope); |
214 | compute_expr_scopes(expr, scopes, scope); | 213 | compute_expr_scopes(expr, scopes, scope); |
215 | } | 214 | } |
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 5941a9ea3..f56214b47 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -39,7 +39,7 @@ use crate::{ | |||
39 | pub use self::{ | 39 | pub use self::{ |
40 | path::{Path, PathKind}, | 40 | path::{Path, PathKind}, |
41 | krate::Crate, | 41 | krate::Crate, |
42 | module::{Module, ModuleId, Problem, nameres::ItemMap}, | 42 | module::{Module, ModuleId, Problem, nameres::ItemMap, ModuleScope, Resolution}, |
43 | function::{Function, FnScopes}, | 43 | function::{Function, FnScopes}, |
44 | }; | 44 | }; |
45 | 45 | ||
diff --git a/crates/ra_hir/src/module.rs b/crates/ra_hir/src/module.rs index d5866f6ef..cd31e8cfe 100644 --- a/crates/ra_hir/src/module.rs +++ b/crates/ra_hir/src/module.rs | |||
@@ -16,7 +16,7 @@ use crate::{ | |||
16 | arena::{Arena, Id}, | 16 | arena::{Arena, Id}, |
17 | }; | 17 | }; |
18 | 18 | ||
19 | pub use self::nameres::ModuleScope; | 19 | pub use self::nameres::{ModuleScope, Resolution}; |
20 | 20 | ||
21 | /// `Module` is API entry point to get all the information | 21 | /// `Module` is API entry point to get all the information |
22 | /// about a particular module. | 22 | /// about a particular module. |
diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs index f44abc730..39e891cda 100644 --- a/crates/ra_hir/src/module/nameres.rs +++ b/crates/ra_hir/src/module/nameres.rs | |||
@@ -49,7 +49,7 @@ pub struct ModuleScope { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | impl ModuleScope { | 51 | impl ModuleScope { |
52 | pub fn entries<'a>(&'a self) -> impl Iterator<Item = (&'a SmolStr, &Resolution)> + 'a { | 52 | pub fn entries<'a>(&'a self) -> impl Iterator<Item = (&'a SmolStr, &'a Resolution)> + 'a { |
53 | self.items.iter() | 53 | self.items.iter() |
54 | } | 54 | } |
55 | pub fn get(&self, name: &SmolStr) -> Option<&Resolution> { | 55 | pub fn get(&self, name: &SmolStr) -> Option<&Resolution> { |