mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Use Comment wrapper
This commit is contained in:
parent
27a86cb7df
commit
f88e13f539
4 changed files with 78 additions and 36 deletions
|
@ -227,6 +227,24 @@ impl<'a> AstNode<'a> for CastExpr<'a> {
|
|||
|
||||
impl<'a> CastExpr<'a> {}
|
||||
|
||||
// Comment
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Comment<'a> {
|
||||
syntax: SyntaxNodeRef<'a>,
|
||||
}
|
||||
|
||||
impl<'a> AstNode<'a> for Comment<'a> {
|
||||
fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> {
|
||||
match syntax.kind() {
|
||||
COMMENT => Some(Comment { syntax }),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
|
||||
}
|
||||
|
||||
impl<'a> Comment<'a> {}
|
||||
|
||||
// Condition
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Condition<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue