@@ -24,15 +24,15 @@ public meta section
2424
2525namespace Mathlib.Tactic.ClickSuggestions
2626
27- open Lean Meta ProofWidgets Server
27+ open Lean Meta ProofWidgets Jsx Server
2828
2929section
3030
3131open Widget PrettyPrinter.Delaborator
3232
3333/-- Turn an `Expr` into an HTML with hover info. -/
3434def exprToHtml (e : Expr) : MetaM Html :=
35- return jsx%{ <InteractiveCode fmt={← Widget.ppExprTagged e}/>}
35+ return <InteractiveCode fmt={← Widget.ppExprTagged e}/>
3636
3737/-- Turn a constant into an HTML with hover info.
3838This avoids the `@` that may appear when using `exprToHtml`. -/
@@ -49,7 +49,7 @@ def constToHtml (n : Name) : MetaM Html := do
4949 fileMap := default
5050 ngen := (← getNGen)
5151 }
52- return jsx%{ <InteractiveCode fmt={← tagCodeInfos ctx infos tt}/>}
52+ return <InteractiveCode fmt={← tagCodeInfos ctx infos tt}/>
5353
5454/-- Display `fmt` with a docstring as if it is the constant `n`. -/
5555def formatToHtmlWithDoc (fmt : Format) (n : Name) : MetaM Html := do
@@ -71,7 +71,7 @@ def formatToHtmlWithDoc (fmt : Format) (n : Name) : MetaM Html := do
7171 -- TODO: I would love to print this using the same keyword colour used by the editor,
7272 -- but I don't think this is possible. Additionally, `InteractiveCode` already overwrites the
7373 -- colour and style of the text (namely the expression style)
74- return jsx%{ <InteractiveCode fmt={← tagCodeInfos ctx infos tt} />}
74+ return <InteractiveCode fmt={← tagCodeInfos ctx infos tt} />
7575
7676
7777/-- Pretty print a tactic with its docstring as hover info.
@@ -233,7 +233,7 @@ where
233233 else
234234 -- TODO: use a fancier throbber instead of `⏳️`?
235235 let title := "ongoing computations: " ++ String.intercalate ", " status.keys;
236- jsx%{ <span title={title}>⏳️ </span>}
236+ <span title={title}> {.text "⏳️" } </span>
237237
238238section Meta
239239
@@ -366,24 +366,24 @@ def mkSuggestion (tac : TSyntax `tactic) (html : Html) (isClosing := false) :
366366 let buttonText := if isClosing then "[done] " else "[apply] "
367367 let button :=
368368 -- TODO: The hover on this button should be a `CodeWithInfos`, instead of a string.
369- jsx%{ <span style={json% { "white-space" : "pre" }} className="font-code" >
369+ <span style={json% { "white-space" : "pre" }} className="font-code" >
370370 { .ofComponent MakeEditLink (.ofReplaceRange (← read).meta range newText) #[.text buttonText] }
371- </span>} ;
372- return jsx%{ <div display="flex"
371+ </span>;
372+ return <div display="flex"
373373 style={json% { "display" : "flex" , "align-items" : "flex-start" , "margin-bottom" : "1em" }}>
374- {button}{html}
375- </div>}
374+ {button} {html}
375+ </div>
376376
377377/-- Add suggestion `tac` to the list of tactics that solve the goal. -/
378378def addSolvedSuggestion (tac : TSyntax `tactic) : ClickSuggestionsM Unit := do
379379 let html ← mkSuggestion tac (.text (← PrettyPrinter.ppTactic tac).pretty) (isClosing := true )
380380 modify fun s ↦ { s with solvedSuggestions := s.solvedSuggestions.push html }
381- (← read).solvedToken.update jsx%{ <details open ={true }>
381+ (← read).solvedToken.update <details « open » ={true }>
382382 <summary className="mv2 pointer" >
383383 These tactics solve the goal: 🎉️
384384 </summary>
385385 {.element "div" #[] (← get).solvedSuggestions}
386- </details>}
386+ </details>
387387
388388end Widget
389389
0 commit comments