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

Make sure Scala 3 dialect is used when printing instrumented code #514

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jun 10, 2021

Previously, we would use the default dialect, which would print import something._ instead of import something.* and this would break with the -source future flag that drops the former syntax.

Fixes #513

@tgodzik tgodzik requested review from keynmol and olafurpg June 10, 2021 15:25
Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

The fact that the dialect influences the rendered code indicates that we're using .syntax somewhere instead of .pos.text 🤔 Ideally, the dialect shouldn't any impact on the formatted code because otherwise you risk loosing trivia such as custom formatting and comments

@tgodzik
Copy link
Contributor Author

tgodzik commented Jun 10, 2021

The fact that the dialect influences the rendered code indicates that we're using .syntax somewhere instead of .pos.text Ideally, the dialect shouldn't any impact on the formatted code because otherwise you risk loosing trivia such as custom formatting and comments

That was my bad! I was testing it with pos.text, but it seemed not to work, but I forgot to change the test to use * 🤦

Previously, we would use the default dialect, which would print `import something._` instead of `import something.*` and this would break with the -source future flag that drops the former syntax.

Fixes scalameta#513
@tgodzik tgodzik merged commit 7e56511 into scalameta:main Jun 11, 2021
@tgodzik tgodzik deleted the scala3-syntax branch June 11, 2021 07:38
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.

-source:future incapacitates metals worksheet.
3 participants