mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
Working line level flagging.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user