summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Zarnekow2011-09-29 12:12:22 (EDT)
committerEd Merks2011-09-29 12:12:22 (EDT)
commit6118e64f239b3cfccbb88e071abc3bac46162e8e (patch)
tree51264b4ff1cf999687fcb4f5000a7e67e08e8ae3
parente568d27d39bb04a1116b3e6f5777811a1f244393 (diff)
downloadorg.eclipse.emf-6118e64f239b3cfccbb88e071abc3bac46162e8e.zip
org.eclipse.emf-6118e64f239b3cfccbb88e071abc3bac46162e8e.tar.gz
org.eclipse.emf-6118e64f239b3cfccbb88e071abc3bac46162e8e.tar.bz2
Adapted to recent changes in Xtext
-rw-r--r--org.eclipse.emf.ecore.xcore.ui/src-gen/org/eclipse/emf/ecore/xcore/ui/AbstractXcoreUiModule.java5
-rw-r--r--org.eclipse.emf.ecore.xcore/src-gen/org/eclipse/emf/ecore/xcore/AbstractXcoreRuntimeModule.java10
-rw-r--r--org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/resource/XcoreResource.java7
-rw-r--r--org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/typing/XcoreTypeProvider.java11
4 files changed, 30 insertions, 3 deletions
diff --git a/org.eclipse.emf.ecore.xcore.ui/src-gen/org/eclipse/emf/ecore/xcore/ui/AbstractXcoreUiModule.java b/org.eclipse.emf.ecore.xcore.ui/src-gen/org/eclipse/emf/ecore/xcore/ui/AbstractXcoreUiModule.java
index cb5360a..24b4288 100644
--- a/org.eclipse.emf.ecore.xcore.ui/src-gen/org/eclipse/emf/ecore/xcore/ui/AbstractXcoreUiModule.java
+++ b/org.eclipse.emf.ecore.xcore.ui/src-gen/org/eclipse/emf/ecore/xcore/ui/AbstractXcoreUiModule.java
@@ -224,6 +224,11 @@ public abstract class AbstractXcoreUiModule extends DefaultUiModule {
}
// contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
+ public Class<? extends org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfiguration> bindIHighlightingConfiguration() {
+ return org.eclipse.xtext.xbase.ui.highlighting.XbaseHighlightingConfiguration.class;
+ }
+
+ // contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
public Class<? extends org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider> bindIEObjectHoverProvider() {
return org.eclipse.xtext.xbase.ui.hover.XbaseHoverProvider.class;
}
diff --git a/org.eclipse.emf.ecore.xcore/src-gen/org/eclipse/emf/ecore/xcore/AbstractXcoreRuntimeModule.java b/org.eclipse.emf.ecore.xcore/src-gen/org/eclipse/emf/ecore/xcore/AbstractXcoreRuntimeModule.java
index b4594ed..252cd57 100644
--- a/org.eclipse.emf.ecore.xcore/src-gen/org/eclipse/emf/ecore/xcore/AbstractXcoreRuntimeModule.java
+++ b/org.eclipse.emf.ecore.xcore/src-gen/org/eclipse/emf/ecore/xcore/AbstractXcoreRuntimeModule.java
@@ -215,6 +215,16 @@ public abstract class AbstractXcoreRuntimeModule extends DefaultRuntimeModule {
}
// contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
+ public org.eclipse.xtext.xtype.XtypeFactory bindXtypeFactoryToInstance() {
+ return org.eclipse.xtext.xtype.XtypeFactory.eINSTANCE;
+ }
+
+ // contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
+ public Class<? extends org.eclipse.xtext.common.types.util.TypeArgumentContextProvider> bindTypeArgumentContextProvider() {
+ return org.eclipse.xtext.xbase.typing.XbaseTypeArgumentContextProvider.class;
+ }
+
+ // contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
public Class<? extends org.eclipse.xtext.resource.ILocationInFileProvider> bindILocationInFileProvider() {
return org.eclipse.xtext.xbase.jvmmodel.JvmLocationInFileProvider.class;
}
diff --git a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/resource/XcoreResource.java b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/resource/XcoreResource.java
index 7baea4b..fefff12 100644
--- a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/resource/XcoreResource.java
+++ b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/resource/XcoreResource.java
@@ -32,7 +32,7 @@ public class XcoreResource extends XbaseResource {
public synchronized EObject getEObject(String uriFragment) {
Pair<EClass,QualifiedName> fragmentInfo = proxyConverter.decodeFragment(uriFragment);
if (fragmentInfo != null) {
- return findEObject(fragmentInfo.getFirst(), fragmentInfo.getSecond());
+ return findEObject(fragmentInfo.getFirst(), fragmentInfo.getSecond(), uriFragment);
} else {
return super.getEObject(uriFragment);
}
@@ -43,11 +43,12 @@ public class XcoreResource extends XbaseResource {
*
* TODO optimize
*/
- protected EObject findEObject(EClass clazz, QualifiedName name) {
+ protected EObject findEObject(EClass clazz, QualifiedName name, String uriFragment) {
if (clazz == TypesPackage.Literals.JVM_GENERIC_TYPE) {
IScope scope = scopeProvider.getScope(getContents().get(0), TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE);
final IEObjectDescription desc = scope.getSingleElement(name);
- return desc == null ? null : desc.getEObjectOrProxy();
+ if (desc != null && !uriFragment.equals(desc.getEObjectURI().fragment()))
+ return desc.getEObjectOrProxy();
}
TreeIterator<EObject> iterator = EcoreUtil.getAllContents(this, false);
while (iterator.hasNext()) {
diff --git a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/typing/XcoreTypeProvider.java b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/typing/XcoreTypeProvider.java
index 61a53f8..5e97ea7 100644
--- a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/typing/XcoreTypeProvider.java
+++ b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/typing/XcoreTypeProvider.java
@@ -1,5 +1,6 @@
package org.eclipse.emf.ecore.xcore.typing;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.xcore.XOperation;
import org.eclipse.emf.ecore.xcore.XcorePackage;
@@ -16,6 +17,16 @@ public class XcoreTypeProvider extends XbaseTypeProvider
@Inject
private XcoreMapper mapper;
+ @Override
+ protected JvmTypeReference expectedTypeDispatcherInvoke(EObject container, EReference reference, int index,
+ boolean rawType)
+ {
+ if (container instanceof XOperation) {
+ return _expectedType((XOperation)container, reference, index, rawType);
+ }
+ return super.expectedTypeDispatcherInvoke(container, reference, index, rawType);
+ }
+
protected JvmTypeReference _expectedType(XOperation expr, EReference reference, int index, boolean rawType)
{
if (reference == XcorePackage.Literals.XOPERATION__BODY) {