Skip to content

Commit 5a11658

Browse files
committed
1 parent 2e833f6 commit 5a11658

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
3+
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
4+
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
5+
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
6+
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
7+
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
8+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="processing-java"/>
9+
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/processing-java/build.xml}"/>
10+
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value=""/>
11+
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
12+
</launchConfiguration>

java/.project

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
<arguments>
1111
</arguments>
1212
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
15+
<triggers>full,incremental,</triggers>
16+
<arguments>
17+
<dictionary>
18+
<key>LaunchConfigHandle</key>
19+
<value>&lt;project&gt;/.externalToolBuilders/AutoBuild.launch</value>
20+
</dictionary>
21+
</arguments>
22+
</buildCommand>
1323
</buildSpec>
1424
<natures>
1525
<nature>org.eclipse.jdt.core.javanature</nature>

java/src/processing/mode/java/pdex/ErrorMessageSimplifier.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import org.eclipse.jdt.core.compiler.IProblem;
2929
import org.eclipse.jdt.internal.compiler.problem.DefaultProblem;
3030

31+
import processing.app.Base;
32+
3133
public class ErrorMessageSimplifier {
3234
/**
3335
* Mapping between ProblemID constant and the constant name. Holds about 650
@@ -85,12 +87,12 @@ public static String getSimplifiedErrorMessage(Problem problem) {
8587
return null;
8688
IProblem iprob = problem.getIProblem();
8789
String args[] = iprob.getArguments();
88-
// log("Simplifying message: " + problem.getMessage() + " ID: "
89-
// + getIDName(iprob.getID()));
90-
// log("Arg count: " + args.length);
91-
// for (int i = 0; i < args.length; i++) {
92-
// log("Arg " + args[i]);
93-
// }
90+
Base.log("Simplifying message: " + problem.getMessage() + " ID: "
91+
+ getIDName(iprob.getID()));
92+
Base.log("Arg count: " + args.length);
93+
for (int i = 0; i < args.length; i++) {
94+
Base.log("Arg " + args[i]);
95+
}
9496

9597
String result = null;
9698

@@ -114,6 +116,9 @@ public static String getSimplifiedErrorMessage(Problem problem) {
114116
if(args[0].equals("AssignmentOperator Expression")){
115117
result = "Consider adding a \"=\"";
116118
}
119+
else if (args[0].equalsIgnoreCase(") Statement")){
120+
result = getErrorMessageForBracket(args[0].charAt(0));
121+
}
117122
else {
118123
result = "Error on \"" + args[0] + "\"";
119124
}
@@ -141,7 +146,12 @@ public static String getSimplifiedErrorMessage(Problem problem) {
141146
result = getErrorMessageForBracket(args[1].charAt(0));
142147
}
143148
else {
144-
result = "Error on \"" + args[0] + "\"Consider adding a \"" + args[1] + "\"";
149+
if(args[1].equalsIgnoreCase("Statement")){ // See #3104
150+
result = "Error on \"" + args[0] + "\", statement expected after this.";
151+
}
152+
else {
153+
result = "Error on \"" + args[0] + "\"Consider adding a \"" + args[1] + "\"";
154+
}
145155
}
146156
}
147157
break;

0 commit comments

Comments
 (0)