In progress: [Issue 113] Not all protoc errors are shown as editor
markers
In the process of adding a new protoc output parser.
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/builder/ProtocOutputParser_parseAndAddMarkerIfNecessary_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/builder/LineSpecificErrorParser_parseAndAddMarkerIfNecessary_Test.java
similarity index 81%
rename from com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/builder/ProtocOutputParser_parseAndAddMarkerIfNecessary_Test.java
rename to com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/builder/LineSpecificErrorParser_parseAndAddMarkerIfNecessary_Test.java
index 544eddf..13b1cc8 100644
--- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/builder/ProtocOutputParser_parseAndAddMarkerIfNecessary_Test.java
+++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/builder/LineSpecificErrorParser_parseAndAddMarkerIfNecessary_Test.java
@@ -14,18 +14,18 @@
import org.junit.*;
/**
- * Tests for <code>{@link ProtocOutputParser#parseAndAddMarkerIfNecessary(String, ProtocMarkerFactory)}</code>.
+ * Tests for <code>{@link LineSpecificErrorParser#parseAndAddMarkerIfNecessary(String, ProtocMarkerFactory)}</code>.
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class ProtocOutputParser_parseAndAddMarkerIfNecessary_Test {
+public class LineSpecificErrorParser_parseAndAddMarkerIfNecessary_Test {
private ProtocMarkerFactory markerFactory;
- private ProtocOutputParser outputParser;
+ private LineSpecificErrorParser outputParser;
@Before public void setUp() {
markerFactory = mock(ProtocMarkerFactory.class);
- outputParser = new ProtocOutputParser();
+ outputParser = new LineSpecificErrorParser();
}
@Test public void should_not_create_IMarker_if_line_does_not_match_error_pattern() throws CoreException {
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtocOutputParser.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/LineSpecificErrorParser.java
similarity index 88%
rename from com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtocOutputParser.java
rename to com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/LineSpecificErrorParser.java
index e1bd06c..6ab3cac 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtocOutputParser.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/LineSpecificErrorParser.java
@@ -19,7 +19,7 @@
*
* @author alruiz@google.com (Alex Ruiz)
*/
-class ProtocOutputParser {
+class LineSpecificErrorParser {
/*
* (.*):(\\d+):(\\d+):\\s*(.*)
@@ -33,7 +33,7 @@
*/
private static final Pattern ERROR_PATTERN = Pattern.compile("(.*):(\\d+):(\\d+):\\s*(.*)");
- void parseAndAddMarkerIfNecessary(String line, ProtocMarkerFactory markerFactory) throws CoreException {
+ public void parseAndAddMarkerIfNecessary(String line, ProtocMarkerFactory markerFactory) throws CoreException {
Matcher errorMatcher = ERROR_PATTERN.matcher(line);
if (!errorMatcher.matches()) return;
String fileName = errorMatcher.group(1);
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java
index e70f5d0..32522f4 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/ProtobufBuildParticipant.java
@@ -37,7 +37,7 @@
*/
public class ProtobufBuildParticipant implements IXtextBuilderParticipant {
- @Inject private ProtocOutputParser outputParser;
+ @Inject private LineSpecificErrorParser outputParser;
@Inject private ProtocCommandFactory commandFactory;
@Inject private CompilerPreferencesFactory compilerPreferencesFactory;
@Inject private PathsPreferencesFactory pathsPreferencesFactory;