feat: make structure type clickable in “not a field” error (#5072)
This commit is contained in:
parent
cd21687884
commit
72f2e7aab1
1 changed files with 2 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import Lean.Parser.Term
|
|||
import Lean.Meta.Structure
|
||||
import Lean.Elab.App
|
||||
import Lean.Elab.Binders
|
||||
import Lean.PrettyPrinter
|
||||
|
||||
namespace Lean.Elab.Term.StructInst
|
||||
|
||||
|
|
@ -433,7 +434,7 @@ private def expandParentFields (s : Struct) : TermElabM Struct := do
|
|||
| { lhs := .fieldName ref fieldName :: _, .. } =>
|
||||
addCompletionInfo <| CompletionInfo.fieldId ref fieldName (← getLCtx) s.structName
|
||||
match findField? env s.structName fieldName with
|
||||
| none => throwErrorAt ref "'{fieldName}' is not a field of structure '{s.structName}'"
|
||||
| none => throwErrorAt ref "'{fieldName}' is not a field of structure '{MessageData.ofConstName s.structName}'"
|
||||
| some baseStructName =>
|
||||
if baseStructName == s.structName then pure field
|
||||
else match getPathToBaseStructure? env baseStructName s.structName with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue