mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
added fmt::Display as a supertrait for AstNode and changed generation.
This commit is contained in:
parent
190179489d
commit
787043496a
2 changed files with 7 additions and 1 deletions
|
@ -68,6 +68,12 @@ fn generate_ast(grammar: AstSrc<'_>) -> Result<String> {
|
|||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for #name {
|
||||
fn fmt(..) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax())
|
||||
}
|
||||
}
|
||||
|
||||
impl AstNode for #name {
|
||||
fn can_cast(kind: SyntaxKind) -> bool {
|
||||
match kind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue