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

RunnerSettings: rename from ScalafmtRunner #4842

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

kitbellew
Copy link
Collaborator

ScalafmtRunner is also a base class in cli package, let's disambiguate.

@kitbellew kitbellew force-pushed the 4842 branch 2 times, most recently from a064678 to de9ebb6 Compare February 21, 2025 15:57
ScalafmtRunner is also a base class in cli package, let's disambiguate.
@kitbellew kitbellew merged commit c619f6c into scalameta:main Feb 21, 2025
24 checks passed
@kitbellew kitbellew deleted the 4842 branch February 21, 2025 17:36
@SethTisue
Copy link
Contributor

In the Scala 2 community build, this made Scastie start failing

We already have Scastie forked for community build purposes, so it was easy to accommodate the renaming in the fork: scalacommunitybuild/scastie@59d57f0

but that leaves:

[scastie] [error] /Users/tisue/cb3/target-0.9.20/project-builds/scastie-0e82b37f219c1b95ff4b30018bd89c932a116726/sbt-runner/src/main/scala/com.olegych.scastie.sbt/FormatActor.scala:29:9: method withDialect in class RunnerSettings cannot be accessed as a member of org.scalafmt.config.RunnerSettings from object FormatActor in package sbt
[scastie] [error]       }.withDialect(dialect)
[scastie] [error]         ^
[scastie] [error] one error found

I don't know the Scastie codebase and it isn't obvious to me what to do about withDialect becoming package-private. Is there some other way to access it? How sure are you that it should be private?

SethTisue added a commit to scala/community-build that referenced this pull request Feb 26, 2025
it's good to have the fork refreshed, so I'm pushing this,
but fixing the compile error I found uncovered a second;
I just inquired of kitbellew on scalameta/scalafmt#4842
@tgodzik
Copy link
Contributor

tgodzik commented Feb 26, 2025

I think most of that is internal classes that shouldn't be used. We have interfaces for that and we normally depend on having an actual scalafmt.conf file.

Rewriting it to work similar to metals would probably be the way to go https://github.com/scalameta/metals/blob/main/metals/src/main/scala/scala/meta/internal/metals/FormattingProvider.scala

@kitbellew
Copy link
Collaborator Author

@SethTisue i can restore the method, of course, although i didn't realize anyone was using them.

also, it's a simple .copy(dialect = ...).

@kitbellew
Copy link
Collaborator Author

@SethTisue fyi #4849

@SethTisue
Copy link
Contributor

SethTisue commented Feb 26, 2025

cool thanks! maybe whatever Scastie's doing isn't ideal, no opinion there, but it's nice if we don't have to mess with it

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.

3 participants