diff options
author | Aleksey Kladov <[email protected]> | 2020-02-06 11:52:32 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-06 13:03:45 +0000 |
commit | 88267c86c0c49de395973574d2516ab904091cfb (patch) | |
tree | 3c137f0c6a34c0ae787c7d8d59ccf2398fab1bfa /crates/ra_ide/src/lib.rs | |
parent | 939f05f3e33e9f00d5205d60af3a862ae4d58bd6 (diff) |
cleanup imports
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r-- | crates/ra_ide/src/lib.rs | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 1527b27d4..013b960c1 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -10,11 +10,6 @@ | |||
10 | // For proving that RootDatabase is RefUnwindSafe. | 10 | // For proving that RootDatabase is RefUnwindSafe. |
11 | #![recursion_limit = "128"] | 11 | #![recursion_limit = "128"] |
12 | 12 | ||
13 | mod ide_db { | ||
14 | pub use ra_ide_db::*; | ||
15 | } | ||
16 | |||
17 | mod db; | ||
18 | pub mod mock_analysis; | 13 | pub mod mock_analysis; |
19 | mod source_change; | 14 | mod source_change; |
20 | 15 | ||
@@ -56,13 +51,13 @@ use ra_db::{ | |||
56 | salsa::{self, ParallelDatabase}, | 51 | salsa::{self, ParallelDatabase}, |
57 | CheckCanceled, Env, FileLoader, SourceDatabase, | 52 | CheckCanceled, Env, FileLoader, SourceDatabase, |
58 | }; | 53 | }; |
54 | use ra_ide_db::{ | ||
55 | symbol_index::{self, FileSymbol}, | ||
56 | LineIndexDatabase, | ||
57 | }; | ||
59 | use ra_syntax::{SourceFile, TextRange, TextUnit}; | 58 | use ra_syntax::{SourceFile, TextRange, TextUnit}; |
60 | 59 | ||
61 | use crate::{ | 60 | use crate::display::ToNav; |
62 | db::LineIndexDatabase, | ||
63 | display::ToNav, | ||
64 | ide_db::symbol_index::{self, FileSymbol}, | ||
65 | }; | ||
66 | 61 | ||
67 | pub use crate::{ | 62 | pub use crate::{ |
68 | assists::{Assist, AssistId}, | 63 | assists::{Assist, AssistId}, |
@@ -73,13 +68,6 @@ pub use crate::{ | |||
73 | expand_macro::ExpandedMacro, | 68 | expand_macro::ExpandedMacro, |
74 | folding_ranges::{Fold, FoldKind}, | 69 | folding_ranges::{Fold, FoldKind}, |
75 | hover::HoverResult, | 70 | hover::HoverResult, |
76 | ide_db::{ | ||
77 | change::{AnalysisChange, LibraryData}, | ||
78 | feature_flags::FeatureFlags, | ||
79 | line_index::{LineCol, LineIndex}, | ||
80 | line_index_utils::translate_offset_with_edit, | ||
81 | symbol_index::Query, | ||
82 | }, | ||
83 | inlay_hints::{InlayHint, InlayKind}, | 71 | inlay_hints::{InlayHint, InlayKind}, |
84 | references::{ | 72 | references::{ |
85 | Declaration, Reference, ReferenceAccess, ReferenceKind, ReferenceSearchResult, SearchScope, | 73 | Declaration, Reference, ReferenceAccess, ReferenceKind, ReferenceSearchResult, SearchScope, |
@@ -93,6 +81,14 @@ pub use hir::Documentation; | |||
93 | pub use ra_db::{ | 81 | pub use ra_db::{ |
94 | Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRootId, | 82 | Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRootId, |
95 | }; | 83 | }; |
84 | pub use ra_ide_db::{ | ||
85 | change::{AnalysisChange, LibraryData}, | ||
86 | feature_flags::FeatureFlags, | ||
87 | line_index::{LineCol, LineIndex}, | ||
88 | line_index_utils::translate_offset_with_edit, | ||
89 | symbol_index::Query, | ||
90 | RootDatabase, | ||
91 | }; | ||
96 | 92 | ||
97 | pub type Cancelable<T> = Result<T, Canceled>; | 93 | pub type Cancelable<T> = Result<T, Canceled>; |
98 | 94 | ||
@@ -128,7 +124,7 @@ pub struct CallInfo { | |||
128 | /// `AnalysisHost` stores the current state of the world. | 124 | /// `AnalysisHost` stores the current state of the world. |
129 | #[derive(Debug)] | 125 | #[derive(Debug)] |
130 | pub struct AnalysisHost { | 126 | pub struct AnalysisHost { |
131 | db: db::RootDatabase, | 127 | db: RootDatabase, |
132 | } | 128 | } |
133 | 129 | ||
134 | impl Default for AnalysisHost { | 130 | impl Default for AnalysisHost { |
@@ -139,7 +135,7 @@ impl Default for AnalysisHost { | |||
139 | 135 | ||
140 | impl AnalysisHost { | 136 | impl AnalysisHost { |
141 | pub fn new(lru_capcity: Option<usize>, feature_flags: FeatureFlags) -> AnalysisHost { | 137 | pub fn new(lru_capcity: Option<usize>, feature_flags: FeatureFlags) -> AnalysisHost { |
142 | AnalysisHost { db: db::RootDatabase::new(lru_capcity, feature_flags) } | 138 | AnalysisHost { db: RootDatabase::new(lru_capcity, feature_flags) } |
143 | } | 139 | } |
144 | /// Returns a snapshot of the current state, which you can query for | 140 | /// Returns a snapshot of the current state, which you can query for |
145 | /// semantic information. | 141 | /// semantic information. |
@@ -189,7 +185,7 @@ impl AnalysisHost { | |||
189 | /// `Analysis` are canceled (most method return `Err(Canceled)`). | 185 | /// `Analysis` are canceled (most method return `Err(Canceled)`). |
190 | #[derive(Debug)] | 186 | #[derive(Debug)] |
191 | pub struct Analysis { | 187 | pub struct Analysis { |
192 | db: salsa::Snapshot<db::RootDatabase>, | 188 | db: salsa::Snapshot<RootDatabase>, |
193 | } | 189 | } |
194 | 190 | ||
195 | // As a general design guideline, `Analysis` API are intended to be independent | 191 | // As a general design guideline, `Analysis` API are intended to be independent |
@@ -470,7 +466,7 @@ impl Analysis { | |||
470 | } | 466 | } |
471 | 467 | ||
472 | /// Performs an operation on that may be Canceled. | 468 | /// Performs an operation on that may be Canceled. |
473 | fn with_db<F: FnOnce(&db::RootDatabase) -> T + std::panic::UnwindSafe, T>( | 469 | fn with_db<F: FnOnce(&RootDatabase) -> T + std::panic::UnwindSafe, T>( |
474 | &self, | 470 | &self, |
475 | f: F, | 471 | f: F, |
476 | ) -> Cancelable<T> { | 472 | ) -> Cancelable<T> { |