Working line level flagging.

This commit is contained in:
A Pottinger
2021-07-25 19:19:36 -07:00
parent 62249e218a
commit ffc43eadb3
2 changed files with 9 additions and 11 deletions

View File

@@ -85,9 +85,9 @@ class ErrorChecker {
Map<String, String[]> suggCache =
JavaMode.importSuggestEnabled ? new HashMap<>() : Collections.emptyMap();
IProblem[] iproblems;
List<IProblem> iproblems;
if (ps.compilationUnit == null) {
iproblems = new IProblem[0];
iproblems = new ArrayList<>();
} else {
iproblems = ps.iproblems;
}
@@ -107,7 +107,7 @@ class ErrorChecker {
if (problems.isEmpty()) {
AtomicReference<ClassPath> searchClassPath = new AtomicReference<>(null);
List<Problem> cuProblems = Arrays.stream(iproblems)
List<Problem> cuProblems = iproblems.stream()
// Filter Warnings if they are not enabled
.filter(iproblem -> !(iproblem.isWarning() && !JavaMode.warningsEnabled))
// Hide a useless error which is produced when a line ends with

View File

@@ -45,7 +45,7 @@ public class PreprocSketch {
public final List<ImportStatement> coreAndDefaultImports;
public final List<ImportStatement> codeFolderImports;
public final List<Problem> otherProblems;
public final List<IProblems> iproblems;
public final List<IProblem> iproblems;
public final Map<String, Integer> javaFileMapping;
@@ -74,19 +74,17 @@ public class PreprocSketch {
public SketchInterval mapJavaToSketch(IProblem iproblem) {
String originalFile = new String(iproblem.getOriginatingFileName());
System.out.println("here!!");
System.out.println(originalFile);
System.out.println(javaFileMapping.keySet());
System.out.println(iproblem);
boolean isJavaFile = javaFileMapping.containsKey(originalFile);
if (isJavaFile) {
System.out.println("**-**");
System.out.println(javaFileMapping.get(originalFile));
return new SketchInterval(
javaFileMapping.get(originalFile),
iproblem.getSourceStart(),
iproblem.getSourceEnd() + 1,
-1, // Is outside sketch code
-1 // Is outside sketch code
iproblem.getSourceStart(), // Is outside sketch code
iproblem.getSourceEnd() + 1 // Is outside sketch code
);
} else {
return mapJavaToSketch(
@@ -236,7 +234,7 @@ public class PreprocSketch {
public final List<ImportStatement> coreAndDefaultImports = new ArrayList<>();
public final List<ImportStatement> codeFolderImports = new ArrayList<>();
public final List<Problem> otherProblems = new ArrayList<>();
public List<IProblems> iproblems;
public List<IProblem> iproblems;
public Map<String, Integer> javaFileMapping;