diff options
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 14 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/traits.rs | 6 |
2 files changed, 7 insertions, 13 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index c20ff53bf..207826979 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -35,12 +35,12 @@ pub struct Const { | |||
35 | impl ast::AttrsOwner for Const {} | 35 | impl ast::AttrsOwner for Const {} |
36 | impl ast::NameOwner for Const {} | 36 | impl ast::NameOwner for Const {} |
37 | impl ast::VisibilityOwner for Const {} | 37 | impl ast::VisibilityOwner for Const {} |
38 | impl ast::TypeAscriptionOwner for Const {} | ||
39 | impl Const { | 38 | impl Const { |
40 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 39 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
41 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 40 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
42 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } | 41 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } |
43 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 42 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
43 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
44 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 44 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
45 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 45 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
46 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 46 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
@@ -148,11 +148,11 @@ pub struct Static { | |||
148 | impl ast::AttrsOwner for Static {} | 148 | impl ast::AttrsOwner for Static {} |
149 | impl ast::NameOwner for Static {} | 149 | impl ast::NameOwner for Static {} |
150 | impl ast::VisibilityOwner for Static {} | 150 | impl ast::VisibilityOwner for Static {} |
151 | impl ast::TypeAscriptionOwner for Static {} | ||
152 | impl Static { | 151 | impl Static { |
153 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } | 152 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
154 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | 153 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
155 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 154 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
155 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
156 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 156 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
157 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 157 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
158 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 158 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
@@ -361,7 +361,6 @@ pub struct SelfParam { | |||
361 | pub(crate) syntax: SyntaxNode, | 361 | pub(crate) syntax: SyntaxNode, |
362 | } | 362 | } |
363 | impl ast::AttrsOwner for SelfParam {} | 363 | impl ast::AttrsOwner for SelfParam {} |
364 | impl ast::TypeAscriptionOwner for SelfParam {} | ||
365 | impl SelfParam { | 364 | impl SelfParam { |
366 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } | 365 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
367 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | 366 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
@@ -370,16 +369,17 @@ impl SelfParam { | |||
370 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | 369 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
371 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | 370 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } |
372 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 371 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
372 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
373 | } | 373 | } |
374 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 374 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
375 | pub struct Param { | 375 | pub struct Param { |
376 | pub(crate) syntax: SyntaxNode, | 376 | pub(crate) syntax: SyntaxNode, |
377 | } | 377 | } |
378 | impl ast::AttrsOwner for Param {} | 378 | impl ast::AttrsOwner for Param {} |
379 | impl ast::TypeAscriptionOwner for Param {} | ||
380 | impl Param { | 379 | impl Param { |
381 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 380 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
382 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 381 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
382 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
383 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } | 383 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } |
384 | } | 384 | } |
385 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 385 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
@@ -414,9 +414,9 @@ pub struct RecordField { | |||
414 | impl ast::AttrsOwner for RecordField {} | 414 | impl ast::AttrsOwner for RecordField {} |
415 | impl ast::NameOwner for RecordField {} | 415 | impl ast::NameOwner for RecordField {} |
416 | impl ast::VisibilityOwner for RecordField {} | 416 | impl ast::VisibilityOwner for RecordField {} |
417 | impl ast::TypeAscriptionOwner for RecordField {} | ||
418 | impl RecordField { | 417 | impl RecordField { |
419 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 418 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
419 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
420 | } | 420 | } |
421 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 421 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
422 | pub struct TupleField { | 422 | pub struct TupleField { |
@@ -495,10 +495,10 @@ pub struct ConstParam { | |||
495 | } | 495 | } |
496 | impl ast::AttrsOwner for ConstParam {} | 496 | impl ast::AttrsOwner for ConstParam {} |
497 | impl ast::NameOwner for ConstParam {} | 497 | impl ast::NameOwner for ConstParam {} |
498 | impl ast::TypeAscriptionOwner for ConstParam {} | ||
499 | impl ConstParam { | 498 | impl ConstParam { |
500 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 499 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
501 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 500 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
501 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
502 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 502 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
503 | pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) } | 503 | pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) } |
504 | } | 504 | } |
@@ -1203,11 +1203,11 @@ pub struct LetStmt { | |||
1203 | pub(crate) syntax: SyntaxNode, | 1203 | pub(crate) syntax: SyntaxNode, |
1204 | } | 1204 | } |
1205 | impl ast::AttrsOwner for LetStmt {} | 1205 | impl ast::AttrsOwner for LetStmt {} |
1206 | impl ast::TypeAscriptionOwner for LetStmt {} | ||
1207 | impl LetStmt { | 1206 | impl LetStmt { |
1208 | pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } | 1207 | pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } |
1209 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1208 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1210 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 1209 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
1210 | pub fn ty(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
1211 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 1211 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1212 | pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } | 1212 | pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } |
1213 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 1213 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 113bd5d82..3a56b1674 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -9,12 +9,6 @@ use crate::{ | |||
9 | SyntaxToken, T, | 9 | SyntaxToken, T, |
10 | }; | 10 | }; |
11 | 11 | ||
12 | pub trait TypeAscriptionOwner: AstNode { | ||
13 | fn ascribed_type(&self) -> Option<ast::TypeRef> { | ||
14 | support::child(self.syntax()) | ||
15 | } | ||
16 | } | ||
17 | |||
18 | pub trait NameOwner: AstNode { | 12 | pub trait NameOwner: AstNode { |
19 | fn name(&self) -> Option<ast::Name> { | 13 | fn name(&self) -> Option<ast::Name> { |
20 | support::child(self.syntax()) | 14 | support::child(self.syntax()) |