From dddf0948c89f49024d5d8a60cfcbc1f327d020aa Mon Sep 17 00:00:00 2001 From: Mickael Istria Date: Wed, 10 Jul 2024 09:39:56 +0200 Subject: [PATCH] Map more pb --- .../jdt/internal/javac/JavacProblemConverter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacProblemConverter.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacProblemConverter.java index 4b0d1ef51b4..7b2f13c252c 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacProblemConverter.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacProblemConverter.java @@ -149,6 +149,16 @@ private org.eclipse.jface.text.Position getDiagnosticPosition(Diagnostic= 0) { + return new org.eclipse.jface.text.Position(start, end - start); + } + } + } TreePath diagnosticPath = getTreePath(jcDiagnostic); if (problemId == IProblem.ParameterMismatch) { // Javac points to the arg, which JDT expects the method name @@ -470,6 +480,7 @@ public int toProblemId(Diagnostic diagnostic) { case "compiler.warn.redundant.cast" -> IProblem.UnnecessaryCast; case "compiler.err.illegal.char" -> IProblem.InvalidCharacterConstant; case "compiler.err.enum.label.must.be.unqualified.enum" -> IProblem.UndefinedField; + case "compiler.err.bad.initializer" -> IProblem.ParsingErrorInsertToComplete; // next are javadoc; defaulting to JavadocUnexpectedText when no better problem could be found case "compiler.err.dc.bad.entity" -> IProblem.JavadocUnexpectedText; case "compiler.err.dc.bad.inline.tag" -> IProblem.JavadocUnexpectedText;