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: off by one error in Hover #903

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Conversation

Durbatuluk1701
Copy link
Contributor

Changes the string we are hovered on to be the start of the word index to end of word (does not include any period at the end)

Some word
with Not_found ->
with _ ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is idiomatic in Ocaml, but I noticed when looking at #731 that if we attempt to hover on a non-ascii character it could cause a crash due to String.sub raising Invalid_argument

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More generally I wonder (I am not really experienced in Ocaml) what the proper way for doing something akin to Regex in UTF would be to help eventually solve 731.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure how to handle this. Maybe @gares has pointers ?

@rtetley rtetley changed the title Fixing off by one error in Hover fix: off by one error in Hover Sep 13, 2024
@rtetley
Copy link
Collaborator

rtetley commented Sep 13, 2024

Thanks !

@rtetley rtetley merged commit 1dbaeb0 into coq:main Sep 13, 2024
24 checks passed
@Durbatuluk1701 Durbatuluk1701 deleted the hover-fixes branch September 13, 2024 14:42
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.

2 participants