mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
introduce Source struct
This commit is contained in:
parent
e505fe9d7b
commit
91c120ccea
6 changed files with 36 additions and 26 deletions
|
@ -59,8 +59,8 @@ impl StructData {
|
|||
db: &(impl DefDatabase + AstDatabase),
|
||||
struct_: Struct,
|
||||
) -> Arc<StructData> {
|
||||
let (_, struct_def) = struct_.source(db);
|
||||
Arc::new(StructData::new(&*struct_def))
|
||||
let src = struct_.source(db);
|
||||
Arc::new(StructData::new(&*src.ast))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,9 +211,8 @@ impl StructField {
|
|||
let es;
|
||||
let (file_id, struct_kind) = match self.parent {
|
||||
VariantDef::Struct(s) => {
|
||||
let (file_id, source) = s.source(db);
|
||||
ss = source;
|
||||
(file_id, ss.kind())
|
||||
ss = s.source(db);
|
||||
(ss.file_id, ss.ast.kind())
|
||||
}
|
||||
VariantDef::EnumVariant(e) => {
|
||||
let (file_id, source) = e.source(db);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue