Skip to content

Commit

Permalink
xref record in types
Browse files Browse the repository at this point in the history
Summary: as per title

Reviewed By: alanz

Differential Revision: D55204026

fbshipit-source-id: 84c324f7a25913546c53bac6e525f25a3f3cf4dd
  • Loading branch information
perehonchuk authored and facebook-github-bot committed Apr 5, 2024
1 parent 92bdff9 commit 45edaff
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/elp/src/bin/glean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ impl GleanIndexer {
}
hir::AnyExpr::Pat(Pat::Record { name, .. })
| hir::AnyExpr::Pat(Pat::RecordIndex { name, .. })
| hir::AnyExpr::TypeExpr(TypeExpr::Record { name, .. })
| hir::AnyExpr::Expr(Expr::Record { name, .. })
| hir::AnyExpr::Expr(Expr::RecordIndex { name, .. })
| hir::AnyExpr::Expr(Expr::RecordUpdate { name, .. })
Expand Down Expand Up @@ -1647,6 +1648,21 @@ mod tests {
xref_check(&spec);
}

#[test]
fn xref_record_in_type_v2_test() {
let spec = r#"
//- /glean/app_glean/src/glean_module15.erl
-record(stats, {count, time}).
-spec baz() -> #stats{}.
%% ^^^^^^ glean_module15.erl/rec/stats
baz() ->
#stats{count = 1, time = 2}.
%% ^^^^^^ glean_module15.erl/rec/stats
"#;

xref_v2_check(&spec);
}

#[test]
fn xref_macro_v2_test() {
let spec = r#"
Expand Down

0 comments on commit 45edaff

Please sign in to comment.