-
-
Notifications
You must be signed in to change notification settings - Fork 37
feat: add support for getLocFromIndex and getIndexFromLoc
#212
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
Merged
nzakas
merged 70 commits into
main
from
feat-add-support-for-getlocfromindex-and-getindexfromloc
Aug 20, 2025
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
08a179a
feat: add support for `getLocFromIndex` and `getIndexFromLoc`
lumirlumir c0b4cc4
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir 5f6fb42
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir adc573f
wip: complete `getLocFromIndex`
lumirlumir 8def91f
wip: resolve ts error
lumirlumir b9f5a17
wip: add tests for types
lumirlumir 9c2c153
wip: complete tests for `getLocFromIndex`
lumirlumir 7655663
wip: update `README.md`
lumirlumir bdb8f11
wip: add `@public`
lumirlumir b970ccc
wip: add more test cases
lumirlumir 1e319ee
wip: add type tests for `getIndexFromLoc`
lumirlumir 953a16c
wip: update `getIndexFromLoc`
lumirlumir 4977cb2
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir e1df65c
wip: add more test cases for `getLocFromIndex`
lumirlumir bc963b3
Merge branch 'feat-add-support-for-getlocfromindex-and-getindexfromlo…
lumirlumir c31843f
wip: complete `getIndexFromLoc`
lumirlumir a831324
wip: add more test cases
lumirlumir eaa212d
wip: add more tests
lumirlumir 478b8d5
wip: update error message
lumirlumir 498402f
wip: more detailed test cases
lumirlumir fbd565e
fix: improve error messages for column range validation
lumirlumir e4b789b
wip: remove `@ts-ignore`
lumirlumir bc5c6de
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir 4844c96
wip: retrieve `lineStart` and `columnStart` from AST
lumirlumir c0f6bab
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir ed7dffc
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir bd21283
wip: lazy caculation
lumirlumir b7a4abf
wip: refactor `findLineNumberBinarySearch`
lumirlumir 3ef01a9
wip: refactor `#lines`
lumirlumir 2098f91
wip: refactor `#setLineColumnStart`
lumirlumir c4e80dd
wip: freeze `#lines` and add test cases
lumirlumir 82591a6
wip: fix CI
lumirlumir 1a5022e
wip: complete refactor (maybe?)
lumirlumir 3c5fad7
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir 2d9d12b
wip: add more test cases
lumirlumir c70890a
wip: add more test cases
lumirlumir 59b3f2e
fix: wrong console logging
lumirlumir bb13197
wip: cleanup
lumirlumir 1750960
wip: lazily caculate `#lines`
lumirlumir 2cef189
wip: create `#rootNodeLoc`
lumirlumir 1d1022a
wip: remove `#lineStart`
lumirlumir 0e4cac0
wip: cleanup
lumirlumir 1c0531c
wip: remove `@ts-expect-error`
lumirlumir 1e3ba06
wip: refactor `rootNodeLoc`
lumirlumir bf02009
wip: refactor `getLocFromIndex` and add update test cases
lumirlumir aebf8d2
wip: add more test cases
lumirlumir 710f945
wip: complete `getLocFromIndex`
lumirlumir 23510e0
wip: modify comments
lumirlumir 7a6e57f
wip: update test cases
lumirlumir 0d98c6b
wip: remove unnecessary test
lumirlumir 2fe8cd5
wip: refactor line ending calculation
lumirlumir 75e156f
wip: add early return logic
lumirlumir b1e5249
wip: refactor `#ensureLineStartIndicesFromLoc`
lumirlumir 9d1f541
wip: cleanup using destructuring
lumirlumir 123118c
wip: calculate lines together
lumirlumir 91f3b8e
wip: calculate lines together
lumirlumir 98691ad
wip: refactor code to reduce redundency
lumirlumir ae465b6
wip: refactor `#ensureLineStartIndicesFromLoc`
lumirlumir 8afa6ac
wip: refactor `#ensureLineStartIndicesFromLoc`
lumirlumir ffb9b54
wip: rename var
lumirlumir 13014b4
wip: rename to `#fineNextLine`
lumirlumir 3d3448a
wip: refactor `additonalLinesNeeded`
lumirlumir 1296ace
wip: replace `structuredClone` with `RegExp`
lumirlumir af494ed
Merge branch 'main' into feat-add-support-for-getlocfromindex-and-get…
lumirlumir 0651a8f
wip: resolve issues with `y` flag
lumirlumir 9131119
Merge branch 'feat-add-support-for-getlocfromindex-and-getindexfromlo…
lumirlumir 92f1094
wip: add notes in `README.md`
lumirlumir 0ae05bf
wip: add test case
lumirlumir 842dfb8
fix: multi-character line break sequence
lumirlumir df39059
wip: save calculation by using short-circuit mechanism
lumirlumir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.