-
Notifications
You must be signed in to change notification settings - Fork 297
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(tactic/interactive_expr): Color instances in the infoview #15959
Conversation
let ns : list (html γ) := lc.locals.map $ λ n, | ||
h "span" [cn "goal-hyp b pr2", key n.local_uniq_name] [html.of_name n.local_pp_name], |
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.
Where did the key n.local_uniq_name
go?
then "goal-hyp-inst" | ||
else "goal-hyp-noninst" | ||
| none := "goal-hyp-unfrozen" | ||
end in h "span" [cn $ var_style ++ " b pr2"] [html.of_name $ expr.local_pp_name n], |
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.
nit:
end in h "span" [cn $ var_style ++ " b pr2"] [html.of_name $ expr.local_pp_name n], | |
end in h "span" [cn $ var_style ++ " b pr2"] [html.of_name n.local_pp_name], |
which is more similar to how it was spelt originally
then "goal-hyp" | ||
else match is with | ||
| some is' := if n ∈ is' | ||
then "goal-hyp-inst" | ||
else "goal-hyp-noninst" | ||
| none := "goal-hyp-unfrozen" |
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.
In the interest of backwards-compatibility with older extension versions, perhaps
then "goal-hyp" | |
else match is with | |
| some is' := if n ∈ is' | |
then "goal-hyp-inst" | |
else "goal-hyp-noninst" | |
| none := "goal-hyp-unfrozen" | |
then "goal-hyp" | |
else match is with | |
| some is' := if n ∈ is' | |
then "goal-hyp goal-hyp-inst" | |
else "goal-hyp goal-hyp-noninst" | |
| none := "goal-hyp goal-hyp-unfrozen" |
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.
Would it make sense to do
then "goal-hyp" | |
else match is with | |
| some is' := if n ∈ is' | |
then "goal-hyp-inst" | |
else "goal-hyp-noninst" | |
| none := "goal-hyp-unfrozen" | |
then "goal-hyp" | |
else match is with | |
| some is' := if n ∈ is' | |
then "goal-hyp inst" | |
else "goal-hyp noninst" | |
| none := "goal-hyp unfrozen" |
instead?
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.
No, because inst
is a pretty vague CSS class name, as is unfrozen
. If in doubt, qualify your names.
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.
Won't the fully qualified name be goal-hyp inst
? Disclaimer: I don't understand CSS.
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.
class
(which cn
sets) is an unordered set
of unrelated classnames. You can of course apply styles to things that match both goal-hyp
and inst
(via the indistinguisable selectors .inst.goal-hyp
or .goal-hyp.inst
, since conjunction is concatenation), but the danger is that someone else might already be applying a style you don't expect to .inst
by itself.
This PR is made irrelevant by the way Lean 4 handles instances. No need to worry about frozen instances anymore. |
Change the behavior of the infoview to visually distinguish:
The style is very much up for debate! See Zulip. Once we have decided on the style, I will open a preliminary PR to
vscode-lean
adding the new attributes to the CSS.