-
Notifications
You must be signed in to change notification settings - Fork 268
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: Declarations with {:only} ensure that other declarations aren't displayed as verified in the gutter icons #4433
Conversation
…displayed as verified in the gutter icons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doubtful that it's a good idea to keep the current gutter icon notification API. If possible, and it seems so, I think we should compute gutter icons on the client, since computing on the client prevents equivalent pieces of information that are out-of-sync from reaching the client, and reduces bandwidth usage.
The API change in this PR makes it so that the client no longer has enough information to recompute the same icons without the gutter notifications.
If we want to compute the icons on the client, we should use a different API to tell the client which locations have been skipped from verification. One that comes to my mind is the diagnostics one, since it has a range field. You could emit a warning with a specific code, and the client could either:
- display this as a regular warning
- recognize the specific error code, remove the diagnostic from its list and instead display it as different icons in the gutter.
Also, are there other APIs that need to take {:only}
into account? What about dafny/textDocument/symbolStatus
? What does the status bar display if you verify a method that's excluded from verification because of {:only}
on another method?
Thanks for sharing your concern.
Fixing that is a no-brainer. Just add the same information in the tree that you have.
Symbol status says "verified". You could also file an issue for that and I'd be happy to look at it if time permits.. |
That's true. But this PR is also a feature enhancement that makes it harder to replace this feature with a more performant one.
I don't think it's a no-brainer to make API changes. I'm inclined to use warning diagnostics for it since they don't require API changes. |
Removing the green gutter icon on non-verified functions was part of the design of the What you suggest does make sense, adding a warning range on non-verified code can makes things easier to spot and to compute on the client side.
What you call an API change was an actual expected backward-compatible and forward-compatible API change. Gutter icons had "holes" in their numbering, allowing to create other icons as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test that verifies the symbolStatus API returns Stale
as a status for methods/functions that are skipped because of {:only}
? I would like to keep the symbolStatus API and the gutter icon API in sync (I'm always done with a PR that switches away from using the gutter icons, so we'll need the updated symbolStatus API)
Since @keyboardDrummer requests more nontrivial work to ensure the verification symbols are also not displayed as verified, but I can't do that right now, I'll go back to this PR on October 10th or before. |
I created another issue for your issue @keyboardDrummer |
…iment-trsplitexpr * commit '86840e6b14386c1e88480854dd8ce64ad17cb2ff': Map eq range (#4567) Fix: Declarations with {:only} ensure that other declarations aren't displayed as verified in the gutter icons (#4433) Fix caching of export declarations (#4556) Do not return exceptions when doing hover in a program with parse errors (#4557) Proof dependency warnings (#4542) [Test Generation] Reduce memory footprint by reusing the same Boogie program for multiple test generation queries (#4530) Fix a variety of bugs in Rust backend based on ESDK testing (#4538) Checker for .Values and .Items on maps (#4551) feat: Allow more assumptions in library backend (#4545) feat: Attributes on reads clauses (#4554) Fix gutter icons fields (#4549) Report errors that occur in the project file, in the IDE as well (#4539) Switch to ubuntu-20.04 for the refman build (#4555)
…displayed as verified in the gutter icons (#4433) This PR fixes #4432 I added the corresponding test. Because the Skipped gutter icon is not supported yet in VSCode, it's just rendered as no icon, which is suitable for now at least to indicate that a method is not verified. | Before, without this PR | With this PR | |--------------------------|---------------| | ![image](https://github.com/dafny-lang/dafny/assets/3601079/9b8e98c2-00a7-4e44-b31a-ba8c5c668a2c) | ![image](https://github.com/dafny-lang/dafny/assets/3601079/5e44226e-5897-4f1e-8223-c7d37b64ab68) | |--------------------------|--------------| | ![image](https://github.com/dafny-lang/dafny/assets/3601079/bbbb2658-ac9d-441d-9edb-fcc3c489f44c) | ![image](https://github.com/dafny-lang/dafny/assets/3601079/a6abf19b-d2c8-41d7-939c-fb846d7d4681) | |--------------------------|--------------| <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
This PR fixes #4432
I added the corresponding test.
Because the Skipped gutter icon is not supported yet in VSCode, it's just rendered as no icon, which is suitable for now at least to indicate that a method is not verified.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.