Skip to content
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

Fix highlights #805

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Fix highlights #805

merged 3 commits into from
Jul 12, 2024

Conversation

rtetley
Copy link
Collaborator

@rtetley rtetley commented Jun 27, 2024

When there is a non-invalidating edit, the exec overview needs to be shifted (like for the diagnostics).
Closes #803

@rtetley rtetley force-pushed the fix-highlights branch 2 times, most recently from 5818c4b to 5dcef54 Compare July 9, 2024 15:36
@rtetley rtetley marked this pull request as ready for review July 9, 2024 15:38
(List.map (fun (_,x) -> Sentence x) @@ SM.bindings parsed.sentences_by_id) ;
(List.map (fun (_,x) -> Sentence x) @@ LM.bindings parsed.sentences_by_end) ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be reverted, or better the two maps should be printed for future debugging

Comment on lines -238 to +247
let sentences_by_end = LM.remove old_sentence.stop parsed.sentences_by_end in
let sentences_by_end = match LM.find_opt old_sentence.stop parsed.sentences_by_end with
| Some { id } when Stateid.equal id new_sentence.id ->
LM.remove old_sentence.stop parsed.sentences_by_end
| _ -> parsed.sentences_by_end
in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gares
Copy link
Member

gares commented Jul 9, 2024

It would be nice to have some unit tests on the contents of LM and SM after document validation, although the bug we fix here is really hard to imagine in a test

@gares
Copy link
Member

gares commented Jul 11, 2024

If we remove the debug prints I believe we could merge and release

rtetley added 3 commits July 12, 2024 11:19
A nasty bug would overwrite a sentence if by chance they had the same end loc.
@rtetley rtetley merged commit fd68049 into main Jul 12, 2024
23 checks passed
@rtetley rtetley deleted the fix-highlights branch July 12, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscoq 2.1.3, break seems broken
2 participants