aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-20 14:44:40 +0000
committerAleksey Kladov <[email protected]>2019-12-20 15:52:02 +0000
commit16ac792f483035f9d9bf6a61b0aefccbdf002188 (patch)
tree7654dbf63b73c54650a85009758635643d93c3d3 /crates/ra_hir_def/src
parent0f212b379811dcb26cde3eba160e07a11182fc5a (diff)
Docs
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/item_scope.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/item_scope.rs b/crates/ra_hir_def/src/item_scope.rs
index 62e7a02cb..3c042a94e 100644
--- a/crates/ra_hir_def/src/item_scope.rs
+++ b/crates/ra_hir_def/src/item_scope.rs
@@ -1,3 +1,6 @@
1//! Describes items defined or visible (ie, imported) in a certain scope.
2//! This is shared between modules and blocks.
3
1use hir_expand::name::Name; 4use hir_expand::name::Name;
2use once_cell::sync::Lazy; 5use once_cell::sync::Lazy;
3use rustc_hash::FxHashMap; 6use rustc_hash::FxHashMap;
@@ -7,11 +10,11 @@ use crate::{per_ns::PerNs, BuiltinType, LocalImportId, MacroDefId, ModuleDefId,
7#[derive(Debug, Default, PartialEq, Eq)] 10#[derive(Debug, Default, PartialEq, Eq)]
8pub struct ModuleScope { 11pub struct ModuleScope {
9 pub(crate) items: FxHashMap<Name, Resolution>, 12 pub(crate) items: FxHashMap<Name, Resolution>,
10 /// Macros visable in current module in legacy textual scope 13 /// Macros visible in current module in legacy textual scope
11 /// 14 ///
12 /// For macros invoked by an unquatified identifier like `bar!()`, `legacy_macros` will be searched in first. 15 /// For macros invoked by an unqualified identifier like `bar!()`, `legacy_macros` will be searched in first.
13 /// If it yields no result, then it turns to module scoped `macros`. 16 /// If it yields no result, then it turns to module scoped `macros`.
14 /// It macros with name quatified with a path like `crate::foo::bar!()`, `legacy_macros` will be skipped, 17 /// It macros with name qualified with a path like `crate::foo::bar!()`, `legacy_macros` will be skipped,
15 /// and only normal scoped `macros` will be searched in. 18 /// and only normal scoped `macros` will be searched in.
16 /// 19 ///
17 /// Note that this automatically inherit macros defined textually before the definition of module itself. 20 /// Note that this automatically inherit macros defined textually before the definition of module itself.