aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/item_tree.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-06-12 22:24:26 +0100
committerJonas Schievink <[email protected]>2020-06-24 15:52:37 +0100
commite24de2007fe1850bb5c6c289ea48f7cb4424bb0a (patch)
tree3a9c5ba115d843d6bf12a4b497cfc111f3363845 /crates/ra_hir_def/src/item_tree.rs
parent696a7a5a410f419cf7f6638d9f4894802640adf8 (diff)
collector changes WIP
Diffstat (limited to 'crates/ra_hir_def/src/item_tree.rs')
-rw-r--r--crates/ra_hir_def/src/item_tree.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index 3ea6e10c9..9dee4f43d 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -82,8 +82,8 @@ impl ItemTree {
82 82
83 /// Returns an iterator over all items located at the top level of the `HirFileId` this 83 /// Returns an iterator over all items located at the top level of the `HirFileId` this
84 /// `ItemTree` was created from. 84 /// `ItemTree` was created from.
85 pub fn top_level_items(&self) -> impl Iterator<Item = ModItem> + '_ { 85 pub fn top_level_items(&self) -> &[ModItem] {
86 self.top_level.iter().copied() 86 &self.top_level
87 } 87 }
88} 88}
89 89
@@ -120,7 +120,7 @@ impl_index!(
120); 120);
121 121
122/// A desugared `extern crate` or `use` import. 122/// A desugared `extern crate` or `use` import.
123#[derive(Debug, Eq, PartialEq)] 123#[derive(Debug, Clone, Eq, PartialEq)]
124pub struct Import { 124pub struct Import {
125 pub path: ModPath, 125 pub path: ModPath,
126 pub alias: Option<ImportAlias>, 126 pub alias: Option<ImportAlias>,
@@ -220,6 +220,12 @@ pub struct Mod {
220 pub items: Vec<ModItem>, 220 pub items: Vec<ModItem>,
221} 221}
222 222
223pub enum ModKind {
224 Inline { items: Vec<ModItem> },
225
226 Outline {},
227}
228
223#[derive(Debug, Eq, PartialEq)] 229#[derive(Debug, Eq, PartialEq)]
224pub struct MacroCall { 230pub struct MacroCall {
225 pub name: Option<Name>, 231 pub name: Option<Name>,