Renamed LiteralRef to LiteralLink.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralRef_literal_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
similarity index 86%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralRef_literal_Test.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
index 42ac84e..389a83b 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralRef_literal_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
@@ -24,11 +24,11 @@
import com.google.eclipse.protobuf.protobuf.Enum;
/**
- * Tests for <code>{@link ProtobufScopeProvider#scope_LiteralRef_literal(LiteralRef, EReference)}</code>.
+ * Tests for <code>{@link ProtobufScopeProvider#scope_LiteralLink_target(LiteralLink, EReference)}</code>.
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class ProtobufScopeProvider_scope_LiteralRef_literal_Test {
+public class ProtobufScopeProvider_scope_LiteralLink_target_Test {
private static EReference reference;
@@ -56,7 +56,7 @@
// }
@Test public void should_provide_Literals_for_default_value() {
FieldOption option = xtext.find("default", FieldOption.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum typeEnum = xtext.find("Type", " {", Enum.class);
assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
}
@@ -66,7 +66,7 @@
// option optimize_for = SPEED;
@Test public void should_provide_Literals_for_native_option() {
Option option = xtext.find("optimize_for", Option.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum optimizeModeEnum = descriptor().enumByName("OptimizeMode");
assertThat(descriptionsIn(scope), containAllLiteralsIn(optimizeModeEnum));
}
@@ -87,7 +87,7 @@
// option (type) = ONE;
@Test public void should_provide_Literals_for_source_of_custom_option() {
Option option = xtext.find("type", ")", Option.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum typeEnum = xtext.find("Type", " {", Enum.class);
assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
}
@@ -112,13 +112,13 @@
// option (info).type = ONE;
@Test public void should_provide_Literals_for_source_of_field_of_custom_option() {
Option option = xtext.find("info", ")", Option.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum typeEnum = xtext.find("Type", " {", Enum.class);
assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
}
- private static LiteralRef valueOf(Option option) {
- return (LiteralRef) option.getValue();
+ private static LiteralLink valueOf(Option option) {
+ return (LiteralLink) option.getValue();
}
// syntax = "proto2";
@@ -128,7 +128,7 @@
// }
@Test public void should_provide_Literals_for_source_of_native_field_option() {
FieldOption option = xtext.find("ctype", FieldOption.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum cTypeEnum = descriptor().enumByName("CType");
assertThat(descriptionsIn(scope), containAllLiteralsIn(cTypeEnum));
}
@@ -156,7 +156,7 @@
// }
@Test public void should_provide_Literals_for_source_of_custom_field_option() {
FieldOption option = xtext.find("type", ")", FieldOption.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum typeEnum = xtext.find("Type", " {", Enum.class);
assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
}
@@ -183,12 +183,12 @@
// }
@Test public void should_provide_Literals_for_source_of_field_in_custom_field_option() {
FieldOption option = xtext.find("info", ")", FieldOption.class);
- IScope scope = provider.scope_LiteralRef_literal(valueOf(option), reference);
+ IScope scope = provider.scope_LiteralLink_target(valueOf(option), reference);
Enum typeEnum = xtext.find("Type", " {", Enum.class);
assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
}
- private static LiteralRef valueOf(FieldOption option) {
- return (LiteralRef) option.getValue();
+ private static LiteralLink valueOf(FieldOption option) {
+ return (LiteralLink) option.getValue();
}
}
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/Finder.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/Finder.java
index 05e0d91..7143b88 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/Finder.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/Finder.java
@@ -27,7 +27,7 @@
*/
class Finder {
- private static final String[] FEATURE_NAMES = { "extension", "message", "name", "optionField", "property", "source", "type" };
+ private static final String[] FEATURE_NAMES = { "extension", "target", "message", "name", "optionField", "property", "source", "type" };
private final String protoAsText;
private final AbstractNode root;
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider_getFullyQualifiedName_Test.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider_getFullyQualifiedName_Test.java
index 3352509..87f968d 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider_getFullyQualifiedName_Test.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider_getFullyQualifiedName_Test.java
@@ -13,6 +13,7 @@
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.naming.*;
import org.junit.*;
@@ -20,7 +21,7 @@
import com.google.eclipse.protobuf.protobuf.*;
/**
- * Tests for <code>{@link ProtobufQualifiedNameProvider}</code>.
+ * Tests for <code>{@link ProtobufQualifiedNameProvider#getFullyQualifiedName(EObject)}</code>.
*
* @author alruiz@google.com (Alex Ruiz)
*/
@@ -71,6 +72,8 @@
assertThat(fqn.toString(), equalTo("Person"));
}
+ // syntax = "proto2";
+ //
// message Person {
// optional string name = 1;
// }
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/documentation/MLCommentDocumentationProvider_getDocumentation_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/documentation/MLCommentDocumentationProvider_getDocumentation_Test.java
index 8fcda40..d58fc4c 100644
--- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/documentation/MLCommentDocumentationProvider_getDocumentation_Test.java
+++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/documentation/MLCommentDocumentationProvider_getDocumentation_Test.java
@@ -53,6 +53,8 @@
assertThat(lines[1], equalTo("(Optional.)"));
}
+ // syntax = "proto2";
+ //
// message Person {
// optional bool active = 1;
// }
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 907f555..f854c15 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
@@ -11,7 +11,6 @@
import static com.google.eclipse.protobuf.protobuf.ProtobufPackage.Literals.*;
import static com.google.eclipse.protobuf.ui.editor.syntaxcoloring.HighlightingConfiguration.*;
-import static org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration.*;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.*;
@@ -124,7 +123,7 @@
private void highlightOptions(IndexedElement element, IHighlightedPositionAcceptor acceptor) {
for (FieldOption option : indexedElements.fieldOptionsOf(element)) {
ValueLink link = option.getValue();
- if (link instanceof LiteralRef) {
+ if (link instanceof LiteralLink) {
highlightFirstFeature(option, FIELD_OPTION__VALUE, acceptor, ENUM_LITERAL_ID);
return;
}
@@ -210,7 +209,7 @@
highlightFirstFeature(option, OPTION__SOURCE, acceptor, DEFAULT_ID);
}
ValueLink link = option.getValue();
- if (link instanceof LiteralRef) {
+ if (link instanceof LiteralLink) {
highlightFirstFeature(option, OPTION__VALUE, acceptor, ENUM_LITERAL_ID);
return;
}
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
index 27b5ed2..a37934e 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
@@ -196,10 +196,10 @@
'[' extension=[MessageField|QualifiedName] ']';
SimpleValueLink:
- LiteralRef | BooleanLink | NumberLink | StringLink;
+ LiteralLink | BooleanLink | NumberLink | StringLink;
-LiteralRef:
- literal=[Literal];
+LiteralLink:
+ target=[Literal];
BooleanLink:
target=BOOL;
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
index 9f3e573..0e1f131 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
@@ -71,7 +71,7 @@
}
@SuppressWarnings("unused")
- public IScope scope_LiteralRef_literal(LiteralRef l, EReference r) {
+ public IScope scope_LiteralLink_target(LiteralLink l, EReference r) {
EObject container = l.eContainer();
Enum anEnum = null;
if (container instanceof DefaultValueFieldOption) {