Skip to content

Commit

Permalink
Fix comment parsing for union variants
Browse files Browse the repository at this point in the history
  • Loading branch information
razzeee committed Mar 6, 2020
1 parent a5bc8cf commit 8db2ef6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util/hintHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export class HintHelper {
if (declaration.type === "type_declaration") {
code = declaration.text;
}
if (declaration.type === "union_variant") {
declaration = declaration.parent ? declaration.parent : declaration;
}
if (declaration.previousNamedSibling) {
if (declaration.previousNamedSibling.type === "type_annotation") {
annotation = declaration.previousNamedSibling.text;
Expand Down

0 comments on commit 8db2ef6

Please sign in to comment.