semantic
semantic copied to clipboard
1-indexed Spans are fiddly
Pos is 1-indexed, which means so is Span, which is fiddly:
- we have to increment the line & col we get from tree-sitter
- any time we’re using them for actual computation (e.g. slicing up source) we have to decrement them appropriately
- but then be careful not to use the decremented values in another
Spanwithout re-incrementing - and so on
I think we should make all of this 0-indexed, and only convert to 1-indexed when we’re showing stuff to the user (e.g. in error messages, hyperlinks, etc).