aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module/nameres.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module/nameres.rs')
-rw-r--r--crates/ra_analysis/src/descriptors/module/nameres.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs
index 648ec5e43..6251f5b86 100644
--- a/crates/ra_analysis/src/descriptors/module/nameres.rs
+++ b/crates/ra_analysis/src/descriptors/module/nameres.rs
@@ -22,12 +22,13 @@ use std::{
22use rustc_hash::FxHashMap; 22use rustc_hash::FxHashMap;
23 23
24use ra_syntax::{ 24use ra_syntax::{
25 SyntaxNode,
25 SmolStr, SyntaxKind::{self, *}, 26 SmolStr, SyntaxKind::{self, *},
26 ast::{self, ModuleItemOwner} 27 ast::{self, ModuleItemOwner}
27}; 28};
28 29
29use crate::{ 30use crate::{
30 Cancelable, 31 Cancelable, FileId,
31 loc2id::{DefId, DefLoc}, 32 loc2id::{DefId, DefLoc},
32 descriptors::{ 33 descriptors::{
33 Path, PathKind, 34 Path, PathKind,
@@ -38,6 +39,20 @@ use crate::{
38 input::SourceRootId, 39 input::SourceRootId,
39}; 40};
40 41
42
43#[derive(Clone, Copy, Hash, PartialEq, Eq, Debug)]
44pub(crate) struct FileItemId(u32);
45
46pub(crate) fn file_items(db: &impl DescriptorDatabase, file_id: FileId) -> Arc<Vec<SyntaxNode>> {
47 unimplemented!()
48}
49
50pub(crate) fn file_item(db: &impl DescriptorDatabase, file_id: FileId, file_item_id: FileItemId) -> SyntaxNode {
51 let items = db._file_items(file_id);
52 let idx = file_item_id.0 as usize;
53 items[idx].clone()
54}
55
41/// Item map is the result of the name resolution. Item map contains, for each 56/// Item map is the result of the name resolution. Item map contains, for each
42/// module, the set of visible items. 57/// module, the set of visible items.
43#[derive(Default, Debug, PartialEq, Eq)] 58#[derive(Default, Debug, PartialEq, Eq)]