fix(rome_lsp): improve the handling of UTF-8 and overflow errors in `LineIndex`
Summary
Fixes #3733
This PR ensures the LineIndex utility (used to convert between the LineCol and TextSize representations of text positions within the language server) correctly accounts for UTF-8 character boundaries by properly converting between column numbers and byte offsets instead of directly reinterpreting each value kind as the other. I've also introduced additional error checking (especially in the line_col method that's not failible just like offset) to ensure that invalid text positions properly return None rather than an invalid offset (or panic)
Test Plan
I've added new test cases for LineIndex to check the result of both offset and line_col with various kinds of valid or invalid input
Deploy Preview for docs-rometools canceled.
| Name | Link |
|---|---|
| Latest commit | ae8c509389739049cfc45f1f47c917079f11ac8b |
| Latest deploy log | https://app.netlify.com/sites/docs-rometools/deploys/63739b5dd80bdf00084cfdfb |