Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions crates/load-cargo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,16 +744,25 @@ mod tests {

#[test]
fn test_loading_rust_analyzer() {
let path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap();
let cargo_toml_path = Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.join("Cargo.toml");
let cargo_toml_path = AbsPathBuf::assert_utf8(cargo_toml_path);
let manifest = ProjectManifest::from_manifest_file(cargo_toml_path).unwrap();

let cargo_config = CargoConfig { set_test: true, ..CargoConfig::default() };
let load_cargo_config = LoadCargoConfig {
load_out_dirs_from_check: false,
with_proc_macro_server: ProcMacroServerChoice::None,
prefill_caches: false,
proc_macro_processes: 1,
};
let workspace = ProjectWorkspace::load(manifest, &cargo_config, &|_| {}).unwrap();
let (db, _vfs, _proc_macro) =
load_workspace_at(path, &cargo_config, &load_cargo_config, &|_| {}).unwrap();
load_workspace(workspace, &cargo_config.extra_env, &load_cargo_config).unwrap();

let n_crates = db.all_crates().len();
// RA has quite a few crates, but the exact count doesn't matter
Expand Down