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

Add patches only to files having error in scala 3 #120

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

mlachkar
Copy link
Contributor

@mlachkar mlachkar commented Mar 4, 2021

To avoid computing unecessary patches

Still need to improve logging for this commit.

@adpi2
Copy link
Member

adpi2 commented Mar 4, 2021

Interesting idea! Also if there is some compiler errors you can compute the patches only in the erroneous files and not the other ones.

@mlachkar
Copy link
Contributor Author

mlachkar commented Mar 5, 2021

I do like this idea.

@mlachkar mlachkar changed the title WIP - First compile in scala 3 without adding patches Add patches only to files having error in scala 3 Mar 8, 2021
@mlachkar mlachkar requested a review from adpi2 March 8, 2021 14:48

public class QuietReporter extends Reporter {
public void doReport(Diagnostic d, Context ctx) {}
HashSet<String> filesWithErrors = new HashSet<String>();
Copy link
Member

Choose a reason for hiding this comment

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

Not used

// This file makes sure that the JDI tools are in the sbt classpath.
// JDI tools are used by the debug adapter server.

addSbtPlugin("org.scala-debugger" % "sbt-jdi-tools" % "1.1.1")
Copy link
Member

Choose a reason for hiding this comment

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

This file should be added to .gitignore

Comment on lines +41 to +46
initialFileToMigrate <- buildMigrationFiles(filesWithErr)
_ <- compileInScala3(
initialFileToMigrate,
filesWithoutErrors ++ javaFiles ++ managedSources,
compiler
)
Copy link
Member

Choose a reason for hiding this comment

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

This should fix the compilation errors in the filesWithErr but there may be cases where the compiler then find errors in others files, in which case we can loop to add the patches of the new filesWithErr until there is no more error.

Can be done in a V2 after we have found a case in which it happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I have to open an issue to get track of this.

To avoid computing unecessary patches
@mlachkar mlachkar merged commit a20dd82 into scalacenter:master Mar 9, 2021
@mlachkar mlachkar deleted the branch-1 branch March 15, 2021 14:20
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.

2 participants