Skip to content

Commit

Permalink
fix: schema index signature comment format location
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Aug 20, 2024
1 parent 24dafd8 commit 3260726
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions kclvm/ast_pretty/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ impl<'p, 'ctx> MutSelfTypedResultWalker<'ctx> for Printer<'p> {
}
if let Some(index_signature) = &schema_stmt.index_signature {
self.fill("");
self.write_ast_comments(index_signature);
self.write_token(TokenKind::OpenDelim(DelimToken::Bracket));
if index_signature.node.any_other {
self.write_token(TokenKind::DotDotDot);
Expand Down
6 changes: 6 additions & 0 deletions kclvm/ast_pretty/src/test_data/comment.input
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ appConfiguration = AppConfiguration {
overQuota: True
}
# Comment Nine

schema Foo:
# Comment for index signature
[k: str]: int
# Comment for `x` field
x: int
6 changes: 6 additions & 0 deletions kclvm/ast_pretty/src/test_data/comment.output
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ appConfiguration = AppConfiguration {
overQuota: True
}
# Comment Nine
schema Foo:
# Comment for index signature
[k: str]: int
# Comment for `x` field
x: int

0 comments on commit 3260726

Please sign in to comment.