diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-16 06:20:09 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-16 06:20:09 +0000 |
commit | d75a0368f5048243d6561e42e77835f6f574b321 (patch) | |
tree | 17ffe16abbf568232e50696d8dcfbd798eef7009 /crates/ra_syntax/src | |
parent | 68d320a680b5df802b2c3e7dad5d890e3309ed60 (diff) | |
parent | 67ddd3359817f0a1254005e4c2dc921eed5e7ad9 (diff) |
Merge #536
536: Introduce variable semicolon block expr r=matklad a=yerke
Fix for https://github.com/rust-analyzer/rust-analyzer/issues/504
Feels a bit hacky...
Co-authored-by: Yerkebulan Tulibergenov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 211ba31e5..000cfb981 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -296,6 +296,15 @@ impl IfExpr { | |||
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
299 | impl ExprStmt { | ||
300 | pub fn has_semi(&self) -> bool { | ||
301 | match self.syntax().last_child() { | ||
302 | None => false, | ||
303 | Some(node) => node.kind() == SEMI, | ||
304 | } | ||
305 | } | ||
306 | } | ||
307 | |||
299 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 308 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
300 | pub enum PathSegmentKind<'a> { | 309 | pub enum PathSegmentKind<'a> { |
301 | Name(&'a NameRef), | 310 | Name(&'a NameRef), |