From 11168c464cd962af3336a2cc68295496066edd6c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 28 Nov 2018 03:25:20 +0300 Subject: move db basics to ra_db This should allow to move hir to a separate crate --- crates/ra_analysis/src/lib.rs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'crates/ra_analysis/src/lib.rs') diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index c0e43544e..012d36b8e 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -19,8 +19,6 @@ macro_rules! ctry { } mod arena; -mod syntax_ptr; -mod input; mod db; mod loc2id; mod imp; @@ -32,35 +30,27 @@ pub mod mock_analysis; use std::{fmt, sync::Arc}; use ra_syntax::{AtomEdit, SourceFileNode, TextRange, TextUnit}; +use ra_db::FileResolverImp; use rayon::prelude::*; use relative_path::RelativePathBuf; use crate::{ - imp::{AnalysisHostImpl, AnalysisImpl, FileResolverImp}, + imp::{AnalysisHostImpl, AnalysisImpl}, symbol_index::SymbolIndex, }; pub use crate::{ completion::CompletionItem, hir::FnSignatureInfo, - input::{CrateGraph, CrateId, FileId, FileResolver}, }; pub use ra_editor::{ FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode, }; -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub struct Canceled; - -pub type Cancelable = Result; - -impl std::fmt::Display for Canceled { - fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - fmt.write_str("Canceled") - } -} - -impl std::error::Error for Canceled {} +pub use ra_db::{ + Canceled, Cancelable, + CrateGraph, CrateId, FileId, FileResolver +}; #[derive(Default)] pub struct AnalysisChange { -- cgit v1.2.3