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

Use delegating reporter error/warn/info count #1505

Closed
olafurpg opened this issue Apr 21, 2018 · 4 comments · Fixed by #1992
Closed

Use delegating reporter error/warn/info count #1505

olafurpg opened this issue Apr 21, 2018 · 4 comments · Fixed by #1992
Labels

Comments

@olafurpg
Copy link
Member

olafurpg commented Apr 21, 2018

Following up from discussion in ghik/silencer#7 (comment)

It would be smart if our reporter used info/warn/error counts from the delegating reporter.
Example how this can be done https://github.com/ghik/silencer/blob/099138fff63d3060ddb70be11d65f4cd73e3a6c5/silencer-plugin/src/main/scala/com/github/ghik/silencer/SuppressingReporter.scala#L44-L48
If anyone wants to take a stab at this, a good place to start would be https://github.com/scalameta/scalameta/blob/110147dfa610b7859623ff2aad7f5ee3abbc60b3/semanticdb/scalac/library/src/main/scala/scala/meta/internal/semanticdb/scalac/SemanticdbReporter.scala

@ghik
Copy link
Contributor

ghik commented Feb 17, 2020

The workaround mentioned in ghik/silencer#7 (comment) no longer works because reporters changed in Scala 2.13.1 (scala/scala#8338). SemanticdbReporter needs to be rewritten for Scala 2.13.1+

@olafurpg
Copy link
Member Author

SemanticdbReporter needs to be rewritten for Scala 2.13.1+

Can you elaborate? Our tests are passing on 2.13.1 with the current implementation but if I understand correctly we need to make some changes to make it play nicely with other plugins that also change the reporter?

@ghik
Copy link
Contributor

ghik commented Feb 17, 2020

Yes, the problem only arises in interaction with other compiler plugins like silencer. However, the API used by SemanticdbReporter is deprecated in 2.13.1 so it should be ported anyway. The new API eliminates the necessity to manually track error/warn/info count (thanks to ForwardingReporter)

@olafurpg
Copy link
Member Author

Thanks for the explanation! Makes sense.

ghik added a commit to ghik/scalameta that referenced this issue Feb 17, 2020
…rapped scalac reporter

This commit fixes scalameta#1505 and also updates Scala 2.13.1+ implementation to
new reporters API introduced in Scala 2.13.1.
ghik added a commit to ghik/scalameta that referenced this issue Feb 17, 2020
…rapped scalac reporter

This commit fixes scalameta#1505 and also updates Scala 2.13.1+ implementation to
new reporters API introduced in Scala 2.13.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants