Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » EObject from global scope has less information(question)
EObject from global scope has less information [message #684493] Wed, 15 June 2011 16:55 Go to next message
Dyson Mising name is currently offline Dyson Mising nameFriend
Messages: 5
Registered: June 2011
Location: UK
Junior Member
Hi

I am working on a DSL which has cross-references within files and between different files.

E.g. in file A:
PE x:
END


in file B
RPM r:
   x i(); // x is a cross reference to PE name 'x'
END


I have been trying to filter the contents of a scope in a ProposalProvider but notice that the information in the EObject is incomplete when the object is from the global scope (i.e. a different file). I am using the default scope provider.

I was working in xtext 1.0 but have now also tried xtext 2.0 which has the new feature of providing a pop-up when you hover over a proposal. I see this pop-up when hovering over a local item from the content proposal list but not when hovering over global item (from a different file).

Is this intended? Is there a way to include more information in the resource description?

Thanks for any guidance.

- Dyson
Re: EObject from global scope has less information [message #684536 is a reply to message #684493] Wed, 15 June 2011 18:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

you could come up with an own impl of org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy
e.g. through subclassing DefaultResourceDescriptionStrategy
and add the additional information to the EObjectDescripions userData.
from the filter method you just ask the EObjectDescripion for the userdata
=> It doesn't play a role the EObjectDescripion may only contain a proxy to the eobject.

Btw. the hover doesn't work on proxys too. this is you get it only for non proxy eobjects. this seems to be indended.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 15 June 2011 19:18]

Report message to a moderator

Re: EObject from global scope has less information [message #684573 is a reply to message #684536] Wed, 15 June 2011 20:52 Go to previous message
Dyson Mising name is currently offline Dyson Mising nameFriend
Messages: 5
Registered: June 2011
Location: UK
Junior Member
Thanks Christian. I had wondered if the userdata was the way to go. Xtext is certainly a quick way to get an editor from a grammar but, for me so far, customising the behaviour is proving to be a big learning curve.

- Dyson
Previous Topic:hidden(WS) - but not always
Next Topic:[Xtend2] Difference between val and var ?
Goto Forum:
  


Current Time: Fri Apr 26 20:16:28 GMT 2024

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

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

Back to the top