Skip to content

Add DiagnosticRelatedInformation to compiler's interface #16677

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

Merged

Conversation

prolativ
Copy link
Contributor

No description provided.

@prolativ prolativ requested a review from smarter January 13, 2023 11:39
@Kordyjan Kordyjan requested a review from tgodzik January 13, 2023 12:08
@prolativ prolativ force-pushed the diagnostic-related-information-interface branch from eb2f68d to 4adef1c Compare January 13, 2023 13:19
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Looks good! It's the same as the LSP related information, right?

@prolativ
Copy link
Contributor Author

I added DiagnosticRelatedInformation for consistency with other definitions in dotty.tools.dotc.interfaces. However I'm wondering whether scala3-interfaces is actually used by anyone as this module mostly duplicates interfaces from xsbti and doesn't seem to have had any significant changes for the last 7 years. @smarter any idea on this?

@prolativ
Copy link
Contributor Author

@tgodzik yes, the structure is equivalent to what we have in LSP

@prolativ prolativ force-pushed the diagnostic-related-information-interface branch from 4adef1c to 5f55e74 Compare January 13, 2023 14:20
@prolativ prolativ force-pushed the diagnostic-related-information-interface branch from 5f55e74 to 54639f2 Compare January 13, 2023 14:23
@Kordyjan Kordyjan added this to the 3.3.0 backports milestone Jan 16, 2023
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

However I'm wondering whether scala3-interfaces is actually used by anyone as this module mostly duplicates interfaces from xsbti and doesn't seem to have had any significant changes for the last 7 years.

Ideally I think the two should be merged, but no one has tried that. Originally scala3-interfaces was a request by the IntelliJ team, but I think they never ended up using it. Now it's too late to remove it since we promised to keep backwards-compatibility, and it still seems like it could become useful.

Comment on lines +10 to +13
val Interfaces: Seq[ProblemFilter] = Seq(
ProblemFilters.exclude[MissingClassProblem]("dotty.tools.dotc.interfaces.DiagnosticRelatedInformation"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("dotty.tools.dotc.interfaces.Diagnostic.diagnosticRelatedInformation")
)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is necessary, since the baseVersion is 3.3.0-RC1, mima is set to run in backwards mode which lets us add new APIs without having to filter them, I checked that scala3-interfaces/mimaReportBinaryIssues did not fail if I removed this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me this fails with

[error] scala3-interfaces: Failed binary compatibility check against org.scala-lang:scala3-interfaces:3.2.2! Found 1 potential problems
[error]  * abstract method diagnosticRelatedInformation()java.util.List in interface dotty.tools.dotc.interfaces.Diagnostic is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("dotty.tools.dotc.interfaces.Diagnostic.diagnosticRelatedInformation")
[error] java.lang.RuntimeException: Failed binary compatibility check against org.scala-lang:scala3-interfaces:3.2.2! Found 1 potential problems
[error]         at scala.sys.package$.error(package.scala:30)
[error]         at com.typesafe.tools.mima.plugin.SbtMima$.reportModuleErrors(SbtMima.scala:89)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$2(MimaPlugin.scala:36)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$2$adapted(MimaPlugin.scala:26)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:943)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$1(MimaPlugin.scala:26)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$1$adapted(MimaPlugin.scala:25)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)

And this also failed in the CI. That's why I added these exceptions

Copy link
Member

Choose a reason for hiding this comment

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

Does show scala3-interfaces/mimaCheckDirection outputs backward? If not, you may need to reload the sbt build / rebase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does. And I did run reload before running scala3-interfaces/mimaReportBinaryIssues. Does this mean there's a bug in MiMa checks? Anyway that doesn't seem to be a problem for this PR as the MiMa exceptions can be removed just after 3.3.0 gets a stable release

@prolativ prolativ merged commit ede74c4 into scala:main Jan 16, 2023
@Kordyjan Kordyjan modified the milestones: 3.3.0 backports, 3.3.0 Aug 1, 2023
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.

4 participants