Skip to main content



      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 04:35 Go to next message
Eclipse UserFriend
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 03:30 Go to previous messageGo to next message
Eclipse UserFriend
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 07:21 Go to previous messageGo to next message
Eclipse UserFriend
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 08:01 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805511 is a reply to message #1805504] Tue, 16 April 2019 09:41 Go to previous messageGo to next message
Eclipse UserFriend
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 09:59 Go to previous messageGo to next message
Eclipse UserFriend
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.

[Updated on: Tue, 16 April 2019 10:00] by Moderator

Re: Getting IEObjectDescription from JvmTypeRefence without proxy resolution [message #1805515 is a reply to message #1805512] Tue, 16 April 2019 10:31 Go to previous message
Eclipse UserFriend
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: Wed Mar 26 00:59:10 EDT 2025

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

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

Back to the top