]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
show field types in completion
[rust.git] / crates / ra_hir / src / lib.rs
1 //! HIR (previously known as descriptors) provides a high-level object oriented
2 //! access to Rust code.
3 //!
4 //! The principal difference between HIR and syntax trees is that HIR is bound
5 //! to a particular crate instance. That is, it has cfg flags and features
6 //! applied. So, the relation between syntax and HIR is many-to-one.
7
8 macro_rules! ctry {
9     ($expr:expr) => {
10         match $expr {
11             None => return Ok(None),
12             Some(it) => it,
13         }
14     };
15 }
16
17 pub mod db;
18 #[cfg(test)]
19 mod mock;
20 mod query_definitions;
21 mod path;
22 pub mod source_binder;
23
24 mod ids;
25 mod macros;
26 mod name;
27 mod module_tree;
28 mod nameres;
29 mod adt;
30 mod type_ref;
31 mod ty;
32 mod impl_block;
33 mod expr;
34
35 mod code_model_api;
36 mod code_model_impl;
37
38 use crate::{
39     db::HirDatabase,
40     name::{AsName, KnownName},
41     ids::{DefKind, SourceItemId, SourceFileItemId, SourceFileItems},
42 };
43
44 pub use self::{
45     path::{Path, PathKind},
46     name::Name,
47     ids::{HirFileId, DefId, DefLoc, MacroCallId, MacroCallLoc},
48     macros::{MacroDef, MacroInput, MacroExpansion},
49     nameres::{ItemMap, PerNs, Namespace, Resolution},
50     ty::Ty,
51     impl_block::{ImplBlock, ImplItem},
52     code_model_impl::function::{FnScopes, ScopesWithSyntaxMapping},
53 };
54
55 pub use self::code_model_api::{
56     Crate, CrateDependency,
57     Def,
58     Module, ModuleSource, Problem,
59     Struct, Enum,
60     Function, FnSignature,
61 };