ariadne icon indicating copy to clipboard operation
ariadne copied to clipboard

Use line numbers instead of character position

Open ryangjchandler opened this issue 4 years ago • 2 comments

Is it possible to render errors based on line number and then the column? My parser resets the column position on each new line, so rendering errors is difficult since an error on the 4th line at column 4..5 is being rendered as the 4th and 5th characters in the entire source.

ryangjchandler avatar Nov 26 '21 11:11 ryangjchandler

This is not currently possible, but I might be able to build this feature into the API refactor I'm working on.

zesterer avatar Nov 26 '21 12:11 zesterer

Yeah that would be awesome.

ryangjchandler avatar Nov 26 '21 17:11 ryangjchandler

Hey @zesterer, any update regarding this issue?

kaplanelad avatar Oct 24 '22 12:10 kaplanelad

I think this should be possible with the offset method on Source: https://docs.rs/ariadne/latest/ariadne/struct.Line.html#method.offset.

zesterer avatar Oct 27 '22 00:10 zesterer