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

Ondemand compilation doesn't take scalacOptions #1215

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

mlachkar
Copy link
Collaborator

No description provided.

@mlachkar mlachkar force-pushed the on-demande branch 2 times, most recently from c58b7dc to d3592a4 Compare July 16, 2020 20:44
@mlachkar mlachkar changed the title Ondemande compilation doesn't take scalacOptions Ondemand compilation doesn't take scalacOptions Jul 16, 2020
@mlachkar mlachkar force-pushed the on-demande branch 4 times, most recently from f4db66a to 468deb8 Compare July 17, 2020 13:10
@mlachkar mlachkar added the bug label Jul 20, 2020
@mlachkar
Copy link
Collaborator Author

linked to this scalameta/scalameta#2094

@bjaglin
Copy link
Collaborator

bjaglin commented Nov 10, 2020

Just landed on this and trying to understand the status: scalacOptions is actually passed but there is a bug in InteractiveSemanticdb for 2.13, right?

@mlachkar
Copy link
Collaborator Author

mlachkar commented Nov 11, 2020

So if we pass the scalacOptions, it fixes the onDemand compilaton for 2.11 and 2.12, but not 2.13. So the bug is maybe on the reporter part. The bug is visible on scalameta too.

@bjaglin
Copy link
Collaborator

bjaglin commented Nov 11, 2020

Oh ok. I guess that's still something good to take in then (by removing tests for 2.13), and follow up 2.13 in another PR?

@mlachkar mlachkar force-pushed the on-demande branch 2 times, most recently from 0c4e8e8 to e52b0f2 Compare November 23, 2020 14:26
Copy link
Collaborator

@bjaglin bjaglin left a comment

Choose a reason for hiding this comment

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

👍 thanks for making this incremental!

Comment on lines +380 to +385
val ss = new Settings()
val command = new CompilerCommand(scalacOptions, ss)
val settings = command.settings
settings.YpresentationAnyThread.value = true
settings.classpath.value = validatedClasspath.syntax
val reporter = new StoreReporter()
Copy link
Collaborator

Choose a reason for hiding this comment

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

out of curiosity: is this block evaluated lazily on purpose to capture some state that it not available eagerly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So the creation of Global was lazy, I just put the entire block as lazy.
Usually, if the semanticdb file is present, global is never instantiated.
I don't think there is any state that is captured later..

test("on-demand with scalacOptions") {
// Todo: Ondemand compilation doesn't take scalacOptions or the reporter doesn't gather all warns in 2.13
// see https://github.com/scalacenter/scalafix/pull/1215
if (ScalaVersions.isScala213) true
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we open a separate issue to track that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

@mlachkar mlachkar merged commit 81ffd31 into scalacenter:master Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants