KirillOsenkov/XmlParser

Node span to Line and Column

davidjamesb opened this issue · 2 comments

Is it possible to convert the given span of a syntax node to it's corresponding line and column position in the XML source, similarly to how XmlReader can work with the IXmlLineInfo interface?

Unfortunately from a quick look I don't think we have anything.

For now I can only offer a workaround such as something like this:

https://github.com/KirillOsenkov/SourceBrowser/blob/ffdaee9ff0081ca5f77385cc1ce279cff6ba0fe5/src/Common/TextUtilities.cs#L10-L107

Let's keep the issue open to add line and column conversion facilities.

Generally the editor you're using should provide a facility to convert between positions and line/columns and back.