diff options
author | unexge <[email protected]> | 2020-06-06 20:16:59 +0100 |
---|---|---|
committer | unexge <[email protected]> | 2020-06-06 20:16:59 +0100 |
commit | 73684a4ae2ff5251bbff35109d2c9ad40fe4ef01 (patch) | |
tree | bbb971cae2c8309fd9147192e20d054af12e172a /crates/ra_ide_db/src | |
parent | d4a92b4fefecbd63d8c7c82a5553cd209c068144 (diff) |
Add goto def for enum variant field
Diffstat (limited to 'crates/ra_ide_db/src')
-rw-r--r-- | crates/ra_ide_db/src/defs.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 1db60b87f..52233937c 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs | |||
@@ -126,6 +126,12 @@ fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Opti | |||
126 | Some(name_ref_class.definition()) | 126 | Some(name_ref_class.definition()) |
127 | }, | 127 | }, |
128 | ast::BindPat(it) => { | 128 | ast::BindPat(it) => { |
129 | if let Some(record_field_pat) = it.syntax().parent().and_then(ast::RecordFieldPat::cast) { | ||
130 | return Some(Definition::Field( | ||
131 | sema.resolve_record_field_pat(&record_field_pat)? | ||
132 | )); | ||
133 | } | ||
134 | |||
129 | let local = sema.to_def(&it)?; | 135 | let local = sema.to_def(&it)?; |
130 | Some(Definition::Local(local)) | 136 | Some(Definition::Local(local)) |
131 | }, | 137 | }, |