Commit 99740ca
Fix weird formatting on augment decorator args (#10556)
Augment decorator args broke asymmetrically (first arg hugging `(`, rest
indented).
## Changes
- **`printAugmentDecoratorArgs`**: Add `softline` before the first
argument (targetType), matching `printCallLikeArgs` behavior for
consistent indentation on break.
## Before/After
```tsp
// Before: first arg hugs paren, closing paren on new line
@@Some.Very.Long.Namespace.Decorator(subscribe1
);
// After: all args indent consistently
@@Some.Very.Long.Namespace.Decorator(
subscribe1
);
// Before: first arg hugs paren while rest are indented
@@doc(Foo,
"This is getting very very very long 1",
"This is getting very very very long 2",
"This is getting very very very long 3"
);
// After: all args indent consistently
@@doc(
Foo,
"This is getting very very very long 1",
"This is getting very very very long 2",
"This is getting very very very long 3"
);
// Short lines remain inline
@@doc(Foo, "This is some post doc");
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>1 parent 483ce6d commit 99740ca
5 files changed
Lines changed: 34 additions & 4 deletions
File tree
- .chronus/changes
- packages
- compiler
- src/formatter/print
- test/formatter
- http-client-java/generator/http-client-generator-test/tsp
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
| 568 | + | |
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2509 | 2509 | | |
2510 | 2510 | | |
2511 | 2511 | | |
2512 | | - | |
| 2512 | + | |
| 2513 | + | |
2513 | 2514 | | |
2514 | 2515 | | |
2515 | 2516 | | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
2516 | 2530 | | |
2517 | 2531 | | |
2518 | 2532 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
0 commit comments