-
Notifications
You must be signed in to change notification settings - Fork 449
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
feat: goal-diffs #1610
feat: goal-diffs #1610
Conversation
Co-authored-by: Wojciech Nawrocki <[email protected]>
From the perspective of the size of sent packets this is not an issue because we serialize However I am now thinking that tags could be useful more generally. For example, some error messages may want to bring the user's attention to a subexpression at which a tactic failed, or whatever, while still displaying the full top-level expression. For this though, because in different contexts (goal vs error message vs hover popup vs ..), "green background" may have different meanings, it might be better to think of the infoview as a "dumb" display which doesn't know the semantics of "inserted/deleted/relevant" subexpression but simply gives it a particular colour or style. So i'd suggest renaming the tags to something style-y rather than semantic-y. E.g. "green"/"red". What do you think? |
Yes I'm always in favour of functional styling |
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 didn't review Diff.lean
in detail but everything else looks good!
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 didn't think about the new heuristics too hard yet. I'd say let's simply give them a try.
@EdAyers Feel free to PR a changelog entry for RELEASES.md once the extension change has landed! |
Sorry for only getting to this PR now.
For the record, I would have preferred "inserted" and "removed" instead of "green" and "red," resp. There are several reasons:
|
Also, it's generally a bad idea to talk about colors directly because people have themes that can make the colors different, and then it's really confusing when |
I agree, but it seems none of the points raised here apply to the style-predicates vs semantic-predicates choice, it's just that |
I am happy to open a PR reverting to semantic tags instead of colours. In response to the theming and colour-blindness, the actual colours that are displayed at the moment are a function of whether the theme is light or dark. It should be possible to get the colours to be completely theme-dependent by using these. In the case of using a semantic tags model, are you ok with having a |
Let me highlight this question since people may have missed the edit. Personally I don't have any strong opinions on it. |
InteractiveGoals
now has information that a client infoview can use to show what parts of the goal have changed after applying a tactic.There are lots of exciting ways to extend this, but I think this PR should be just limited to a first version and getting a sensible and extensible server/client API in place.
API changes
All API changes are conservative so old versions of vscode will still be able to render the goals.
InteractiveGoals
,InteractiveGoal
,InteractiveHypothesisBundle
now have amessage? : Option String
field that can be used to emit debugging messages.InteractiveGoal
andInteractiveHypothesisBundle
now have aisInserted? : Option Bool
which is true when it is a new goal or hypothesis and should be rendered with a green highlight.SubexprInfo
has a newtags?: Option String
field. Currently the infoview is highlighting green anything that has the taginserted
on it. I would like some comments on whether this is a good way to implement the diff api. The tag approach could cause issues later because it depends on both client and server using the same magic string. Another problem is that it might be causing bloat ofSubexprInfo
, perhaps instead the diff info should live on its own map from position to tags.Todos
feat: preliminary definitions for goal-diffs #1607no longer depends on thisTodos/ future work
goalsBefore
andgoalsAfter
on theTacticInfo
object to get the diff. Currently I only show the diff onuseAfter = true
, perhaps I can also write a version foruseAfter = false
so that you see the change that is about to happen.Resolves #1469