diff options
Diffstat (limited to 'crates/ra_analysis/src/hir/module/nameres.rs')
-rw-r--r-- | crates/ra_analysis/src/hir/module/nameres.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_analysis/src/hir/module/nameres.rs b/crates/ra_analysis/src/hir/module/nameres.rs index f7d8c8e8c..9dc54f6c0 100644 --- a/crates/ra_analysis/src/hir/module/nameres.rs +++ b/crates/ra_analysis/src/hir/module/nameres.rs | |||
@@ -30,7 +30,7 @@ use crate::{ | |||
30 | Cancelable, FileId, | 30 | Cancelable, FileId, |
31 | loc2id::{DefId, DefLoc}, | 31 | loc2id::{DefId, DefLoc}, |
32 | hir::{ | 32 | hir::{ |
33 | FileItemId, FileItems, | 33 | SourceFileItemId, SourceFileItems, |
34 | Path, PathKind, | 34 | Path, PathKind, |
35 | HirDatabase, | 35 | HirDatabase, |
36 | module::{ModuleId, ModuleTree}, | 36 | module::{ModuleId, ModuleTree}, |
@@ -73,7 +73,7 @@ pub(crate) struct InputModuleItems { | |||
73 | 73 | ||
74 | #[derive(Debug, PartialEq, Eq)] | 74 | #[derive(Debug, PartialEq, Eq)] |
75 | struct ModuleItem { | 75 | struct ModuleItem { |
76 | id: FileItemId, | 76 | id: SourceFileItemId, |
77 | name: SmolStr, | 77 | name: SmolStr, |
78 | kind: SyntaxKind, | 78 | kind: SyntaxKind, |
79 | vis: Vis, | 79 | vis: Vis, |
@@ -93,7 +93,7 @@ struct Import { | |||
93 | 93 | ||
94 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 94 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
95 | pub(crate) struct NamedImport { | 95 | pub(crate) struct NamedImport { |
96 | file_item_id: FileItemId, | 96 | file_item_id: SourceFileItemId, |
97 | relative_range: TextRange, | 97 | relative_range: TextRange, |
98 | } | 98 | } |
99 | 99 | ||
@@ -135,7 +135,7 @@ pub(crate) struct Resolution { | |||
135 | 135 | ||
136 | impl InputModuleItems { | 136 | impl InputModuleItems { |
137 | pub(in crate::hir) fn new<'a>( | 137 | pub(in crate::hir) fn new<'a>( |
138 | file_items: &FileItems, | 138 | file_items: &SourceFileItems, |
139 | items: impl Iterator<Item = ast::ModuleItem<'a>>, | 139 | items: impl Iterator<Item = ast::ModuleItem<'a>>, |
140 | ) -> InputModuleItems { | 140 | ) -> InputModuleItems { |
141 | let mut res = InputModuleItems::default(); | 141 | let mut res = InputModuleItems::default(); |
@@ -145,7 +145,7 @@ impl InputModuleItems { | |||
145 | res | 145 | res |
146 | } | 146 | } |
147 | 147 | ||
148 | fn add_item(&mut self, file_items: &FileItems, item: ast::ModuleItem) -> Option<()> { | 148 | fn add_item(&mut self, file_items: &SourceFileItems, item: ast::ModuleItem) -> Option<()> { |
149 | match item { | 149 | match item { |
150 | ast::ModuleItem::StructDef(it) => self.items.push(ModuleItem::new(file_items, it)?), | 150 | ast::ModuleItem::StructDef(it) => self.items.push(ModuleItem::new(file_items, it)?), |
151 | ast::ModuleItem::EnumDef(it) => self.items.push(ModuleItem::new(file_items, it)?), | 151 | ast::ModuleItem::EnumDef(it) => self.items.push(ModuleItem::new(file_items, it)?), |
@@ -166,7 +166,7 @@ impl InputModuleItems { | |||
166 | Some(()) | 166 | Some(()) |
167 | } | 167 | } |
168 | 168 | ||
169 | fn add_use_item(&mut self, file_items: &FileItems, item: ast::UseItem) { | 169 | fn add_use_item(&mut self, file_items: &SourceFileItems, item: ast::UseItem) { |
170 | let file_item_id = file_items.id_of(item.syntax()); | 170 | let file_item_id = file_items.id_of(item.syntax()); |
171 | let start_offset = item.syntax().range().start(); | 171 | let start_offset = item.syntax().range().start(); |
172 | Path::expand_use_item(item, |path, range| { | 172 | Path::expand_use_item(item, |path, range| { |
@@ -183,7 +183,7 @@ impl InputModuleItems { | |||
183 | } | 183 | } |
184 | 184 | ||
185 | impl ModuleItem { | 185 | impl ModuleItem { |
186 | fn new<'a>(file_items: &FileItems, item: impl ast::NameOwner<'a>) -> Option<ModuleItem> { | 186 | fn new<'a>(file_items: &SourceFileItems, item: impl ast::NameOwner<'a>) -> Option<ModuleItem> { |
187 | let name = item.name()?.text(); | 187 | let name = item.name()?.text(); |
188 | let kind = item.syntax().kind(); | 188 | let kind = item.syntax().kind(); |
189 | let vis = Vis::Other; | 189 | let vis = Vis::Other; |