File: Mathlib/Tactic/Widget/Calc.lean

full_name: createCalc
code: /-- Code action to create a `calc` tactic from the current goal. -/
@[tactic_code_action calcTactic]
def createCalc : TacticCodeAction 
goal: Std.CodeAction.TacticCodeAction

full_name: CalcParams
code: /-- Parameters for the calc widget. -/
structure CalcParams extends SelectInsertParams where
  /-- Is this the first calc step? -/
  isFirst : Bool
  /-- indentation level of the calc block. -/
  indent : Nat
  deriving SelectInsertParamsClass, RpcEncodable
goal: Type

full_name: CalcParams.isFirst
code: /-- Parameters for the calc widget. -/
structure CalcParams extends SelectInsertParams where
  /-- Is this the first calc step? -/
  isFirst : Bool
  /-- indentation level of the calc block. -/
  indent : Nat
  deriving SelectInsertParamsClass, RpcEncodable
goal: Bool

full_name: CalcParams.indent
code: /-- Parameters for the calc widget. -/
structure CalcParams extends SelectInsertParams where
  /-- Is this the first calc step? -/
  isFirst : Bool
  /-- indentation level of the calc block. -/
  indent : Nat
  deriving SelectInsertParamsClass, RpcEncodable
goal: Nat

full_name: instSelectInsertParamsClassCalcParams
code: /-- Parameters for the calc widget. -/
structure CalcParams extends SelectInsertParams where
  /-- Is this the first calc step? -/
  isFirst : Bool
  /-- indentation level of the calc block. -/
  indent : Nat
  deriving SelectInsertParamsClass, RpcEncodable
goal: SelectInsertParamsClass CalcParams

full_name: CalcParams.RpcEncodablePacket._@.Mathlib.Tactic.Widget.Calc._hyg.289
code: RpcEncodable
goal: Type

full_name: CalcParams.instRpcEncodable
code: RpcEncodable
goal: Lean.Server.RpcEncodable CalcParams

full_name: CalcParams.instRpcEncodable.dec._@.Mathlib.Tactic.Widget.Calc._hyg.289
code: RpcEncodable
goal: Lean.Json → ExceptT String (ReaderT Lean.Server.RpcObjectStore Id) CalcParams

full_name: CalcParams.instFromJsonRpcEncodablePacket
code: RpcEncodable
goal: Lean.FromJson CalcParams.RpcEncodablePacket✝

full_name: CalcParams.instToJsonRpcEncodablePacket
code: RpcEncodable
goal: Lean.ToJson CalcParams.RpcEncodablePacket✝

full_name: CalcParams.instRpcEncodable.enc._@.Mathlib.Tactic.Widget.Calc._hyg.289
code: RpcEncodable
goal: CalcParams → StateM Lean.Server.RpcObjectStore Lean.Json

full_name: suggestSteps
code: /-- Return the link text and inserted text above and below of the calc widget. -/
def suggestSteps (pos : Array Lean.SubExpr.GoalsLocation) (goalType : Expr) (params : CalcParams) :
    MetaM (String × String × Option (String.Pos × String.Pos)) 
goal: Lean.MetaM (String × String × Option (String.Pos × String.Pos))

full_name: CalcPanel.rpc
code: /-- Rpc function for the calc widget. -/
@[server_rpc_method]
def CalcPanel.rpc 
goal: Lean.Server.RequestM (Lean.Server.RequestTask ProofWidgets.Html)

full_name: CalcPanel
code: /-- The calc widget. -/
@[widget_module]
def CalcPanel : Component CalcParams 
goal: ProofWidgets.Component CalcParams

full_name: Lean.Elab.Tactic._aux_Mathlib_Tactic_Widget_Calc___elabRules_Lean_calcTactic_1
code: /-- Elaborator for the `calc` tactic mode variant with widgets. -/
elab_rules : tactic
| `(tactic|calc%$calcstx $stx) => do
  let steps : TSyntax ``calcSteps := ⟨stx⟩
  let some calcRange := (← getFileMap).rangeOfStx? calcstx | unreachable!
  let indent := calcRange.start.character
  let mut isFirst := true
  for step in ← Lean.Elab.Term.getCalcSteps steps do
    let some replaceRange := (← getFileMap).rangeOfStx? step | unreachable!
    let `(calcStep| $(_) := $proofTerm) := step | unreachable!
    let json := json% {"replaceRange": $(replaceRange),
                        "isFirst": $(isFirst),
                        "indent": $(indent)}
    Widget.savePanelWidgetInfo CalcPanel.javascriptHash (pure json) proofTerm
    isFirst := false
  evalCalc (← `(tactic|calc%$calcstx $stx))
goal: Lean.Elab.Tactic.Tactic