File: Mathlib/Tactic/Widget/SelectPanelUtils.lean

full_name: getGoalLocations
code: /-- Given a `Array GoalsLocation` return the array of `SubExpr.Pos` for all locations
in the targets of the relevant goals. -/
def getGoalLocations (locations : Array GoalsLocation) : Array SubExpr.Pos 
goal: Array Lean.SubExpr.Pos

full_name: insertMetaVar
code: /-- Replace the sub-expression at the given position by a fresh meta-variable. -/
def insertMetaVar (e : Expr) (pos : SubExpr.Pos) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: String.renameMetaVar
code: /-- Replace all meta-variable names by "?_". -/
def String.renameMetaVar (s : String) : String 
goal: String

full_name: instSelectInsertParamsClassSelectInsertParams
code: /-- Structures providing parameters for a Select and insert widget. -/
structure SelectInsertParams where
  /-- Cursor position in the file at which the widget is being displayed. -/
  pos : Lsp.Position
  /-- The current tactic-mode goals. -/
  goals : Array Widget.InteractiveGoal
  /-- Locations currently selected in the goal state. -/
  selectedLocations : Array SubExpr.GoalsLocation
  /-- The range in the source document where the command will be inserted. -/
  replaceRange : Lsp.Range
  deriving SelectInsertParamsClass, RpcEncodable
goal: SelectInsertParamsClass SelectInsertParams

full_name: SelectInsertParams
code: /-- Structures providing parameters for a Select and insert widget. -/
structure SelectInsertParams where
  /-- Cursor position in the file at which the widget is being displayed. -/
  pos : Lsp.Position
  /-- The current tactic-mode goals. -/
  goals : Array Widget.InteractiveGoal
  /-- Locations currently selected in the goal state. -/
  selectedLocations : Array SubExpr.GoalsLocation
  /-- The range in the source document where the command will be inserted. -/
  replaceRange : Lsp.Range
  deriving SelectInsertParamsClass, RpcEncodable
goal: Type

full_name: SelectInsertParams.pos
code: /-- Structures providing parameters for a Select and insert widget. -/
structure SelectInsertParams where
  /-- Cursor position in the file at which the widget is being displayed. -/
  pos : Lsp.Position
  /-- The current tactic-mode goals. -/
  goals : Array Widget.InteractiveGoal
  /-- Locations currently selected in the goal state. -/
  selectedLocations : Array SubExpr.GoalsLocation
  /-- The range in the source document where the command will be inserted. -/
  replaceRange : Lsp.Range
  deriving SelectInsertParamsClass, RpcEncodable
goal: Lean.Lsp.Position

full_name: SelectInsertParams.goals
code: /-- Structures providing parameters for a Select and insert widget. -/
structure SelectInsertParams where
  /-- Cursor position in the file at which the widget is being displayed. -/
  pos : Lsp.Position
  /-- The current tactic-mode goals. -/
  goals : Array Widget.InteractiveGoal
  /-- Locations currently selected in the goal state. -/
  selectedLocations : Array SubExpr.GoalsLocation
  /-- The range in the source document where the command will be inserted. -/
  replaceRange : Lsp.Range
  deriving SelectInsertParamsClass, RpcEncodable
goal: Array Lean.Widget.InteractiveGoal

full_name: SelectInsertParams.selectedLocations
code: /-- Structures providing parameters for a Select and insert widget. -/
structure SelectInsertParams where
  /-- Cursor position in the file at which the widget is being displayed. -/
  pos : Lsp.Position
  /-- The current tactic-mode goals. -/
  goals : Array Widget.InteractiveGoal
  /-- Locations currently selected in the goal state. -/
  selectedLocations : Array SubExpr.GoalsLocation
  /-- The range in the source document where the command will be inserted. -/
  replaceRange : Lsp.Range
  deriving SelectInsertParamsClass, RpcEncodable
goal: Array Lean.SubExpr.GoalsLocation

full_name: SelectInsertParams.replaceRange
code: /-- Structures providing parameters for a Select and insert widget. -/
structure SelectInsertParams where
  /-- Cursor position in the file at which the widget is being displayed. -/
  pos : Lsp.Position
  /-- The current tactic-mode goals. -/
  goals : Array Widget.InteractiveGoal
  /-- Locations currently selected in the goal state. -/
  selectedLocations : Array SubExpr.GoalsLocation
  /-- The range in the source document where the command will be inserted. -/
  replaceRange : Lsp.Range
  deriving SelectInsertParamsClass, RpcEncodable
goal: Lean.Lsp.Range

full_name: SelectInsertParams.instRpcEncodable.enc._@.Mathlib.Tactic.Widget.SelectPanelUtils._hyg.217
code: RpcEncodable
goal: SelectInsertParams → StateM Lean.Server.RpcObjectStore Lean.Json

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

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

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

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

full_name: SelectInsertParams.RpcEncodablePacket._@.Mathlib.Tactic.Widget.SelectPanelUtils._hyg.217
code: RpcEncodable
goal: Type

full_name: mkSelectionPanelRPC
code: /-- Helper function to create a widget allowing to select parts of the main goal
and then display a link that will insert some tactic call.

The main argument is `mkCmdStr` which is a function creating the link text and the tactic call text.
The `helpMsg` argument is displayed when nothing is selected and `title` is used as a panel title.
The `onlyGoal` argument says whether the selected has to be in the goal. Otherwise it
can be in the local context.
The `onlyOne` argument says whether one should select only one sub-expression.
In every cases, all selected subexpressions should be in the main goal or its local context.

The last arguments `params` should not be provided so that the output
has type `Params → RequestM (RequestTask Html)` and can be fed to the `mk_rpc_widget%`
elaborator.

Note that the `pos` and `goalType` arguments to `mkCmdStr` could be extracted for the `Params`
argument but that extraction would happen in every example, hence it is factored out here.
We also make sure `mkCmdStr` is executed in the right context.
 -/
def mkSelectionPanelRPC {Params : Type} [SelectInsertParamsClass Params]
    (mkCmdStr : (pos : Array GoalsLocation) → (goalType : Expr) → Params →
   MetaM (String × String × Option (String.Pos × String.Pos)))
  (helpMsg : String) (title : String) (onlyGoal := true) (onlyOne := false) :
  (params : Params) → RequestM (RequestTask Html) 
goal: Lean.Server.RequestM (Lean.Server.RequestTask ProofWidgets.Html)