Fixed: [ Issue 83 ] Syntax Coloring works incorrectly if enums contain comments. https://code.google.com/p/protobuf-dt/issues/detail?id=83
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/editor/syntaxcoloring/ProtobufSemanticHighlightingCalculator.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/editor/syntaxcoloring/ProtobufSemanticHighlightingCalculator.java index e42929d..e5208d4 100644 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/editor/syntaxcoloring/ProtobufSemanticHighlightingCalculator.java +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/editor/syntaxcoloring/ProtobufSemanticHighlightingCalculator.java
@@ -217,9 +217,9 @@ private void highlightFirstFeature(EObject semantic, EStructuralFeature feature, IHighlightedPositionAcceptor acceptor, String highlightId) { INode node = nodes.firstNodeForFeature(semantic, feature); - if (node == null || node.getText() == null) return; + if (node == null) return; try { - acceptor.addPosition(node.getOffset(), node.getText().trim().length(), highlightId); + acceptor.addPosition(node.getOffset(), node.getLength(), highlightId); } catch (Throwable t) { t.printStackTrace(); }