From d47075af5275bcf4f22b9c8ab00027f7828d640d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 21 Nov 2018 16:16:54 +0300 Subject: move path to descriptors --- crates/ra_analysis/src/descriptors/mod.rs | 16 +++++++++++++++- crates/ra_analysis/src/descriptors/module/nameres.rs | 15 +-------------- 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'crates') diff --git a/crates/ra_analysis/src/descriptors/mod.rs b/crates/ra_analysis/src/descriptors/mod.rs index 6b56d92e1..82658211f 100644 --- a/crates/ra_analysis/src/descriptors/mod.rs +++ b/crates/ra_analysis/src/descriptors/mod.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use ra_syntax::{ ast::{self, AstNode, FnDefNode}, - TextRange, + TextRange, SmolStr, }; use crate::{ @@ -50,6 +50,20 @@ salsa::query_group! { } } +#[derive(Debug, Clone, PartialEq, Eq)] +pub(crate) struct Path { + kind: PathKind, + segments: Vec, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(crate) enum PathKind { + Abs, + Self_, + Super, + Crate, +} + #[derive(Debug)] pub struct ReferenceDescriptor { pub range: TextRange, diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs index fb315a870..16f1bbd1e 100644 --- a/crates/ra_analysis/src/descriptors/module/nameres.rs +++ b/crates/ra_analysis/src/descriptors/module/nameres.rs @@ -15,6 +15,7 @@ use crate::{ Cancelable, loc2id::{DefId, DefLoc}, descriptors::{ + Path, PathKind, DescriptorDatabase, module::{ModuleId, ModuleTree, ModuleSourceNode}, }, @@ -59,20 +60,6 @@ enum ImportKind { Named(LocalSyntaxPtr), } -#[derive(Debug, Clone, PartialEq, Eq)] -struct Path { - kind: PathKind, - segments: Vec, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -enum PathKind { - Abs, - Self_, - Super, - Crate, -} - pub(crate) fn input_module_items( db: &impl DescriptorDatabase, source_root: SourceRootId, -- cgit v1.2.3