forked from BloopAI/bloop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 0-based indexes for line offsets in code chunks (BloopAI#836)
* Use 0-based indexes for line offsets in code chunks * use 0-based lines when communicating with the server * Adjust line number indexing when encoding/decoding * Adjust offsets for /explain query synthesis * Fix more off-by-one errors * Transcode index base for linked line ranges * fix lines in user message for explaining lines * fixes after rebase * Store and read code chunks with exclusive end range This fixes a bug where `proc` and `code` differed; `code` would store code chunks with an open-close (`[start,end)`) range, while `proc` would store code chunks with an open-open range (`[start,end]`). Now, we only store `[start,end)` in order to be more consistent with the default rust `Range` type. * Fix link offset loop Previously, the logic to check child elements was using `.any`, and thus short-circuiting. Now we use a combination of `map` and `fold`, which exhausts the `.children()` iterator properly. * Fix offsets for single-line links Now, links like `[foo](foo.rs#L1)` are correctly updated. Note the lack of an end range, like `#L1-L2`. --------- Co-authored-by: anastasiia <[email protected]>
- Loading branch information
1 parent
0b357fd
commit 6c18236
Showing
10 changed files
with
175 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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.