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

Fix TASTy source position printer #19105

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Nov 30, 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.

 source paths:
-         0: t/Test.scala
+         0: 21 [t/Test.scala]
Screenshot 2023-11-30 at 10 32 35

Can be reproduced with

// Test.scala
class Test
scalac -Yprint-tasty Test.scala

@nicolasstucki nicolasstucki self-assigned this Nov 30, 2023
@nicolasstucki nicolasstucki marked this pull request as ready for review November 30, 2023 09:52
* Homogenize the formatting of section names and sizes
* Homogenize indentation across sections
* Add TASTy header section
* Add Names section size
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]
```
Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

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

nice change! I tried locally

@bishabosha bishabosha merged commit 1f3af47 into scala:main Dec 1, 2023
19 checks passed
@bishabosha bishabosha deleted the fix-tasty-position-printer branch December 1, 2023 12:32
sb.append(treeStr("%10d: ".format(addr.index)))
sb.append(path)
for ((addr, nameRef) <- sortedPath) {
sb.append(treeStr("%6d: ".format(addr.index)))
Copy link
Member

@bishabosha bishabosha Dec 1, 2023

Choose a reason for hiding this comment

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

@nicolasstucki actually this : should not be highlighted as anything, small thing but it is inconsistent with the rest of the document

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I will fix it in #19139

@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
WojciechMazur added a commit that referenced this pull request Jun 26, 2024
Backports #19105 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

3 participants