From 468b80485644bf1b15dee97d15029378f0f6d199 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 9 Oct 2020 02:57:35 +0200 Subject: Fix source_to_def for named enum variant fields --- crates/ide/src/references.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ide/src') diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index e0830eb4f..ae68b4392 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -405,6 +405,23 @@ enum Foo { ); } + #[test] + fn test_find_all_refs_enum_var_field() { + check( + r#" +enum Foo { + A, + B { field<|>: u8 }, + C, +} +"#, + expect![[r#" + field RECORD_FIELD FileId(0) 26..35 26..31 Other + + "#]], + ); + } + #[test] fn test_find_all_refs_two_modules() { check( -- cgit v1.2.3