blob: 3f2760b4570fa7ca8cf97f4924c7b06c5cdee94a [file]
/-
Copyright (c) 2025 Lean FRO, LLC. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kim Morrison
-/
module
prelude
public import Lean.Elab.Command
public section
open Lean Elab Command
namespace Lean.Elab.Tactic.InfoTrees
@[builtin_command_elab infoTreesCmd, inherit_doc guardMsgsCmd]
def elabInfoTrees : CommandElab
| `(command| #info_trees%$tk in $cmd) => do
if ! (← getInfoState).enabled then
logError "Info trees are disabled, can not use `#info_trees`."
else
elabCommand cmd
let infoTrees := (← getInfoState).substituteLazy.get.trees
for t in infoTrees do
logInfoAt tk (← t.format)
| _ => throwUnsupportedSyntax
end Lean.Elab.Tactic.InfoTrees