Add an expr_source method analogous to the source methods in the code model

... and use that instead of exposing the source map.
This commit is contained in:
Florian Diebold 2019-08-30 20:16:28 +02:00
parent a7858bb7bf
commit f92177cfb5
8 changed files with 107 additions and 60 deletions

View file

@ -27,9 +27,9 @@ use crate::{
name,
path::{PathKind, PathSegment},
ty::method_resolution::implements_trait,
AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HirDatabase, HirFileId,
MacroDef, Module, ModuleDef, Name, Path, PerNs, Resolution, Resolver, Static, Struct, Trait,
Ty,
AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirDatabase,
HirFileId, MacroDef, Module, ModuleDef, Name, Path, PerNs, Resolution, Resolver, Static,
Struct, Trait, Ty,
};
/// Locates the module by `FileId`. Picks topmost module in the file.