mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-26 11:55:04 +00:00
implementing Display for enums too.
This commit is contained in:
parent
787043496a
commit
31eec5e80c
2 changed files with 643 additions and 2 deletions
File diff suppressed because it is too large
Load diff
|
@ -69,8 +69,8 @@ fn generate_ast(grammar: AstSrc<'_>) -> Result<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for #name {
|
impl std::fmt::Display for #name {
|
||||||
fn fmt(..) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
std::fmt::Display::fmt(self.syntax())
|
std::fmt::Display::fmt(self.syntax(), f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,12 @@ fn generate_ast(grammar: AstSrc<'_>) -> Result<String> {
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
|
|
||||||
|
impl std::fmt::Display for #name {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
std::fmt::Display::fmt(self.syntax(), f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AstNode for #name {
|
impl AstNode for #name {
|
||||||
fn can_cast(kind: SyntaxKind) -> bool {
|
fn can_cast(kind: SyntaxKind) -> bool {
|
||||||
match kind {
|
match kind {
|
||||||
|
|
Loading…
Reference in a new issue