Skip to content

Improve printing of strings #22945

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

som-snytt
Copy link
Contributor

Ports scala/scala#10897

It would be nice if SourceCode avoided intermediate strings (due to highlighting) and used the StringBuilder directly.

@som-snytt
Copy link
Contributor Author

cc

@Mikhail42
Copy link

Mikhail42 commented Apr 28, 2025

It would be nice to add at least a few tests. I've not found them here (https://github.com/scala/scala3/tree/main/compiler/test/dotty/tools/dotc/printing)

@som-snytt
Copy link
Contributor Author

I would do something about the code duplication before undrafting.

Everything breaks if strings are broken, and on scala 2 it was also a zinc dependency. A useful test would be a scalacheck, as there are many boundary conditions. An existing test broke because it noticed whether Unicode escapes were lowercase. (I did not argue with the test.)

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