Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homogenize TASTy printer formatting #19106

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Nov 30, 2023

  • Homogenize the formatting of section names and sizes
  • Homogenize indentation across sections
  • Add TASTy header section
  • Add Names section size

New

/** aa */
class Test
Screenshot 2023-11-30 at 12 03 21

Old

Screenshot 2023-11-30 at 12 04 10

private def printNames(): Unit =
sb.append(s"Names (${unpickler.namesEnd.index - unpickler.namesStart.index} bytes, staring from ${unpickler.namesStart.index}):\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sb.append(s"Names (${unpickler.namesEnd.index - unpickler.namesStart.index} bytes, staring from ${unpickler.namesStart.index}):\n")
sb.append(s"Names (${unpickler.namesEnd.index - unpickler.namesStart.index} bytes, starting from ${unpickler.namesStart.index}):\n")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@nicolasstucki nicolasstucki force-pushed the homogenize-tasty-printer-format branch from 6485d2f to 2e4e8fe Compare November 30, 2023 13:03
@nicolasstucki nicolasstucki marked this pull request as ready for review November 30, 2023 13:03
@nicolasstucki nicolasstucki force-pushed the homogenize-tasty-printer-format branch from 2e4e8fe to a440dc4 Compare November 30, 2023 14:52
bishabosha added a commit that referenced this pull request Dec 1, 2023
Based on #19106

Now it properly shows that the sources form the position section are
references in the name table. This includes the coloring of the indices
and referenced names.

```diff
 source paths:
-         0: t/Test.scala
+         0: 21 [t/Test.scala]
```

<img width="272" alt="Screenshot 2023-11-30 at 10 32 35"
src="https://github.com/lampepfl/dotty/assets/3648029/36c87ff4-0a21-4af9-907d-1b36d3f70496">

Can be reproduced with
```scala
// Test.scala
class Test
```
```
scalac -Yprint-tasty Test.scala
```
* Homogenize the formatting of section names and sizes
* Homogenize indentation across sections
* Add TASTy header section
* Add Names section size
@bishabosha bishabosha force-pushed the homogenize-tasty-printer-format branch from a440dc4 to 448298e Compare December 1, 2023 12:51
@nicolasstucki
Copy link
Contributor Author

Included in #19106

auto-merge was automatically disabled December 1, 2023 12:56

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants