Xtext Hover Documentation [message #1822037] |
Wed, 26 February 2020 04:31  |
Eclipse User |
|
|
|
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?
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.13528 seconds