fuhrmanator / FamixTypeScriptImporter

MIT License
2 stars 1 forks source link

sourceText is off by 3 (?) for Variable #23

Closed fuhrmanator closed 1 year ago

fuhrmanator commented 1 year ago

In the Screenshot, the variable is currentSquareIndex but its sourceText shows rrentSquareIndex ...

This is consistently wrong for the variables card, etc. but is not wrong for app = express() the first one that's actually an import.

image

image

fuhrmanator commented 1 year ago

It seems like a bug, at least partially, in ts-morph. I created https://github.com/dsherret/ts-morph/issues/1454

fuhrmanator commented 1 year ago

This bug is due to how JavaScript handles strings outside of the BMP - Pharo (apparently) handles it properly. This means there's a difference in text offsets (when pointing to parts of a file with source code).

https://stackoverflow.com/questions/3744721/javascript-strings-outside-of-the-bmp