bblfsh / go-driver

GNU General Public License v3.0
10 stars 9 forks source link

Incorrect position for package node #25

Open smacker opened 6 years ago

smacker commented 6 years ago
screen shot 2018-08-10 at 12 54 15

the word package has 7 letters, not 1.

dennwc commented 6 years ago

It's not a bug, it's a feature :D

No, really, this is actually an emulated response that is adapted to v1 representation.

The actual response is a single File node that has start and end poiting to the start and the end of the file, and the third position pointing to the start of the package keyword inside the file. So we emulate this third position as a separate node for v1.

On the Dashboard version I was using at that time I was not able to make a node that has only a start highlighted properly, so I decided to emulate an end that is offset by a single character.

This should not be the problem for v2, so I think we can close it. Or do you have any suggestions for v1?

smacker commented 6 years ago

Dashboard should display nodes only with start position correctly. But looks like we have a bug: https://github.com/bblfsh/uast-viewer/issues/48