You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the process of upgrading our copy of annotate-snippets in Ruff, I discovered that the way empty spans after a line terminator are handled had changed.
Now, to be clear, the previous output seems to be a bit buggy since the ^ is missing. But the rendering matched up with the line following the line terminator, where as the new version of annotate-snippets matches up with the line preceding the line terminator.
If you change the span from 18..18 above to 17..17 (i.e., just before the line terminator), the rendered output doesn't actually change. So to me it seems like if the span comes after the line terminator, it should probably point to the beginning of the next line?
Anyway, I don't know exactly what the right behavior should be here, so my goal here is just to understand if this change was intentional, and if so, what the thinking is behind it. Or are empty spans discouraged in general?
(As you might imagine, a system that organically grew around the old behavior is difficult to adapt to the new behavior.)
The text was updated successfully, but these errors were encountered:
For at least myself, it seems reasonable for a span after the line terminator to point at the beginning of a line, rather than the end. I know we found a lot of problems with both empty spans and end of lines when integrating annotate-snippets with Cargo, so unsure if this change was intentional or not and if there are alternatives if it was intentional.
During the process of upgrading our copy of
annotate-snippets
in Ruff, I discovered that the way empty spans after a line terminator are handled had changed.Previously:
had this output:
And now:
Has this output:
Now, to be clear, the previous output seems to be a bit buggy since the
^
is missing. But the rendering matched up with the line following the line terminator, where as the new version ofannotate-snippets
matches up with the line preceding the line terminator.If you change the span from
18..18
above to17..17
(i.e., just before the line terminator), the rendered output doesn't actually change. So to me it seems like if the span comes after the line terminator, it should probably point to the beginning of the next line?Anyway, I don't know exactly what the right behavior should be here, so my goal here is just to understand if this change was intentional, and if so, what the thinking is behind it. Or are empty spans discouraged in general?
(As you might imagine, a system that organically grew around the old behavior is difficult to adapt to the new behavior.)
The text was updated successfully, but these errors were encountered: