Closed gersmann closed 2 years ago
I think @Chadsr ran into this too - maybe we just need to add in an offset in pyright_to_rdjson.py?
I think @Chadsr ran into this too - maybe we just need to add in an offset in pyright_to_rdjson.py?
Yeah, linenumber + 1 it seems?
@jordemort not sure where this action is used, would it be safe to hardcode the offset (does it affect other projects as well) or should we make it configurable?
@gersmann I think it's probably a bug that's affecting everyone that uses it. I want to play around with it a bit to confirm, but I'm on the road this week - I might not get time to mess with it until next week. PRs are always welcome, of course ;)
I had intended to extend the unit test to catch this, but I did not fully get around to confirming it. (and i'm also a bit too busy right now)
Ideally the unit test should have an example output from Pyright to check against the generated rdjson output. If the test still passes, then somehow the line numbers must be getting jumbled further on in the pipeline?
Edit: I've also mostly forgot how the unit test looks, so some of this may actually be done already.
So the pyright team confirmed, their offsets are 'zero-based', which means that we should be able to safely increase those by offset 1.
It seems like comments are generally off by 1 line, e.g.
This affects all test comments I have generated.