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

Restore Scanner.commentSpans #18224

Conversation

WojciechMazur
Copy link
Contributor

Restores Scanner.commentSpans method removed in #17528 to preserve the source compatibility of the public compiler API.
The restored method is now marked as deprecated, allowing to remove it in some future, non-lts, major release.
The public API was used in mpollmeier/scala-repl-pp and regression was discvered in Open CB: https://github.com/VirtusLab/community-build3/actions/runs/5557868276/jobs/10155544164

@nicolasstucki
Copy link
Contributor

We need to setup MiMa on this project.

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

dotty.tools.dotc.parsing.Scanners isn't public API, so we shouldn't take on supporting it's external usage

@nicolasstucki
Copy link
Contributor

Right, this is not a stable API

@@ -233,6 +233,10 @@ object Scanners {
/** Return a list of all the comments */
def comments: List[Comment] = commentBuf.toList

/** Return a list of all the comment positions */
@deprecated("Use `comments` to get rich information source comments", since = "3.3.2")
Copy link

Choose a reason for hiding this comment

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

Why not mark it as @InternalApi as Akka?

Copy link
Contributor

Choose a reason for hiding this comment

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

They can use comments.map(_.span).

@nicolasstucki
Copy link
Contributor

As this project depends on the compiler itself, it must be recompiled for each version of the compiler (including patch versions). They might need to adapt their code for each release.

I'm unsure if this project should be on the open community build. Most of the failures will be on the side of scala-repl-pp. The best setup is probably for them to test each day against our nightlies to discover new incompatibilities.

@dwijnand
Copy link
Member

Agreed, it sounds like it's not a good candidate for our use in the community build.

@Kordyjan
Copy link
Contributor

Kordyjan commented Aug 9, 2023

There is nothing bad in removing that in Scala Next (so on the current main), but I'm strongly against removing any API in LTS; even if we are not providing any guarantees for such API. I'll merge this to 3.3.1.

EDIT: I just realized that the API was removed AFTER the 3.3.1 cut-off, so it is okay for now.

@Kordyjan Kordyjan force-pushed the api-compat/Scanner-comments branch from 206b1b2 to 0d295b9 Compare August 9, 2023 13:17
@Kordyjan Kordyjan changed the base branch from main to release-3.3.1 August 9, 2023 13:17
@Kordyjan Kordyjan closed this Aug 9, 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.

5 participants