mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
internal: expose cfg attrs from hir::Crate
This commit is contained in:
parent
ba86203987
commit
53f7149d45
4 changed files with 8 additions and 1 deletions
|
@ -89,6 +89,7 @@ pub use crate::{
|
|||
// Generally, a refactoring which *removes* a name from this list is a good
|
||||
// idea!
|
||||
pub use {
|
||||
cfg::{CfgAtom, CfgExpr, CfgOptions},
|
||||
hir_def::{
|
||||
adt::StructKind,
|
||||
attr::{Attr, Attrs, AttrsWithOwner, Documentation},
|
||||
|
@ -215,6 +216,10 @@ impl Crate {
|
|||
|
||||
doc_url.map(|s| s.trim_matches('"').trim_end_matches('/').to_owned() + "/")
|
||||
}
|
||||
|
||||
pub fn cfg(&self, db: &dyn HirDatabase) -> CfgOptions {
|
||||
db.crate_graph()[self.id].cfg_options.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue