feat: add support for "jump-to-definition" at [tactic ...], [commandElab ...] and [termElab ...] attributes
see #1350
This commit is contained in:
parent
afce57386c
commit
c042e7ba58
1 changed files with 12 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue