Skip to content

Commit

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

Reviewed By: alanz

Differential Revision: D55201991

fbshipit-source-id: e3e48153a330852c3b29a919e9e97e02f8a2800a
  • Loading branch information
perehonchuk authored and facebook-github-bot committed Apr 5, 2024
1 parent a7dcc43 commit 0d177c3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion crates/elp/src/bin/glean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,8 @@ impl GleanIndexer {
};
Self::resolve_call_v2(&sema, target, arity?, file_id, &body, range)
}
hir::AnyExpr::Expr(Expr::Record { name, .. }) => {
hir::AnyExpr::Expr(Expr::Record { name, .. })
| hir::AnyExpr::Expr(Expr::RecordIndex { name, .. }) => {
Self::resolve_record_v2(&sema, *name, file_id, ctx)
}
hir::AnyExpr::Expr(Expr::MacroCall { macro_def, .. })
Expand Down Expand Up @@ -1510,6 +1511,22 @@ mod tests {
xref_check(&spec);
}

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

xref_v2_check(&spec);
}

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

0 comments on commit 0d177c3

Please sign in to comment.