-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from mlachkar/branch-1
Add patches only to files having error in scala 3
- Loading branch information
Showing
6 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ out/ | |
.metals/ | ||
.vscode/ | ||
project/metals.sbt | ||
project/project/metals.sbt |
23 changes: 23 additions & 0 deletions
23
interfaces/compiler/src/main/java/compiler/interfaces/FileWithErrorReporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package compiler.interfaces; | ||
|
||
import dotty.tools.dotc.core.Contexts.Context; | ||
import dotty.tools.dotc.reporting.Diagnostic; | ||
import dotty.tools.dotc.reporting.Reporter; | ||
|
||
import java.util.HashSet; | ||
|
||
// we want to get the paths of all files that have errors | ||
public class FileWithErrorReporter extends Reporter { | ||
HashSet<String> filesWithErrors = new HashSet<String>(); | ||
|
||
public void doReport(Diagnostic dia, Context ctx) { | ||
if (dia.level() == Diagnostic.ERROR) { | ||
String filePath = dia.pos().source().path(); | ||
filesWithErrors.add(filePath); | ||
} | ||
} | ||
|
||
public String[] getFilesWithErrors() { | ||
return filesWithErrors.stream().toArray(String[]::new); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters