Commit 6b749e3
committed
Scala parser: support parameterless methods, annotated methods, remove while fallback
- Parameterless methods (def name: Type) now map to J.MethodDeclaration with
OmitBraces marker on empty param container — printer omits ()
- Annotated methods (@deprecated def ...) now map to J.MethodDeclaration with
annotations extracted and def-modifier carrying annotation-to-def spacing
- Remove while loop fallback — while loops in method bodies handled by parser
- Remove AppliedTypeTree fallback (already fixed in #7260)
- 3 remaining fallbacks: procedure syntax, nested braces, function type params
- 5 test failures: 3 complex annotations (with args), 2 while body block whitespace1 parent 9258932 commit 6b749e3
4 files changed
Lines changed: 223 additions & 130 deletions
File tree
- rewrite-scala/src
- main
- java/org/openrewrite/scala
- scala/org/openrewrite/scala/internal
- test/java/org/openrewrite/scala/tree
Lines changed: 30 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
290 | 291 | | |
291 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
292 | 299 | | |
293 | | - | |
294 | | - | |
295 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
296 | 305 | | |
297 | | - | |
298 | 306 | | |
299 | 307 | | |
300 | 308 | | |
301 | 309 | | |
302 | 310 | | |
303 | 311 | | |
304 | | - | |
| 312 | + | |
305 | 313 | | |
306 | | - | |
307 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
308 | 320 | | |
309 | 321 | | |
310 | 322 | | |
| |||
342 | 354 | | |
343 | 355 | | |
344 | 356 | | |
345 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
346 | 360 | | |
347 | 361 | | |
348 | 362 | | |
349 | 363 | | |
350 | 364 | | |
351 | 365 | | |
352 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
353 | 370 | | |
354 | | - | |
| 371 | + | |
355 | 372 | | |
356 | | - | |
| 373 | + | |
357 | 374 | | |
| 375 | + | |
| 376 | + | |
358 | 377 | | |
359 | 378 | | |
360 | | - | |
361 | 379 | | |
362 | 380 | | |
363 | 381 | | |
| |||
0 commit comments