Skip to content

Commit

Permalink
feat: hover / go-to-def for attribute cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
digama0 committed Apr 13, 2024
1 parent c24b419 commit 93b471e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Lean/Elab/Declaration.lean
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ def elabMutual : CommandElab := fun stx => do
else
throwUnknownConstant name
let declName ← ensureNonAmbiguous ident declNames
if (← getInfoState).enabled then
addConstInfo ident declName
Term.applyAttributes declName attrs
for attrName in toErase do
Attribute.erase declName attrName
Expand Down
3 changes: 3 additions & 0 deletions tests/lean/interactive/hover.lean
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ def my_intro : Nat := 1
--v textDocument/hover
example : α → α := by my_intro _; assumption

attribute [simp] my_intro
--^ textDocument/hover

example : Nat → True := by
intro x
--^ textDocument/hover
Expand Down

0 comments on commit 93b471e

Please sign in to comment.