diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/extensions.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index 5c4c0ffc1..9cbd2c6b8 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs | |||
@@ -210,6 +210,15 @@ impl ast::EnumVariant { | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | impl ast::FnDef { | ||
214 | pub fn semicolon_token(&self) -> Option<SyntaxToken<'_>> { | ||
215 | self.syntax() | ||
216 | .last_child_or_token() | ||
217 | .and_then(|it| it.as_token()) | ||
218 | .filter(|it| it.kind() == SEMI) | ||
219 | } | ||
220 | } | ||
221 | |||
213 | impl ast::LetStmt { | 222 | impl ast::LetStmt { |
214 | pub fn has_semi(&self) -> bool { | 223 | pub fn has_semi(&self) -> bool { |
215 | match self.syntax().last_child_or_token() { | 224 | match self.syntax().last_child_or_token() { |