Revert "Updates to 1.5.5"
This reverts commit a1cb14b2cd31c3b9cae670469249660a58118989.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue185_CustomOptionsShouldAllowEmptyBracesAsValue_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue185_CustomOptionsShouldAllowEmptyBracesAsValue_Test.java
index bb82dcf..cebe45c 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue185_CustomOptionsShouldAllowEmptyBracesAsValue_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue185_CustomOptionsShouldAllowEmptyBracesAsValue_Test.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.bugs;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
import static com.google.eclipse.protobuf.junit.core.IntegrationTestModule.integrationTestModule;
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
@@ -17,9 +17,7 @@
import org.junit.Test;
import com.google.eclipse.protobuf.junit.core.XtextRule;
-import com.google.eclipse.protobuf.protobuf.ComplexValue;
import com.google.eclipse.protobuf.protobuf.CustomFieldOption;
-import com.google.eclipse.protobuf.protobuf.Value;
/**
* Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=185">Issue 185</a>.
@@ -49,8 +47,6 @@
// }
@Test public void should_allow_empty_braces_as_value() {
CustomFieldOption option = xtext.find("fileopt", ")", CustomFieldOption.class);
- Value value = option.getValue();
- ComplexValue complexValue = value instanceof ComplexValue ? (ComplexValue) value : null;
- assertTrue(complexValue != null && complexValue.getFields().isEmpty());
+ assertNull(option.getValue());
}
}
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/SupportCurlyAndAngleBracketsForComplexValues.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/SupportCurlyAndAngleBracketsForComplexValues.java
deleted file mode 100644
index 8f4e387..0000000
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/SupportCurlyAndAngleBracketsForComplexValues.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2013 Google Inc.
- *
- * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package com.google.eclipse.protobuf.bugs;
-
-import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
-import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
-import static org.junit.Assert.assertTrue;
-
-import com.google.eclipse.protobuf.junit.core.XtextRule;
-import com.google.eclipse.protobuf.validation.ProtobufJavaValidator;
-import com.google.inject.Inject;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.junit.Rule;
-import org.junit.Test;
-
-/**
- * Test that complex values can be enclosed in {...} or <...>
- */
-public class SupportCurlyAndAngleBracketsForComplexValues {
- @Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
-
- @Inject private ProtobufJavaValidator validator;
-
- // syntax = "proto2";
- //
- // package test;
- //
- // message AttributeOptions {
- // message CommonAttributes {
- // optional bool boolValue = 1;
- // optional int32 intValue = 2;
- // }
- //
- // optional group MainAttribute = 2 {
- // optional CommonAttributes attrs = 5;
- // }
- //
- // optional group ExtraAttribute = 6 {
- // optional CommonAttributes attrs = 7;
- // }
- //
- // optional int32 value = 8;
- // }
- //
- // extend google.protobuf.MessageOptions {
- // optional AttributeOptions main_options = 16662875;
- // optional AttributeOptions.CommonAttributes common_options = 16662876;
- // }
- //
- // message TestMessage {
- // option (main_options) = {
- // value: 10,
- //
- // MainAttribute <
- // attrs {
- // boolValue: false
- // }
- // >
- //
- // ExtraAttribute {
- // attrs {
- // boolValue: false
- // }
- // }
- // };
- //
- // option (.test.common_options) = {
- // intValue: 3
- // };
- // }
- @Test public void should_allow_curly_and_angle_brackets_in_complex_value() {
- boolean isValid = validator.validate(xtext.root(), new BasicDiagnostic(), null);
- assertTrue(isValid);
- }
-}
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/SupportTripleQuotes.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/SupportTripleQuotes.java
deleted file mode 100644
index ee420c1..0000000
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/SupportTripleQuotes.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2013 Google Inc.
- *
- * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package com.google.eclipse.protobuf.bugs;
-
-import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
-import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
-import static org.junit.Assert.assertTrue;
-
-import com.google.eclipse.protobuf.junit.core.XtextRule;
-import com.google.eclipse.protobuf.validation.ProtobufJavaValidator;
-import com.google.inject.Inject;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.junit.Rule;
-import org.junit.Test;
-
-/**
- * Test the parser correctly handles """...""" template strings
- */
-public class SupportTripleQuotes {
- @Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
-
- @Inject private ProtobufJavaValidator validator;
-
- // syntax = "proto2";
- //
- // package test;
- //
- // extend google.protobuf.MessageOptions {
- // optional string value = 16662875;
- // }
- //
- // message TestMessage {
- // option (value) = """test""";
- // }
- @Test public void should_allow_template_quotes() {
- boolean isValid = validator.validate(xtext.root(), new BasicDiagnostic(), null);
- assertTrue(isValid);
- }
-}
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/b10744621_AllowSemicolonAfterOptionValue_Test.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/b10744621_AllowSemicolonAfterOptionValue_Test.java
deleted file mode 100644
index 0f6994c..0000000
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/b10744621_AllowSemicolonAfterOptionValue_Test.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013 Google Inc.
- *
- * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package com.google.eclipse.protobuf.bugs;
-
-import static org.junit.Assert.assertTrue;
-
-import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
-import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.junit.Rule;
-import org.junit.Test;
-
-import com.google.eclipse.protobuf.junit.core.XtextRule;
-import com.google.eclipse.protobuf.validation.ProtobufJavaValidator;
-import com.google.inject.Inject;
-
-/**
- * Tests fix for b/10744621.
- */
-public class b10744621_AllowSemicolonAfterOptionValue_Test {
- @Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
-
- @Inject private ProtobufJavaValidator validator;
-
- // syntax = "proto2";
- //
- // package abc;
- //
- // message TestValues {
- // optional string value1 = 1;
- // optional string value2 = 2;
- // }
- //
- // extend google.protobuf.MessageOptions {
- // optional TestValues test_values = 42180343;
- // }
- //
- // message TestMessage {
- // option (test_values) = {
- // value1: "Value 1";
- // value2: "Value 2"
- // };
- // }
- @Test public void should_allow_semicolon_in_complex_value() {
- boolean isValid = validator.validate(xtext.root(), new BasicDiagnostic(), null);
- assertTrue(isValid);
- }
-}
diff --git a/com.google.eclipse.protobuf.ui/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.ui/META-INF/MANIFEST.MF
index 7f042ad..df7482b 100644
--- a/com.google.eclipse.protobuf.ui/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.5.5.qualifier
+Bundle-Version: 1.5.3.qualifier
Bundle-Activator: com.google.eclipse.protobuf.ui.internal.ProtobufActivator
Bundle-SymbolicName: com.google.eclipse.protobuf.ui; singleton:=true
Bundle-ActivationPolicy: lazy
@@ -31,4 +31,3 @@
com.google.eclipse.protobuf.ui.preferences.compiler,
com.google.eclipse.protobuf.ui.util,
com.google.eclipse.protobuf.ui.quickfix
-Import-Package: org.apache.log4j
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/semicolon/SmartSemicolonHandler.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/semicolon/SmartSemicolonHandler.java
index 5c21247..f3d607a 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/semicolon/SmartSemicolonHandler.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/semicolon/SmartSemicolonHandler.java
@@ -8,11 +8,32 @@
*/
package com.google.eclipse.protobuf.ui.commands.semicolon;
-import static com.google.eclipse.protobuf.protobuf.ProtobufPackage.Literals.LITERAL__INDEX;
import static java.util.regex.Pattern.compile;
+
import static org.eclipse.xtext.util.Strings.isEmpty;
-import com.google.common.collect.Lists;
+import static com.google.eclipse.protobuf.protobuf.ProtobufPackage.Literals.LITERAL__INDEX;
+import static com.google.eclipse.protobuf.protobuf.ProtobufPackage.Literals.MESSAGE_FIELD__INDEX;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.xtext.nodemodel.INode;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.editor.XtextEditor;
+import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory;
+import org.eclipse.xtext.ui.editor.model.IXtextDocument;
+import org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreAccess;
+import org.eclipse.xtext.util.Pair;
+import org.eclipse.xtext.util.concurrent.IUnitOfWork;
+
import com.google.eclipse.protobuf.grammar.CommonKeyword;
import com.google.eclipse.protobuf.model.util.INodes;
import com.google.eclipse.protobuf.model.util.IndexedElements;
@@ -28,31 +49,12 @@
import com.google.eclipse.protobuf.ui.preferences.editor.numerictag.NumericTagPreferences;
import com.google.inject.Inject;
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.xtext.nodemodel.INode;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.ui.editor.XtextEditor;
-import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;
-import org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory;
-import org.eclipse.xtext.ui.editor.model.IXtextDocument;
-import org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreAccess;
-import org.eclipse.xtext.util.Pair;
-import org.eclipse.xtext.util.Tuples;
-import org.eclipse.xtext.util.concurrent.IUnitOfWork;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
/**
* Inserts a semicolon at the end of a line, regardless of the current position of the caret in the editor. If the line
* of code being edited is a field or enum literal and if it does not have an index yet, this handler will insert an
* index with a proper value as well.
+ *
+ * @author alruiz@google.com (Alex Ruiz)
*/
public class SmartSemicolonHandler extends SmartInsertHandler {
private static final Pattern NUMBERS_PATTERN = compile("[\\d]+");
@@ -88,15 +90,8 @@
private void insertContent(final XtextEditor editor, final StyledTextAccess styledTextAccess) {
final AtomicBoolean shouldInsertSemicolon = new AtomicBoolean(true);
final IXtextDocument document = editor.getDocument();
- final List<Pair<EObject, Long>> commentsToUpdate = Lists.newLinkedList();
-
document.readOnly(NULL_UNIT_OF_WORK); // wait for reconciler to finish its work.
try {
- /*
- * Textual and semantic updates cannot be done in the same IUnitOfWork (throws an
- * IllegalStateException), so index updates (semantic) are done first and tracked in the
- * commentsToUpdate list, then a 2nd IUnitOfWork processes the comment updates (textual).
- */
document.modify(new IUnitOfWork.Void<XtextResource>() {
@Override public void process(XtextResource resource) {
Protobuf root = resources.rootOf(resource);
@@ -119,7 +114,7 @@
if (shouldCalculateIndex(literal, LITERAL__INDEX)) {
long index = literals.calculateNewIndexOf(literal);
literal.setIndex(index);
- commentsToUpdate.add(Tuples.create(model, index));
+ updateIndexInCommentOfParent(literal, index, document);
shouldInsertSemicolon.set(false);
}
}
@@ -128,23 +123,13 @@
if (shouldCalculateIndex(field)) {
long index = indexedElements.calculateNewIndexFor(field);
field.setIndex(index);
- commentsToUpdate.add(Tuples.create(model, index));
+ updateIndexInCommentOfParent(field, index, document);
shouldInsertSemicolon.set(false);
}
}
}
}
});
-
- if (!commentsToUpdate.isEmpty()) {
- document.modify(new IUnitOfWork.Void<XtextResource>() {
- @Override public void process(XtextResource resource) {
- for (Pair<EObject, Long> updateInfo : commentsToUpdate) {
- updateIndexInCommentOfParent(updateInfo.getFirst(), updateInfo.getSecond(), document);
- }
- }
- });
- }
} catch (Throwable t) {
shouldInsertSemicolon.set(true);
logger.error("Unable to generate tag number", t);
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/parser/PreferenceDrivenProtobufParser.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/parser/PreferenceDrivenProtobufParser.java
index 345e829..6238844 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/parser/PreferenceDrivenProtobufParser.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/parser/PreferenceDrivenProtobufParser.java
@@ -44,6 +44,6 @@
return root == null || root.getSyntax() == null;
}
- return rootObj == null;
+ return false;
}
}
diff --git a/com.google.eclipse.protobuf/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf/META-INF/MANIFEST.MF
index c87bed9..7d8fc0f 100644
--- a/com.google.eclipse.protobuf/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
Eclipse-ExtensibleAPI: true
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.5.5.qualifier
+Bundle-Version: 1.5.3.qualifier
Bundle-SymbolicName: com.google.eclipse.protobuf; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.antlr.runtime,
@@ -11,9 +11,6 @@
org.apache.log4j,
org.eclipse.core.resources,
org.eclipse.core.runtime,
- org.eclipse.emf.ecore,
- org.eclipse.emf.common,
- org.eclipse.emf.mwe2.launch;resolution:=optional,
org.eclipse.xtext,
org.eclipse.xtext.generator;resolution:=optional,
org.eclipse.xtext.util
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 dddd42f..eb022ea 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
@@ -211,20 +211,24 @@
// { foo: 1, bar: 2 }
ComplexValueCurlyBracket:
- '{' {ComplexValueCurlyBracket} (fields+=ValueField (',')?)* '}';
+ '{'
+ fields+=ValueField ((',')? fields+=ValueField)* (',')?
+ '}';
// < foo: 1, bar: 2 >
ComplexValueAngleBracket:
- '<' {ComplexValueAngleBracket} (fields+=ValueField (',')?)* '>';
+ '<'
+ fields+=ValueField ((',')? fields+=ValueField)* (',')?
+ '>';
ValueField:
SimpleValueField | ComplexValueField;
SimpleValueField:
- name=FieldName ':' value=SimpleValueLink ';'?;
+ name=FieldName ':' value=SimpleValueLink;
ComplexValueField:
- name=FieldName ':'? values=ComplexValue ';'?;
+ name=FieldName ':'? values=ComplexValue;
FieldName:
NormalFieldName | ExtensionFieldName;
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ModelElementFinder.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ModelElementFinder.java
index 7ff86e6..e121a84 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ModelElementFinder.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ModelElementFinder.java
@@ -8,12 +8,25 @@
*/
package com.google.eclipse.protobuf.scoping;
-import static com.google.common.collect.Sets.newHashSet;
import static java.util.Collections.emptyList;
import static java.util.Collections.emptySet;
import static java.util.Collections.unmodifiableSet;
+
import static org.eclipse.emf.ecore.util.EcoreUtil.getAllContents;
+import static com.google.common.collect.Sets.newHashSet;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.xtext.resource.IEObjectDescription;
+
import com.google.eclipse.protobuf.model.util.Imports;
import com.google.eclipse.protobuf.model.util.ModelObjects;
import com.google.eclipse.protobuf.model.util.Packages;
@@ -26,25 +39,10 @@
import com.google.eclipse.protobuf.protobuf.Protobuf;
import com.google.eclipse.protobuf.resource.ResourceSets;
import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.xtext.resource.IEObjectDescription;
-import org.eclipse.xtext.util.IResourceScopeCache;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-@Singleton
class ModelElementFinder {
@Inject private Imports imports;
@Inject private ModelObjects modelObjects;
@@ -52,67 +50,7 @@
@Inject private Protobufs protobufs;
@Inject private Resources resources;
@Inject private ResourceSets resourceSets;
-
- @Inject private IResourceScopeCache cache;
- private class GetLocal<T> implements Provider<Collection<IEObjectDescription>> {
- private final EObject start;
- private final FinderStrategy<T> strategy;
- private final T criteria;
-
- public GetLocal(EObject start, FinderStrategy<T> strategy, T criteria) {
- this.start = start;
- this.strategy = strategy;
- this.criteria = criteria;
- }
-
- @Override
- public Collection<IEObjectDescription> get() {
- UniqueDescriptions descriptions = new UniqueDescriptions();
- EObject current = start.eContainer();
- while (current != null) {
- descriptions.addAll(local(current, strategy, criteria, 0));
- current = current.eContainer();
- }
- return descriptions.values();
- }
- }
-
- private class GetImports<T> implements Provider<Set<IEObjectDescription>> {
- private final Package fromImporter;
- private final Resource imported;
- private final FinderStrategy<T> strategy;
- private final T criteria;
-
- public GetImports(Package fromImporter, Resource imported, FinderStrategy<T> strategy, T criteria) {
- this.fromImporter = fromImporter;
- this.imported = imported;
- this.strategy = strategy;
- this.criteria = criteria;
- }
-
- @Override
- public Set<IEObjectDescription> get() {
- Set<IEObjectDescription> descriptions = newHashSet();
-
- Protobuf rootOfImported = resources.rootOf(imported);
- if (!protobufs.isProto2(rootOfImported)) {
- return descriptions;
- }
- if (rootOfImported != null) {
- descriptions.addAll(publicImported(rootOfImported, strategy, criteria));
- if (arePackagesRelated(fromImporter, rootOfImported)) {
- descriptions.addAll(local(rootOfImported, strategy, criteria, 0));
- return descriptions;
- }
- Package packageOfImported = modelObjects.packageOf(rootOfImported);
- descriptions.addAll(imported(fromImporter, packageOfImported, imported, strategy, criteria));
- }
-
- return descriptions;
- }
- }
-
<T> Collection<IEObjectDescription> find(EObject start, FinderStrategy<T> strategy, T criteria) {
Set<IEObjectDescription> descriptions = newHashSet();
descriptions.addAll(local(start, strategy, criteria));
@@ -122,7 +60,13 @@
}
private <T> Collection<IEObjectDescription> local(EObject start, FinderStrategy<T> strategy, T criteria) {
- return cache.get(start, start.eResource(), new GetLocal<T>(start, strategy, criteria));
+ UniqueDescriptions descriptions = new UniqueDescriptions();
+ EObject current = start.eContainer();
+ while (current != null) {
+ descriptions.addAll(local(current, strategy, criteria, 0));
+ current = current.eContainer();
+ }
+ return descriptions.values();
}
<T> Collection<IEObjectDescription> find(Protobuf start, FinderStrategy<T> strategy, T criteria) {
@@ -168,9 +112,19 @@
if (imported == null) {
continue;
}
-
- Set<IEObjectDescription> cached = cache.get(criteria, imported, new GetImports<T>(fromImporter, imported, strategy, criteria));
- descriptions.addAll(cached);
+ Protobuf rootOfImported = resources.rootOf(imported);
+ if (!protobufs.isProto2(rootOfImported)) {
+ continue;
+ }
+ if (rootOfImported != null) {
+ descriptions.addAll(publicImported(rootOfImported, strategy, criteria));
+ if (arePackagesRelated(fromImporter, rootOfImported)) {
+ descriptions.addAll(local(rootOfImported, strategy, criteria, 0));
+ continue;
+ }
+ Package packageOfImported = modelObjects.packageOf(rootOfImported);
+ descriptions.addAll(imported(fromImporter, packageOfImported, imported, strategy, criteria));
+ }
}
return descriptions;
}
diff --git a/update-site/artifacts.jar b/update-site/artifacts.jar
index 5369f31..e8eb1d9 100644
--- a/update-site/artifacts.jar
+++ b/update-site/artifacts.jar
Binary files differ
diff --git a/update-site/content.jar b/update-site/content.jar
index 5b75215..9f40b7d 100644
--- a/update-site/content.jar
+++ b/update-site/content.jar
Binary files differ
diff --git a/update-site/features/com.google.eclipse.protobuf_1.5.5.201309031601.jar b/update-site/features/com.google.eclipse.protobuf_1.5.5.201309031601.jar
deleted file mode 100644
index 1b854c9..0000000
--- a/update-site/features/com.google.eclipse.protobuf_1.5.5.201309031601.jar
+++ /dev/null
Binary files differ
diff --git a/update-site/plugins/com.google.eclipse.protobuf.internal_1.5.5.201309031601.jar b/update-site/plugins/com.google.eclipse.protobuf.internal_1.5.5.201309031601.jar
deleted file mode 100644
index d208791..0000000
--- a/update-site/plugins/com.google.eclipse.protobuf.internal_1.5.5.201309031601.jar
+++ /dev/null
Binary files differ
diff --git a/update-site/plugins/com.google.eclipse.protobuf.ui_1.5.5.201309031601.jar b/update-site/plugins/com.google.eclipse.protobuf.ui_1.5.5.201309031601.jar
deleted file mode 100644
index 657acf0..0000000
--- a/update-site/plugins/com.google.eclipse.protobuf.ui_1.5.5.201309031601.jar
+++ /dev/null
Binary files differ
diff --git a/update-site/plugins/com.google.eclipse.protobuf_1.5.5.201309031601.jar b/update-site/plugins/com.google.eclipse.protobuf_1.5.5.201309031601.jar
deleted file mode 100644
index 2a21541..0000000
--- a/update-site/plugins/com.google.eclipse.protobuf_1.5.5.201309031601.jar
+++ /dev/null
Binary files differ
diff --git a/update-site/site.xml b/update-site/site.xml
index 5fb91b2..e1fa512 100644
--- a/update-site/site.xml
+++ b/update-site/site.xml
@@ -3,7 +3,10 @@
<description name="protobuf-dt" url="http://protobuf-dt.googlecode.com/git/update-site">
Update site for protobuf-dt, an Eclipse-based Development Environment for Protocol Buffers.
</description>
- <feature url="features/com.google.eclipse.protobuf_1.5.5.201309031601.jar" id="com.google.eclipse.protobuf" version="1.5.5.201309031601">
+ <feature url="features/com.google.eclipse.protobuf_1.4.1.201306170929.jar" id="com.google.eclipse.protobuf" version="1.4.1.201306170929">
+ <category name="google"/>
+ </feature>
+ <feature url="features/com.google.eclipse.protobuf_1.4.3.201307151341.jar" id="com.google.eclipse.protobuf" version="1.4.3.201307151341">
<category name="google"/>
</feature>
<category-def name="google" label="Google Inc."/>