aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r--crates/ra_ide_api/src/lib.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs
index dbebf50a6..8741e736f 100644
--- a/crates/ra_ide_api/src/lib.rs
+++ b/crates/ra_ide_api/src/lib.rs
@@ -242,12 +242,21 @@ pub struct CallInfo {
242} 242}
243 243
244/// `AnalysisHost` stores the current state of the world. 244/// `AnalysisHost` stores the current state of the world.
245#[derive(Debug, Default)] 245#[derive(Debug)]
246pub struct AnalysisHost { 246pub struct AnalysisHost {
247 db: db::RootDatabase, 247 db: db::RootDatabase,
248} 248}
249 249
250impl Default for AnalysisHost {
251 fn default() -> AnalysisHost {
252 AnalysisHost::new(None)
253 }
254}
255
250impl AnalysisHost { 256impl AnalysisHost {
257 pub fn new(lru_capcity: Option<usize>) -> AnalysisHost {
258 AnalysisHost { db: db::RootDatabase::new(lru_capcity) }
259 }
251 /// Returns a snapshot of the current state, which you can query for 260 /// Returns a snapshot of the current state, which you can query for
252 /// semantic information. 261 /// semantic information.
253 pub fn analysis(&self) -> Analysis { 262 pub fn analysis(&self) -> Analysis {