Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use byte indexes instead of lines and columns #79

Open
dsherret opened this issue Dec 13, 2021 · 1 comment
Open

Use byte indexes instead of lines and columns #79

dsherret opened this issue Dec 13, 2021 · 1 comment

Comments

@dsherret
Copy link
Member

I think lines and columns is an LSP & display concern and we should remove it from deno_graph. I think deno_graph should just return byte indexes or at least have both. It would also be good to standardize any unit types with deno_ast (so probably just use swc's Span for ranges... or maybe we could make our own type that uses usize and easily converts to an swc span)

discussion_r767983595

@kitsonk
Copy link
Contributor

kitsonk commented Dec 13, 2021

Including the byte pos as well makes sense, but the serialization should be line and col, as it is often a situation where the consumer of the serialization doesn't want to access the source (especially in JS) and allows the conumer of a serialization to be able to display a line and col reference without going through the bytes of the original source (especially things like doc websites which only want to "link" to the source without accessing it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants