-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add DiagnosticRelatedInformation to compiler's interface #16677
Conversation
eb2f68d
to
4adef1c
Compare
There was a problem hiding this 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?
I added |
@tgodzik yes, the structure is equivalent to what we have in LSP |
4adef1c
to
5f55e74
Compare
5f55e74
to
54639f2
Compare
There was a problem hiding this 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.
val Interfaces: Seq[ProblemFilter] = Seq( | ||
ProblemFilters.exclude[MissingClassProblem]("dotty.tools.dotc.interfaces.DiagnosticRelatedInformation"), | ||
ProblemFilters.exclude[ReversedMissingMethodProblem]("dotty.tools.dotc.interfaces.Diagnostic.diagnosticRelatedInformation") | ||
) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.