Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Conversation

@calyptobai
Copy link
Contributor

@calyptobai calyptobai commented Aug 8, 2023

Here, we swap the internal line range logic to use 0-based indexes. We make a concession for links, as they are generated directly by the LLM and not normally process, and so we add additional processing to change the indexing base.

In the future, we can test the model with generating 0-based indexes directly, and remove the new extra processing logic if this works.

Closes BLO-1375 and BLO-1390.

@calyptobai calyptobai force-pushed the line-indexing-0-based branch 3 times, most recently from 97dc935 to 94a56c0 Compare August 10, 2023 17:01
@calyptobai calyptobai marked this pull request as ready for review August 11, 2023 02:38
@calyptobai calyptobai requested a review from ggordonhall August 11, 2023 02:39
@calyptobai calyptobai force-pushed the line-indexing-0-based branch from 20c0648 to 3503a3b Compare August 14, 2023 13:23
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.
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.
Now, links like `[foo](foo.rs#L1)` are correctly updated. Note the lack
of an end range, like `#L1-L2`.
@calyptobai calyptobai force-pushed the line-indexing-0-based branch from 52172f0 to f3699f0 Compare August 14, 2023 20:10
@calyptobai calyptobai merged commit 6c18236 into main Aug 14, 2023
@calyptobai calyptobai deleted the line-indexing-0-based branch August 14, 2023 20:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants