Skip to content

Commit 40fc109

Browse files
committed
fix: #92 indent issue for line after super()
1 parent 2bea4a7 commit 40fc109

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/data_model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ impl<'a> DocBuild<'a> for ConstructorBody {
18181818
if c.has_trailing_newline {
18191819
result.push(b.empty_new_line());
18201820
} else {
1821-
result.push(b.nl());
1821+
result.push(b.indent(b.nl()));
18221822
}
18231823
}
18241824
} else {

tests/prettier80/bug92.cls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://github.com/xixiaofinland/afmt/issues/92
2+
// the line after super() is not indented correctly;
3+
class A {
4+
public createEventProerties(String origin, String period) {
5+
super(OriginSalesforce);
6+
System.debug('hello');
7+
}
8+
}

tests/prettier80/bug92.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://github.com/xixiaofinland/afmt/issues/92
2+
// the line after super() is not indented correctly;
3+
class A {
4+
public createEventProerties(String origin, String period) {
5+
super(OriginSalesforce);
6+
System.debug('hello');
7+
}
8+
}

0 commit comments

Comments
 (0)