Renamed Type to ComplexType. Renamed RegularImport to NormalImport.
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/matchers/PropertyHasType.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/matchers/PropertyHasType.java
index 066216c..0a39c58 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/matchers/PropertyHasType.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/matchers/PropertyHasType.java
@@ -45,7 +45,7 @@
AbstractTypeRef r = property.getType();
if (r instanceof ScalarTypeRef) return ((ScalarTypeRef) r).getScalar().getName();
if (r instanceof TypeRef) {
- Type type = ((TypeRef) r).getType();
+ ComplexType type = ((TypeRef) r).getType();
return type == null ? null : type.getName();
}
return r.toString();
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 20e5aea..60f312d 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
@@ -51,8 +51,8 @@
highlight((Option) element, acceptor);
continue;
}
- if (element instanceof Type) {
- highlight((Type) element, acceptor);
+ if (element instanceof ComplexType) {
+ highlight((ComplexType) element, acceptor);
continue;
}
if (element instanceof ExtendMessage) {
@@ -72,7 +72,7 @@
}
}
- private void highlight(Type type, IHighlightedPositionAcceptor acceptor) {
+ private void highlight(ComplexType type, IHighlightedPositionAcceptor acceptor) {
if (type instanceof Message) {
highlight((Message) type, acceptor);
return;
@@ -98,8 +98,8 @@
highlight((IndexedElement) element, acceptor);
return;
}
- if (element instanceof Type) {
- highlight((Type) element, acceptor);
+ if (element instanceof ComplexType) {
+ highlight((ComplexType) element, acceptor);
return;
}
if (element instanceof ExtendMessage) {
@@ -152,7 +152,7 @@
private void highlightPropertyType(Property property, IHighlightedPositionAcceptor acceptor) {
AbstractTypeRef ref = property.getType();
if (!(ref instanceof TypeRef)) return;
- Type type = ((TypeRef) ref).getType();
+ ComplexType type = ((TypeRef) ref).getType();
if (type instanceof Message) {
highlightFirstFeature(property, PROPERTY__TYPE, acceptor, MESSAGE_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 5afd83c..ce6f408 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
@@ -21,15 +21,15 @@
'syntax' '=' name=STRING ';';
ProtobufElement:
- Package | Import | Option | Type | ExtendMessage | Service;
+ Package | Import | Option | ComplexType | ExtendMessage | Service;
Package:
'package' name=QualifiedName ';';
Import:
- RegularImport | PublicImport;
+ NormalImport | PublicImport;
-RegularImport:
+NormalImport:
'import' importURI=STRING ';';
PublicImport:
@@ -38,7 +38,7 @@
QualifiedName:
'.'? Name ('.' Name)*;
-Type:
+ComplexType:
Message | Enum | Group;
Message:
@@ -47,7 +47,7 @@
'}' (';')?;
MessageElement:
- Option | Extensions | Type | Property | ExtendMessage;
+ Option | Extensions | ComplexType | Property | ExtendMessage;
Extensions:
'extensions' ranges+=Range (',' ranges+=Range)* ';';
@@ -87,7 +87,7 @@
string | bytes;
TypeRef:
- type=[Type|QualifiedName];
+ type=[ComplexType|QualifiedName];
ValueRef:
MessageNotation | SimpleRef;
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/ModelFinder.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/ModelFinder.java
index 8e70812..23e3b14 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/ModelFinder.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/ModelFinder.java
@@ -66,7 +66,7 @@
* @return the message type of the given property or {@code null} if the type of the given property is not message.
*/
public Message messageTypeOf(Property p) {
- Type type = typeOf(p);
+ ComplexType type = typeOf(p);
return (type instanceof Message) ? (Message) type : null;
}
@@ -76,7 +76,7 @@
* @return the enum type of the given property or {@code null} if the type of the given property is not enum.
*/
public Enum enumTypeOf(Property p) {
- Type type = typeOf(p);
+ ComplexType type = typeOf(p);
return (type instanceof Enum) ? (Enum) type : null;
}
@@ -85,7 +85,7 @@
* @param p the given property.
* @return the type of the given property.
*/
- public Type typeOf(Property p) {
+ public ComplexType typeOf(Property p) {
AbstractTypeRef r = p.getType();
if (!(r instanceof TypeRef)) return null;
return ((TypeRef) r).getType();
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/Properties.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/Properties.java
index e31414c..6988d7b 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/Properties.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/model/util/Properties.java
@@ -87,7 +87,7 @@
AbstractTypeRef r = p.getType();
if (r instanceof ScalarTypeRef) return ((ScalarTypeRef) r).getScalar().getName();
if (r instanceof TypeRef) {
- Type type = ((TypeRef) r).getType();
+ ComplexType type = ((TypeRef) r).getType();
return type == null ? null : type.getName();
}
return r.toString();
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtoDescriptor.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtoDescriptor.java
index d9bfab7..0620b88 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtoDescriptor.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtoDescriptor.java
@@ -51,7 +51,7 @@
}
}
- private final List<Type> allTypes = new ArrayList<Type>();
+ private final List<ComplexType> allTypes = new ArrayList<ComplexType>();
private final Map<OptionType, Map<String, Property>> optionsByType = new HashMap<OptionType, Map<String, Property>>();
private final Map<String, Enum> enumsByName = new HashMap<String, Enum>();
@@ -98,8 +98,8 @@
}
private void initContents() {
- allTypes.addAll(getAllContentsOfType(root, Type.class));
- for (Type t : allTypes) {
+ allTypes.addAll(getAllContentsOfType(root, ComplexType.class));
+ for (ComplexType t : allTypes) {
if (!(t instanceof Message)) continue;
Message m = (Message) t;
OptionType type = OPTION_DEFINITION_BY_NAME.get(m.getName());
@@ -175,7 +175,7 @@
* Returns all types in descriptor.proto.
* @return all types in descriptor.proto.
*/
- public List<Type> allTypes() {
+ public List<ComplexType> allTypes() {
return unmodifiableList(allTypes);
}
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 ea7237f..2a6310c 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
@@ -57,7 +57,7 @@
}
@Override public Collection<IEObjectDescription> findTypeScope(EObject o) {
- return astWalker.traverseAst(o, typeScopeFinder, Type.class);
+ return astWalker.traverseAst(o, typeScopeFinder, ComplexType.class);
}
@SuppressWarnings("unused")
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java
index 8a5c447..001979a 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java
@@ -33,7 +33,7 @@
@Override public Collection<IEObjectDescription> fromProtoDescriptor(Import anImport, Object criteria) {
Set<IEObjectDescription> descriptions = new HashSet<IEObjectDescription>();
ProtoDescriptor descriptor = descriptorProvider.descriptor(anImport.getImportURI());
- for (Type type : descriptor.allTypes()) {
+ for (ComplexType type : descriptor.allTypes()) {
if (!isInstance(type, criteria)) continue;
descriptions.addAll(qualifiedNamesDescriptions.qualifiedNames(type));
}