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

Allow recording partial hints, make --record_hints settable #3704

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

mtzguido
Copy link
Member

(Based on #3703)

This PR allows to turn on --record_hints in the middle of a file, and record hints for only that top-level. All old hints are retained, except where overriden by the new ones. This is done by reading the old hints_db and overriding with the new hints_db before writing the new file.

If --record_hints is given for the entire file, we ignore the old hints and write a fresh file.

Internally there a few simplication like always using the with_hints_db wrapper, removing some branching on Options.record_hints().

Note: in the IDE, the hints file is not written out as we never "finish" checking a module. This PR does not change this.

@mtzguido mtzguido force-pushed the partial_hints branch 2 times, most recently from a096cac to 5ca25d4 Compare January 30, 2025 22:07
If the hint file fails to parse (e.g. is empty), Yojson will raise an
exception. Handle it instead of crashing.
If we've generated hints for a subset of a file, this patch allows
to combine the new hints with the old hints that are stored in disk,
overriding the hints which have been regenerated and keeping the rest.
After previous patch, this now works fine to regenerate hints for only a
few definitions, perhaps admitting the rest.
Incrementally, after every declaration. Crucially not after every
repl_task, since they can be arbitrarilly long (e.g. check the entire
file).
@mtzguido
Copy link
Member Author

mtzguido commented Feb 3, 2025

Now updated to write out hints in the interactive mode too: after checking each declaration we perform a flush, updating the on-disk file with new information.

@mtzguido mtzguido merged commit 2409e77 into FStarLang:master Feb 3, 2025
9 checks passed
@mtzguido mtzguido deleted the partial_hints branch February 3, 2025 21:03
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.

1 participant