diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-15 18:40:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-15 18:40:47 +0000 |
commit | 8a869e870ac6328967fb120a0ebe44a9c900eaf0 (patch) | |
tree | f4ad40fc09483af3e9fea77d4b4156130539a70c /crates/syntax/src/ast/generated | |
parent | 148e3d0f6a28f57565538dca7d9c0f5f726a5908 (diff) | |
parent | cb863390f23bc2eac6561d55def9bd3ba54605fc (diff) |
Merge #7288
7288: Handle self/super/crate in PathSegment as NameRef r=matklad a=Veykril
Wrapping self/super/crate in NameRef as per https://github.com/rust-analyzer/rust-analyzer/pull/7261#issuecomment-760023172
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/syntax/src/ast/generated')
-rw-r--r-- | crates/syntax/src/ast/generated/nodes.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index 9c96d3d07..1d722db3c 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs | |||
@@ -18,6 +18,9 @@ pub struct NameRef { | |||
18 | } | 18 | } |
19 | impl NameRef { | 19 | impl NameRef { |
20 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } | 20 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } |
21 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
22 | pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) } | ||
23 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } | ||
21 | } | 24 | } |
22 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 25 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
23 | pub struct Lifetime { | 26 | pub struct Lifetime { |
@@ -42,9 +45,6 @@ pub struct PathSegment { | |||
42 | pub(crate) syntax: SyntaxNode, | 45 | pub(crate) syntax: SyntaxNode, |
43 | } | 46 | } |
44 | impl PathSegment { | 47 | impl PathSegment { |
45 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } | ||
46 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
47 | pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) } | ||
48 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } | 48 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
49 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 49 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
50 | pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) } | 50 | pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) } |