diff options
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/parser_impl/event.rs | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 9fe946172..ac6c8a835 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -632,6 +632,7 @@ impl AstNode for EnumVariant { | |||
632 | 632 | ||
633 | 633 | ||
634 | impl ast::NameOwner for EnumVariant {} | 634 | impl ast::NameOwner for EnumVariant {} |
635 | impl ast::DocCommentsOwner for EnumVariant {} | ||
635 | impl EnumVariant { | 636 | impl EnumVariant { |
636 | pub fn expr(&self) -> Option<&Expr> { | 637 | pub fn expr(&self) -> Option<&Expr> { |
637 | super::child_opt(self) | 638 | super::child_opt(self) |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 0385183fd..c5297e46d 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -279,7 +279,7 @@ Grammar( | |||
279 | "DocCommentsOwner" | 279 | "DocCommentsOwner" |
280 | ], options: [["variant_list", "EnumVariantList"]] ), | 280 | ], options: [["variant_list", "EnumVariantList"]] ), |
281 | "EnumVariantList": ( collections: [["variants", "EnumVariant"]] ), | 281 | "EnumVariantList": ( collections: [["variants", "EnumVariant"]] ), |
282 | "EnumVariant": ( traits: ["NameOwner"], options: ["Expr"] ), | 282 | "EnumVariant": ( traits: ["NameOwner", "DocCommentsOwner"], options: ["Expr"] ), |
283 | "TraitDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner"] ), | 283 | "TraitDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner"] ), |
284 | "Module": ( | 284 | "Module": ( |
285 | traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ], | 285 | traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ], |
diff --git a/crates/ra_syntax/src/parser_impl/event.rs b/crates/ra_syntax/src/parser_impl/event.rs index 73dd6e02b..bd77fee89 100644 --- a/crates/ra_syntax/src/parser_impl/event.rs +++ b/crates/ra_syntax/src/parser_impl/event.rs | |||
@@ -249,7 +249,8 @@ fn n_attached_trivias<'a>( | |||
249 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, | 249 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, |
250 | ) -> usize { | 250 | ) -> usize { |
251 | match kind { | 251 | match kind { |
252 | CONST_DEF | TYPE_DEF | STRUCT_DEF | ENUM_DEF | FN_DEF | TRAIT_DEF | MODULE => { | 252 | CONST_DEF | TYPE_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF | TRAIT_DEF |
253 | | MODULE => { | ||
253 | let mut res = 0; | 254 | let mut res = 0; |
254 | for (i, (kind, text)) in trivias.enumerate() { | 255 | for (i, (kind, text)) in trivias.enumerate() { |
255 | match kind { | 256 | match kind { |