mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
More clever highlighting, incl draft for structs
This commit is contained in:
parent
ed89b0638b
commit
43d5a49653
10 changed files with 159 additions and 414 deletions
|
@ -523,10 +523,6 @@ impl<'a> SyntaxElement<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn as_ast_node<T: AstNode>(&self) -> Option<&T> {
|
||||
self.as_node().and_then(|x| <T as AstNode>::cast(x))
|
||||
}
|
||||
|
||||
pub fn as_token(&self) -> Option<SyntaxToken<'a>> {
|
||||
match self {
|
||||
SyntaxElement::Node(_) => None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue