The origin of a reference is one character off
If you have a one-character name (i.e. “a”) and you want to resolve a use to it’s definition using cntl/cmnd + mouse click, then you are required to hover over the character at the right of the name, instead of over the name itself. It seems like somewhere, the origin is one character off.
Note: similarly, for longer names, you cannot resolve a name by hovering over the first character.
Submitted by Oskar van Rest on 16 September 2014 at 00:44
Issue Log
The issue doesn’t always occur. Only certain patterns in your grammar introduce the problem, but I cannot recognize the pattern.
Here is a minimal example though:
Create a new Entity project and replace the following line in the grammar:
Property.Property = <<ID> : <Type>>
with:
Property.Property = <<ID> : <TypeWithModifier>> TypeWithModifier.TypeWithModifier = <<Modifier?><Type>> Modifier.M1 = <m1>
Now,
URL
inentity User { homepage : URL }
has the one-character offset problem, but
URL
inentity User { homepage : m1 URL }
does not.
Also, the issue occurs when resolving namespaces in NaBL or sorts in SDF3.
Is it always off in the same direction, and by the same amount?
Yes, it doesn’t occur for every name, but if it occurs, it is always one character off and always in the same direction.
btw. when I print the
<origin-text>
of the reference, it prints the correct (i.e. full) name, so it’s not a problem with origin tracking. But somehow it still passes the wrong offset to Eclipse.
Log in to post comments