|
|
|
Re: [Xtext 2.1] What about scoping and typesystem? [message #753738 is a reply to message #753702] |
Fri, 28 October 2011 14:43 |
Ingo Meyer Messages: 162 Registered: July 2009 |
Senior Member |
|
|
I'm getting some "Type computation is not implemented for..." errors cause Xbase is not using my own TypeProvider.
In the stacktrace you see it is not used, eventhough is binded:
java.lang.IllegalArgumentException: Type computation is not implemented for com.xxx.impl.XDateLiteralImpl@7ee19158 (value: now)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider._type(AbstractTypeProvider.java:283)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.type(AbstractTypeProvider.java:321)
at org.eclipse.xtext.xbase.typing.XbaseTypeProvider.type(XbaseTypeProvider.java:190)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$2.doComputation(AbstractTypeProvider.java:290)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$2.doComputation(AbstractTypeProvider.java:1)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport$3.get(AbstractTypeProvider.java:623)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport$3.get(AbstractTypeProvider.java:1)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$1.get(AbstractTypeProvider.java:158)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport.getType(AbstractTypeProvider.java:620)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.doGetType(AbstractTypeProvider.java:346)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.getType(AbstractTypeProvider.java:362)
at org.eclipse.xtext.xbase.typing.XbaseTypeProvider.getArgumentTypes(XbaseTypeProvider.java:433)
at org.eclipse.xtext.xbase.typing.XbaseTypeProvider$7.getArgumentTypes(XbaseTypeProvider.java:1031)
at org.eclipse.xtext.common.types.util.LazyTypeArgumentContext.doComputeNext(LazyTypeArgumentContext.java:195)
at org.eclipse.xtext.common.types.util.LazyTypeArgumentContext.computeNext(LazyTypeArgumentContext.java:166)
at org.eclipse.xtext.common.types.util.LazyTypeArgumentContext.getLowerBound(LazyTypeArgumentContext.java:111)
at org.eclipse.xtext.xbase.linking.FeatureCallChecker._case(FeatureCallChecker.java:286)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.xtext.xbase.linking.FeatureCallChecker.checkWithoutTypes(FeatureCallChecker.java:180)
at org.eclipse.xtext.xbase.linking.BestMatchingJvmFeatureScope.getBestMatch(BestMatchingJvmFeatureScope.java:118)
at org.eclipse.xtext.xbase.linking.BestMatchingJvmFeatureScope.getSingleElement(BestMatchingJvmFeatureScope.java:78)
at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:121)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
at org.eclipse.xtext.xbase.resource.XbaseResource.access$0(XbaseResource.java:1)
at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:227)
at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:1)
at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:121)
at org.eclipse.xtext.xbase.resource.XbaseResource.getEObject(XbaseResource.java:225)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:219)
at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:203)
at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:263)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1483)
at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImpl.getFeature(XAbstractFeatureCallImpl.java:161)
at org.eclipse.xtext.xbase.ui.highlighting.XbaseHighlightingCalculator.computeFeatureCallHighlighting(XbaseHighlightingCalculator.java:147)
at org.eclipse.xtext.xbase.ui.highlighting.XbaseHighlightingCalculator.searchAndHighlightElements(XbaseHighlightingCalculator.java:114)
at org.eclipse.xtext.xbase.ui.highlighting.XbaseHighlightingCalculator.doProvideHighlightingFor(XbaseHighlightingCalculator.java:106)
at org.eclipse.xtext.xbase.ui.highlighting.XbaseHighlightingCalculator.provideHighlightingFor(XbaseHighlightingCalculator.java:86)
at org.eclipse.xtext.ui.editor.syntaxcoloring.MergingHighlightedPositionAcceptor.provideHighlightingFor(MergingHighlightedPositionAcceptor.java:51)
at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.reconcilePositions(HighlightingReconciler.java:87)
at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.modelChanged(HighlightingReconciler.java:275)
at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler$1.process(HighlightingReconciler.java:246)
at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler$1.process(HighlightingReconciler.java:1)
at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78)
at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.refresh(HighlightingReconciler.java:243)
the binding:
public Class<? extends ITypeProvider> bindITypeProvider()
{
return MyTypeProviderImpl.class;
}
The FeatureCallChecker has this line: "JvmTypeReference lowerBound = jvmFeatureDescription.getGenericTypeContext().getLowerBound(parameterType);"
which I don't understand well but it is not using any injects but just pure Xbase stuff.
Any hints on this? Do you need further infos?
Thanks a lot
Ingo
[Updated on: Sat, 29 October 2011 08:29] Report message to a moderator
|
|
|
|
|
Re: [Xtext 2.1] What about scoping and typesystem? [message #753900 is a reply to message #753835] |
Sun, 30 October 2011 12:33 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Ingo,
it's most likely the binding to the ITypeArgumentContextHelper which is
causing the confusion. It think the easiest way is to fix this is to
bind the XbaseTypeProvider class to your subtype in your runtime module.
Both the ITypeProvider and ITypeArgumentContextHelper are bound the the
XbaseTypeProvider by default. If your redefine the XbaseTypeProvider to
YourTypeProvider, both interfaces will use the same concrete
implementation class.
Hope that helps,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 29.10.11 10:36, Ingo Meyer wrote:
> Yes and in some cases it will call my method, but in others not.
> When debugging I see it is not my TypeProvider being called:
> "org.eclipse.xtext.xbase.typing.XbaseTypeProvider(org.eclipse.xtext.xbase.typing.AbstractTypeProvider)._type(org.eclipse.xtext.xbase.XExpression,
> org.eclipse.xtext.common.types.JvmTypeReference, boolean) line: 283"
> So my assumption was that there is a new binding or something other new
> in 2.1 which needs a new guice binding. When I go down the stack I see
> it will get the TypeProvider from this line:
> "org.eclipse.xtext.xbase.linking.FeatureCallChecker._case(org.eclipse.xtext.common.types.JvmOperation,
> org.eclipse.xtext.xbase.XBinaryOperation,
> org.eclipse.emf.ecore.EReference,
> org.eclipse.xtext.xbase.scoping.featurecalls.JvmFeatureDescription)
> line: 286
> "
> and I could not find any guice element in "getGenericTypeContext()". The
> TypeProvider comes from the class "JvmFeatureDescription" and I don't
> now where this is coming from.
> So is it a new 2.1 thing? Any ideas on the binding?
>
> Thanks,
> Ingo
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25522 seconds