diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 09:08:10 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 09:08:10 +0100 |
commit | e6fbff3246cdd3278ff1c376d5abfc1d579f86c2 (patch) | |
tree | 736052286d9c0d8d06798165590bdf145a12d783 /crates/ra_ide_api | |
parent | ce9ea0939a1ae94a83d56ddafc7aeb757dcda776 (diff) | |
parent | b0be4207d04b65580e7af10cb256ddd5d9ca006d (diff) |
Merge #1406
1406: reuse AnalysisHost in batch analysis r=matklad a=matklad
We do some custom setup in `AnalysisHost`, like setting up LRU size. I figure it's a good idea to not duplicate this work in batch analysis, *if* we want to keep batch and non-batch close.
Long-term, I see a value in keeping batch a separate, lighter weight thing. However, because now we use batch to measure performance, keeping them closer makes more sense.
I'd also like to add ability to get completions by using batch analysis, and that will require ra_ide_api as well.
@flodiebold were there some reason why we haven't started with this approach from the start?
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 8741e736f..a68c5e2a5 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -276,6 +276,9 @@ impl AnalysisHost { | |||
276 | pub fn collect_garbage(&mut self) { | 276 | pub fn collect_garbage(&mut self) { |
277 | self.db.collect_garbage(); | 277 | self.db.collect_garbage(); |
278 | } | 278 | } |
279 | pub fn raw_database(&self) -> &impl hir::db::HirDatabase { | ||
280 | &self.db | ||
281 | } | ||
279 | } | 282 | } |
280 | 283 | ||
281 | /// Analysis is a snapshot of a world state at a moment in time. It is the main | 284 | /// Analysis is a snapshot of a world state at a moment in time. It is the main |