-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miss a method to access all PathType
in PathSegment
#15778
Comments
Interesting, our grammar is also wrong here rust-analyzer/crates/syntax/rust.ungram Line 39 in d6afb4f
That should be
and then we should implement the path type accessor manually given the potential overlap, somewhat similar to rust-analyzer/crates/syntax/src/ast/node_ext.rs Lines 332 to 362 in d6afb4f
|
Should we modify the syntax tree structure of According to pub fn path_type(&self) -> Option<PathType> {
support::children(&self.syntax).last()
}
|
The parser already parses a |
@rustbot claim |
There are only
pub fn path_type(&self) -> Option<PathType>
forPathSegment
, which only return the firstPathType
, but there maybe more than onePathType
in aPathSegment
, take<i32 as std::ops::Add>
for example, the AST of it is as the following:So I think there can make a
pub fn path_types(&self) -> Vec<PathType> { support::children(&self.syntax).collect() }
forPathSegment
to access allPathType
.The text was updated successfully, but these errors were encountered: