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

Provide an improved DelegatingReporter #1215

Closed
wants to merge 1 commit into from

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Jul 8, 2023

Problem

We need to surface the code action from Scala 2.13.x.

Solution

This adds an alternative DelegatingReporter implementation as a resource. The ZincComponentManager can then substitute the source for 2.13.12 onwards.

import scala.collection.JavaConverters._
import xsbti.Action

object ReporterTest extends BridgeProviderSpec {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a test demonstrating the use of new code action in Scala 2.13.12-bin-286f8d7

@eed3si9n eed3si9n force-pushed the wip/code_action branch 2 times, most recently from 176c416 to 9c14244 Compare July 8, 2023 20:15
**Problem**
We need to surface the code action from Scala 2.13.x.

**Solution**
This adds an alternative DelegatingReporter implementation as a
resource. The ZincComponentManager can then substitute the source
for 2.13.12 onwards.
val xs = (Compile / sources).value
(xs.filterNot { x => x.getName() == "DelegatingReporter.scala" }) ++
Seq(
(compilerBridge213 / Compile / scalaSource).value.getParentFile() / "resources" / "scala-2.13.12" / "DelegatingReporter.scala"
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason to put this file in resources, vs the more common approach to have a directory in src? There are already version folders in internal/compiler-bridge/src/main.

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently compiler bridge serves all of 2.13.x series using https://repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.9.2/, so the src/main would be have the default implementation that works with 2.13.11, and I was gonna implement the source swapping in ZincComponentCompiler - https://github.com/sbt/sbt/blob/1.9.x/zinc-lm-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, so the compilerBridge213_next project here is just for testing, not for releasing a different artifact.

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.

None yet

2 participants