mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Make relevant_crates return a Set
This commit is contained in:
parent
f632727b2a
commit
d8a5d39c2d
11 changed files with 36 additions and 24 deletions
|
@ -5,7 +5,7 @@ use crate::{
|
|||
name, AstId, CrateId, MacroDefId, MacroDefKind, TextSize,
|
||||
};
|
||||
|
||||
use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId};
|
||||
use crate::{guess_crate, quote, EagerMacroId, LazyMacroId, MacroCallId};
|
||||
use either::Either;
|
||||
use mbe::parse_to_token_tree;
|
||||
use ra_db::FileId;
|
||||
|
@ -335,8 +335,7 @@ fn include_expand(
|
|||
fn get_env_inner(db: &dyn AstDatabase, arg_id: EagerMacroId, key: &str) -> Option<String> {
|
||||
let call_id: MacroCallId = arg_id.into();
|
||||
let original_file = call_id.as_file().original_file(db);
|
||||
|
||||
let krate = *db.relevant_crates(original_file).get(0)?;
|
||||
let krate = guess_crate(db, original_file)?;
|
||||
db.crate_graph()[krate].env.get(key)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue