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

On 9 October 2014 at 00:00 Oskar van Rest commented:

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 in

entity User {
  homepage : URL
}

has the one-character offset problem, but URL in

entity User {
  homepage : m1 URL
}

does not.


On 9 October 2014 at 01:43 Oskar van Rest commented:

Also, the issue occurs when resolving namespaces in NaBL or sorts in SDF3.


On 9 October 2014 at 09:05 Gabriël Konat commented:

Is it always off in the same direction, and by the same amount?


On 9 October 2014 at 17:47 Oskar van Rest commented:

Yes, it doesn’t occur for every name, but if it occurs, it is always one character off and always in the same direction.


On 9 October 2014 at 17:52 Oskar van Rest commented:

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