| Summary: | Getting java.lang.AssertionError: Cyclic resolution of lazy links | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Pavel <pmatsibekker> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sven.efftinge |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
You have to be very careful when navigating through cross references in the scope provider. Cross references are resolved lazily and are based on the ScopeProvider so you can easily run into a StackOverflow situation. We catch that with the Cyclic Resolution exception to give you a more meaningful hint, that you did something wrong. What do you want to do? (In reply to comment #1) > You have to be very careful when navigating through cross references in the > scope provider. Cross references are resolved lazily and are based on the > ScopeProvider so you can easily run into a StackOverflow situation. We catch > that with the Cyclic Resolution exception to give you a more meaningful hint, > that you did something wrong. > > What do you want to do ? I'm trying to provide a language with auto-complete for something like the following: Variable varA; Variable varB; varA[prop1]=5; varA[prop2]=3; varB[prop3]=8; print VarA[prop1]; Whenever I declare varA in the brackets,I would like to have the AutoComplete provider give appropriate auto-complete proposals: That is, for varA, I should see {prop1, prop2} and for varB I should see {prop3} as an option. In my language: Var: 'Variable' name=ID ";" Prop: var=[Variable] '[' name=ID ']' ';'; I am trying to use the ScopeProvider to get the list of Var types which I put in an autocomplete cache. When auto-complete is triggered, I have the ProposalProvider access my cache for appropriate completion options. the Problem is that I can't get the value of the reference property var in Prop because of the error above You should use the proposal provider solely to find the elements. Something like the following should work: 1) Look up what variable the current Prop points to by just navigating the cross reference. 2) find all props in the model which point to that variable and collect the used names. Please use the forum for further questions. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
Build Identifier: 20110615-0604 I'm trying the fowler dsl example of Xtext 2.01 implementation. When I try to get value out of the resetEvents list in the StateMachine instance, I get a cycle resolution of lazy links error. This means that I can't access any references generated from XText java.lang.AssertionError: Cyclic resolution of lazy links : Statemachine.resetEvents->Statemachine.resetEvents at org.eclipse.xtext.linking.lazy.LazyLinkingResource.handleCyclicResolution(LazyLinkingResource.java:207) Reproducible: Always Steps to Reproduce: 1.Import Fowler dsl example form the Xtext Examples projects 2.Open the file StatemachineScopeProvider.java and override the method @Override public IScope getScope(EObject context, EReference reference) { ... } 3.add the following code in the getScope() method if(context.eClass().getInstanceClass().equals(Statemachine.class)){ Statemachine inst=(Statemachine) context; System.out.println(inst.getEvents()); System.out.println("Code:"+inst.getResetEvents().get(0).getName()); }