diff options
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 24f1b91f6..19669a7f0 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -19,7 +19,6 @@ mod feature_flags; | |||
19 | mod status; | 19 | mod status; |
20 | mod completion; | 20 | mod completion; |
21 | mod runnables; | 21 | mod runnables; |
22 | mod name_ref_kind; | ||
23 | mod goto_definition; | 22 | mod goto_definition; |
24 | mod goto_type_definition; | 23 | mod goto_type_definition; |
25 | mod extend_selection; | 24 | mod extend_selection; |
@@ -52,7 +51,7 @@ use std::sync::Arc; | |||
52 | use ra_cfg::CfgOptions; | 51 | use ra_cfg::CfgOptions; |
53 | use ra_db::{ | 52 | use ra_db::{ |
54 | salsa::{self, ParallelDatabase}, | 53 | salsa::{self, ParallelDatabase}, |
55 | CheckCanceled, SourceDatabase, | 54 | CheckCanceled, FileLoader, SourceDatabase, |
56 | }; | 55 | }; |
57 | use ra_syntax::{SourceFile, TextRange, TextUnit}; | 56 | use ra_syntax::{SourceFile, TextRange, TextUnit}; |
58 | use ra_text_edit::TextEdit; | 57 | use ra_text_edit::TextEdit; |
@@ -289,10 +288,14 @@ impl AnalysisHost { | |||
289 | pub fn per_query_memory_usage(&mut self) -> Vec<(String, ra_prof::Bytes)> { | 288 | pub fn per_query_memory_usage(&mut self) -> Vec<(String, ra_prof::Bytes)> { |
290 | self.db.per_query_memory_usage() | 289 | self.db.per_query_memory_usage() |
291 | } | 290 | } |
292 | pub fn raw_database(&self) -> &(impl hir::db::HirDatabase + salsa::Database) { | 291 | pub fn raw_database( |
292 | &self, | ||
293 | ) -> &(impl hir::db::HirDatabase + salsa::Database + ra_db::SourceDatabaseExt) { | ||
293 | &self.db | 294 | &self.db |
294 | } | 295 | } |
295 | pub fn raw_database_mut(&mut self) -> &mut (impl hir::db::HirDatabase + salsa::Database) { | 296 | pub fn raw_database_mut( |
297 | &mut self, | ||
298 | ) -> &mut (impl hir::db::HirDatabase + salsa::Database + ra_db::SourceDatabaseExt) { | ||
296 | &mut self.db | 299 | &mut self.db |
297 | } | 300 | } |
298 | } | 301 | } |
@@ -325,7 +328,8 @@ impl Analysis { | |||
325 | let file_id = FileId(0); | 328 | let file_id = FileId(0); |
326 | // FIXME: cfg options | 329 | // FIXME: cfg options |
327 | // Default to enable test for single file. | 330 | // Default to enable test for single file. |
328 | let cfg_options = CfgOptions::default().atom("test".into()); | 331 | let mut cfg_options = CfgOptions::default(); |
332 | cfg_options.insert_atom("test".into()); | ||
329 | crate_graph.add_crate_root(file_id, Edition::Edition2018, cfg_options); | 333 | crate_graph.add_crate_root(file_id, Edition::Edition2018, cfg_options); |
330 | change.add_file(source_root, file_id, "main.rs".into(), Arc::new(text)); | 334 | change.add_file(source_root, file_id, "main.rs".into(), Arc::new(text)); |
331 | change.set_crate_graph(crate_graph); | 335 | change.set_crate_graph(crate_graph); |