From 367aa4059d19267b49a529e12dc41c2acb1b72c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gammels=C3=A6ter?= Date: Wed, 4 Dec 2024 21:06:52 +0100 Subject: [PATCH] Merge include/exclude dirs when consolidating crate specs This fixes //test/rust_analyzer:rust_analyzer_test which seems to currently fail on main branch. --- tools/rust_analyzer/aquery.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/rust_analyzer/aquery.rs b/tools/rust_analyzer/aquery.rs index bc98913b05..2c634b04b1 100644 --- a/tools/rust_analyzer/aquery.rs +++ b/tools/rust_analyzer/aquery.rs @@ -181,6 +181,15 @@ fn consolidate_crate_specs(crate_specs: Vec) -> anyhow::Result existing.source = new, + (Some(existing_source), Some(new_source)) => { + existing_source.exclude_dirs.extend(new_source.exclude_dirs); + existing_source.include_dirs.extend(new_source.include_dirs); + } + _ => (), + } + // display_name should match the library's crate name because Rust Analyzer // seems to use display_name for matching crate entries in rust-project.json // against symbols in source files. For more details, see