Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtend editor does not see methods generated from IncQuery patterns until restart
Xtend editor does not see methods generated from IncQuery patterns until restart [message #1401209] Tue, 15 July 2014 09:35 Go to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 359
Registered: July 2015
Senior Member
Hi all,

When trying to use pattern by IncQuery and Xtext together, we have found a strange issue related to accessing the IncQuery-generated code from an Xtend file.

From an EMF-IncQuery pattern, several classes and a method is generated using the model inferrer. When accessing classes/methods already existing when the Xtend editor is opened, everything works as expected.

However, if a new pattern is created, the Xtend editor does not see the new methods until the Xtend editor is restarted; on the other hand, the newly generated classes are available from start.

Does anyone have any idea what might we be doing wrong? I have no idea what to check with regards to our generator...

Thanks,
Zoltán
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1402891 is a reply to message #1401209] Fri, 18 July 2014 08:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13267
Registered: July 2009
Senior Member
Hello Zoltán,

i actually cannot reproduce that using the domain model example.
can you share a little example reproduing that.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1402898 is a reply to message #1402891] Fri, 18 July 2014 09:33 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 359
Registered: July 2015
Senior Member
Hi Christian,

sorry for not being clear; I am reasonably sure I did something unexpected for Xtext in EMF-IncQuery, but I have no idea what it is. Regardless, I have created an example IncQuery project that shows this issue (it requires the latest EMF-IncQuery 0.8 release, available from http://eclipse.org/incquery).

If you uncomment the second pattern from the eiq file, while the xtend editor is already open, the queryGroup.test2 call cannot be created as it does not see the new method from the queryGroup file. However, the query specification generated from the same new pattern is available (see the second commented out line in the Xtend file).

Again, I am mostly interested in some idea what might be going wrong - I really have no idea what might have I been missing.

Thanks for your help,
Zoltán
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1402902 is a reply to message #1402898] Fri, 18 July 2014 09:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13267
Registered: July 2009
Senior Member
where can i find the mentioned inferrer in the incquery code?
it is working with the domain model example so to analyze this one needs to know what is done in the inferrer.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1402903 is a reply to message #1402902] Fri, 18 July 2014 09:44 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 359
Registered: July 2015
Senior Member
Hi,

the model inferrer is implemented in the patternlanguage.emf project (see http://git.eclipse.org/c/incquery/org.eclipse.incquery.git/tree/plugins/org.eclipse.incquery.patternlanguage.emf/src/org/eclipse/incquery/patternlanguage/emf/jvmmodel). The classes (that are found) are initialized in the EMFPatternLanguageJvmModelInferrer class; while the methods not found are part of the PatternGroupClassInferrer class (specifically the inferSpecificationGetter and inferMatcherGetter methods).

Thanks again,
Zoltán
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1402911 is a reply to message #1402903] Fri, 18 July 2014 10:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13267
Registered: July 2009
Senior Member
HI,

where do i get CustomizedEMFGeneratorFragment from?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1402922 is a reply to message #1402911] Fri, 18 July 2014 11:29 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 359
Registered: July 2015
Senior Member
Hi,

that fragment is contributed by the patterlanguage.generator project (http://git.eclipse.org/c/incquery/org.eclipse.incquery.git/tree/plugins/org.eclipse.incquery.patternlanguage.generator/src/org/eclipse/incquery/patternlanguage/generator/CustomizedEMFGeneratorFragment.java).

However, I have checked back to that, and it seems, it is not required anymore - I have checked it now, and it is basically the same as the built-in EMFGeneratorFragment (from Xtext 2.4.3 at least).
Zoltán
Re: Xtend editor does not see methods generated from IncQuery patterns until restart [message #1403228 is a reply to message #1402922] Tue, 22 July 2014 14:10 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 359
Registered: July 2015
Senior Member
Hi,

after some experiments it seems I have found the culprit for our issue. The methods not found were not inferred from the pattern definition itself but from the container of the pattern definitions. By changing the inferrer to associate the methods with the patterns, the issues went away.

Thanks for your help again,
Zoltán
Previous Topic:Xtend throwing error on override method
Next Topic:Reference scope
Goto Forum:
  


Current Time: Tue Dec 10 08:23:34 GMT 2019

Powered by FUDForum. Page generated in 0.01946 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top