mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Fix leading colon
This commit is contained in:
parent
ddf08daddf
commit
c1c97b2896
2 changed files with 3 additions and 2 deletions
|
@ -19,10 +19,10 @@ pub struct PathSegment {
|
|||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl PathSegment {
|
||||
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
|
||||
pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
|
||||
pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
|
||||
pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
|
||||
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
|
||||
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
|
||||
pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
|
||||
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
|
||||
|
|
|
@ -2,7 +2,8 @@ Path =
|
|||
(qualifier:Path '::')? segment:PathSegment
|
||||
|
||||
PathSegment =
|
||||
'::' | 'crate' | 'self' | 'super'
|
||||
'crate' | 'self' | 'super'
|
||||
| '::' NameRef
|
||||
| NameRef GenericArgList?
|
||||
| NameRef ParamList RetType?
|
||||
| '<' PathType ('as' PathType)? '>'
|
||||
|
|
Loading…
Reference in a new issue