Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext Hover Documentation
Xtext Hover Documentation [message #1822037] Wed, 26 February 2020 04:31 Go to next message
Eclipse UserFriend
Hello, i have the following grammar:
	('data-dictionary' '{'
	attributes+=(Attribute)*
	'}')?
	('entity-catalog' '{'
	entities+=Entity*
	'}')?
	'}';
Attribute:
	AttributeSimpleType | AttributeEntityType 
Entity:
	(documentation=ML_DOC_COMMENT)?  
        name=ID funcName=STRING '{'
	features+=(Feature)*
'}';
Feature:
	(documentation=ML_DOC_COMMENT)? 
	(type=FeatureAttributeType | type=FeatureEntityType)
FeatureAttributeType:
	(type=[AttributeSimpleType|ID]|type=[AttributeSimpleType|GENERAL_FQN])
FeatureEntityType:
	'entity' (attribute=[AttributeEntityType|ID]|attribute=[AttributeEntityType|GENERAL_FQN]);

I have implemented the IEObjectDocumentationProvider and DefaultEObjectHoverProvider, but when i hover over a feature instead of giving me the doc. of the feature it gives me the doc of the attribute which is contained in the data-dictionary. The object that is passed to the getDocumentation method is of type Attribute. I have debugged and noticed in the EObjectAtOffsetHelper inside the resolveCrossReferencedElement method, the type of the object passed is Feature, but there is a check for the object's representation in the model instance. Since the selected Feature is present as an Attribute the returned object is the Attribute. Is there a way to get the doc of the feature instead of the attribute without having to override that method and get rid of the check?
Re: Xtext Hover Documentation [message #1822041 is a reply to message #1822037] Wed, 26 February 2020 04:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

which check are you referring to?
Re: Xtext Hover Documentation [message #1822042 is a reply to message #1822041] Wed, 26 February 2020 04:40 Go to previous messageGo to next message
Eclipse UserFriend
Hello, from the class EObjectAtOffsetHelper line 139:
 
if (!crossReference.isMany()) {
				return (EObject) referenceOwner.eGet(crossReference);

before this check the referenceOwner is of type Feature which is the desired type.
Re: Xtext Hover Documentation [message #1822044 is a reply to message #1822042] Wed, 26 February 2020 04:43 Go to previous messageGo to next message
Eclipse UserFriend
yes. its intended that we show the documentation of the thing that is referenced at the place you hover. if you dont want this
and show the contained eObjects documentation instead. then you need to customize
Re: Xtext Hover Documentation [message #1822045 is a reply to message #1822042] Wed, 26 February 2020 04:48 Go to previous messageGo to next message
Eclipse UserFriend
Is there a specific class which i could costumize?
Re: Xtext Hover Documentation [message #1822049 is a reply to message #1822045] Wed, 26 February 2020 05:19 Go to previous messageGo to next message
Eclipse UserFriend
guess the one that calls EObjectAtOffsetHelper
Re: Xtext Hover Documentation [message #1822051 is a reply to message #1822049] Wed, 26 February 2020 05:25 Go to previous message
Eclipse UserFriend
I started to make the changes , but it got tideous, and i was hoping to avoid that.
Thank you for your replies :)
Previous Topic:Xtext Hover Documentation [Duplicate - https://www.eclipse.org/forums/index.php/m/1822037/#msg_18220
Next Topic:Specify the encoding of attached source files
Goto Forum:
  


Current Time: Fri Jul 04 20:54:48 EDT 2025

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

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

Back to the top