-
Notifications
You must be signed in to change notification settings - Fork 120
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 #930: Report original problems in SourceInfos #931
Conversation
Should I do something to validate this against sbt? |
@adpi2 Thanks for the fix. @rtimush wrote in sbt/sbt#5892 (comment):
It would be good if you could confirm that this patch would address sbt/sbt#5892 by locally publishing zinc. I often use the following to bind SNAPSHOT Zinc against sbt to locally check:
|
I checked sbt/sbt#5892 with this PR and my test (sbt/sbt@develop...rtimush:warnings-test) passed. |
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
… mapping is only done for logging Starting with sbt 1.4.1, when a compilation error occurs, the Position of a Problem (which is contained within the Incomplete) will no longer refer to the mapped source file (e.g. until sbt 1.4.0 the Position would refer to "conf/routes" when a compilation error actually happened in "target/scala-2.13/routes/main/router/Routes.scala"). That's caused by sbt/zinc#931: The file causing the compilation error is not transformed via the sourcePositionMappers config anymore before adding it to "allProblems", the field that eventually gets used by the Incomplete. (The transformation still takes place to show the mapped source file in the logs) Play however needs to know the mapped source file to display it in it's error pages for a nice dev experience. So the solution is that Play itself will try to transform the source file to the mapped file by running it "through" sourcePositionMappers:
Fixes #930
LoggedReporter.allProblems
return original problems so that theAnalysisCallback
can link each position to the correspondingVirtualFile