Created
February 6, 2025 21:27
-
-
Save cppio/6bc2eea9ca459bcaa19a0fc1678b88f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Lean.Elab.Command | |
elab tk:"#show " "macro " i:ident : command => do | |
let key ← Lean.Elab.Command.liftCoreM do Lean.Elab.realizeGlobalConstNoOverloadWithInfo i | |
let env ← Lean.getEnv | |
let names := Lean.Elab.macroAttribute.getEntries env key |>.map (·.declName) | |
Lean.logInfoAt tk (.joinSep names Lean.Format.line) | |
elab tk:"#show " "term_elab " i:ident : command => do | |
let key ← Lean.Elab.Command.liftCoreM do Lean.Elab.realizeGlobalConstNoOverloadWithInfo i | |
let env ← Lean.getEnv | |
let names := Lean.Elab.Term.termElabAttribute.getEntries env key |>.map (·.declName) | |
Lean.logInfoAt tk (.joinSep names Lean.Format.line) | |
elab tk:"#show " "command_elab " i:ident : command => do | |
let key ← Lean.Elab.Command.liftCoreM do Lean.Elab.realizeGlobalConstNoOverloadWithInfo i | |
let env ← Lean.getEnv | |
let names := Lean.Elab.Command.commandElabAttribute.getEntries env key |>.map (·.declName) | |
Lean.logInfoAt tk (.joinSep names Lean.Format.line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment