Skip to content

Commit

Permalink
feat: add support for "jump-to-definition" at [tactic ...], `[comma…
Browse files Browse the repository at this point in the history
…ndElab ...]` and `[termElab ...]` attributes

see #1350
  • Loading branch information
leodemoura committed Jul 25, 2022
1 parent afce573 commit c042e7b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Lean/Elab/Util.lean
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,18 @@ unsafe def mkElabAttribute (γ) (attrDeclName attrBuiltinName attrName : Name) (
name := attrName
descr := kind ++ " elaborator"
valueTypeName := typeName
evalKey := fun _ stx => syntaxNodeKindOfAttrParam parserNamespace stx
evalKey := fun _ stx => do
let kind ← syntaxNodeKindOfAttrParam parserNamespace stx
/- Recall that a `SyntaxNodeKind` is often the name of the paser, but this is not always true, and we much check it. -/
if (← getEnv).contains kind && (← getInfoState).enabled then
pushInfoLeaf <| Info.ofTermInfo {
elaborator := .anonymous
lctx := {}
expr := mkConst kind
stx := stx[1]
expectedType? := none
}
return kind
onAdded := fun builtin declName => do
if builtin then
if let some doc ← findDocString? (← getEnv) declName then
Expand Down

0 comments on commit c042e7b

Please sign in to comment.