diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide_api/src/mock_analysis.rs | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index de3ec4e0a..d77a56ce8 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -62,7 +62,8 @@ pub use ra_ide_api_light::{ | |||
62 | LineIndex, LineCol, translate_offset_with_edit, | 62 | LineIndex, LineCol, translate_offset_with_edit, |
63 | }; | 63 | }; |
64 | pub use ra_db::{ | 64 | pub use ra_db::{ |
65 | Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId | 65 | Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId, |
66 | Edition | ||
66 | }; | 67 | }; |
67 | pub use hir::Documentation; | 68 | pub use hir::Documentation; |
68 | 69 | ||
diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs index 017ac5de3..550d69641 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide_api/src/mock_analysis.rs | |||
@@ -3,7 +3,7 @@ use std::sync::Arc; | |||
3 | use relative_path::RelativePathBuf; | 3 | use relative_path::RelativePathBuf; |
4 | use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; | 4 | use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; |
5 | 5 | ||
6 | use crate::{Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FilePosition, FileRange, SourceRootId}; | 6 | use crate::{Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FilePosition, FileRange, SourceRootId, Edition::Edition2018}; |
7 | 7 | ||
8 | /// Mock analysis is used in test to bootstrap an AnalysisHost/Analysis | 8 | /// Mock analysis is used in test to bootstrap an AnalysisHost/Analysis |
9 | /// from a set of in-memory files. | 9 | /// from a set of in-memory files. |
@@ -89,9 +89,9 @@ impl MockAnalysis { | |||
89 | let path = RelativePathBuf::from_path(&path[1..]).unwrap(); | 89 | let path = RelativePathBuf::from_path(&path[1..]).unwrap(); |
90 | let file_id = FileId(i as u32 + 1); | 90 | let file_id = FileId(i as u32 + 1); |
91 | if path == "/lib.rs" || path == "/main.rs" { | 91 | if path == "/lib.rs" || path == "/main.rs" { |
92 | root_crate = Some(crate_graph.add_crate_root(file_id)); | 92 | root_crate = Some(crate_graph.add_crate_root(file_id, Edition2018)); |
93 | } else if path.ends_with("/lib.rs") { | 93 | } else if path.ends_with("/lib.rs") { |
94 | let other_crate = crate_graph.add_crate_root(file_id); | 94 | let other_crate = crate_graph.add_crate_root(file_id, Edition2018); |
95 | let crate_name = path.parent().unwrap().file_name().unwrap(); | 95 | let crate_name = path.parent().unwrap().file_name().unwrap(); |
96 | if let Some(root_crate) = root_crate { | 96 | if let Some(root_crate) = root_crate { |
97 | crate_graph.add_dep(root_crate, crate_name.into(), other_crate).unwrap(); | 97 | crate_graph.add_dep(root_crate, crate_name.into(), other_crate).unwrap(); |