Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting IEObjectDescription from JvmTypeRefence without proxy resolution
Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805423] Mon, 15 April 2019 08:35 Go to next message
Didier Didos is currently offline Didier DidosFriend
Messages: 14
Registered: April 2016
Junior Member
Hello,

I would like to access to Xtext Index IEObjectDescription from a JvmTypeReference without proxy resolution, in order to get its qualidied name.

I guess it's the same for any proxyfied element.

Thanks a lot.
Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805487 is a reply to message #1805423] Tue, 16 April 2019 07:30 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 687
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Usually you should be able to use the IQualifiedNameProvider for any object to get its qualified name. This should not trigger proxy resolution when properly implemented.
Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805499 is a reply to message #1805487] Tue, 16 April 2019 11:21 Go to previous messageGo to next message
Didier Didos is currently offline Didier DidosFriend
Messages: 14
Registered: April 2016
Junior Member
Thanks for you reply,

Unfortunalty, using IQualifiedNameProvider with a non resolved JvmType is give a "void" qualified name.

I'm trying to get index entry for a proxy, in order to get indexed information, but currently, I didn't found the way to achieved that.
Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805504 is a reply to message #1805499] Tue, 16 April 2019 12:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
am still not sure if i get your usecase.
can you give more context.
you may have a look what scoping/resolving does
to retrieve the name


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805511 is a reply to message #1805504] Tue, 16 April 2019 13:41 Go to previous messageGo to next message
Didier Didos is currently offline Didier DidosFriend
Messages: 14
Registered: April 2016
Junior Member
Basically, I want to get IObjectDescription from a proxy. I will explain a use case in CreateLazyUserData of the ResourceDescriptionStrategy which is, I hope, possible (because it is lazy evaluated, so whole indexing should be done).

I have a xtext model type like that:
Mapper from=JvmTypeReference to=JvmTypeReference

I'm writting my own ResourceDescriptionStrategy, and in the createUserData method, I would like to index qualified name of "from & to" JvmTypeReference in order to be able to do duplicate detection for exemple.
As recommended, I dont want to do 'mapper.from.type' to resolve JvmType contained in JvmTypeReference, but I want to get ObjectDescription in order to get qualifiedname.

Currently I'm trying with something very close to LazyLinker:

Quote:

@Inject private IScopeProvider scopeProvider
@Inject IQualifiedNameConverter qualifiedNameConverter;
@Inject IQualifiedNameProvider nameProvider;

createUserData(..) {

val fromNode = NodeModelUtils.getNode(mapper.from)
val qualifiedLinkName = qualifiedNameConverter.toQualifiedName(fromNode.text);
val scope = scopeProvider.getScope(mapper,TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE);
val eObjectDescription = scope.getSingleElement(qualifiedLinkName);

....
}

but eObjectDescription is null, when imports are in the game its seems.

Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805512 is a reply to message #1805511] Tue, 16 April 2019 13:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
i have no idea how to properly doing that without mimiking what scoping does.
i also have no idea why imports play a role.
scoping should respect that.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 16 April 2019 14:00]

Report message to a moderator

Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805515 is a reply to message #1805512] Tue, 16 April 2019 14:31 Go to previous message
Didier Didos is currently offline Didier DidosFriend
Messages: 14
Registered: April 2016
Junior Member
ok thank you for your answer. I gonna try to go further.
Previous Topic:parsing issue affecting content assist
Next Topic:Xtend 2.14 and Eclipse 2019-03
Goto Forum:
  


Current Time: Sun Aug 25 11:02:07 GMT 2019

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

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

Back to the top