Skip to content

Commit 15f13f4

Browse files
committed
fix(Tactic/ToFun): correct location of hovers (leanprover-community#39911)
When an explicit name for the new declaration is given, make hovering over the `to_fun` keyword show the keyword's documentation, and hovering over the new declaration show the declaration's name. Right now, it is the opposite way around.
1 parent 2e770ea commit 15f13f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Mathlib/Tactic/ToFun.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def toFunImpl (src : Name) (stx : Syntax) (kind : AttributeKind) : AttrM Name :=
5353
if name == src.appendBefore "fun_" then
5454
logWarningAt id m!"`to_fun` correctly autogenerated the provided name `{.ofConstName name}`.\
5555
\nYou may remove it."
56-
MetaM.run' <| addRelatedDecl src name tk optAttr
56+
MetaM.run' <| addRelatedDecl src name (id.elim tk (·.raw)) optAttr
5757
(docstringPrefix? := s!"Eta-expanded form of `{src}`") (hoverInfo := true)
5858
fun value levels => do
5959
let type ← inferType value

0 commit comments

Comments
 (0)