Open JensN4 opened 10 years ago
Actually, I have written a full solution to that problem and I could provide the code.Unfortunately I cannot attach anything here.
It consists of an XtextOffsetAdapter subclass, adapting a "EObjectCoveringRegionProvider", which almost works like a MatchingOffsetProvider except that it takes the region into account (and thus traverses the node tree upwards in order to find a node which covers the whole region.
Moritz, if you're interested in that, just sent me an email.
Hi Jens,
sure, can you email me the files? moritz at eysholdt dot de
In some cases I want to write an Xpect test for a AST element identified by an OFFSET parameter. E.g.,
// XPECT mytest at 'location in my code' --> ... location in my code
However, the current implementation of the OFFSET parameter (provider) only takes the offset into account. That is, in the example above, the two tests
// XPECT mytest at 'location in my code' --> ... and // XPECT mytest at 'location' --> ...
will test the same object. It would be useful to take the length of the offset parameter into account as well, in order to be able to distinguish between these two cases. This would makes these tests much more useable, e.g., in case of expressions.