mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-11 07:34:22 +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 {
|
||||
fn fmt(..) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax())
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
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 {
|
||||
fn can_cast(kind: SyntaxKind) -> bool {
|
||||
match kind {
|
||||
|
|
Loading…
Reference in a new issue