lean4-htt/tests/lean/interactive/errorExplanationInteractive.lean
jrr6 32795911d2
feat: add initial error explanations (#8934)
This PR adds explanations for a few errors concerning noncomputability,
redundant match alternatives, and invalid inductive declarations.

These adopt a lower-case error naming style, which is also applied to
existing error explanation tests.
2025-06-23 17:24:09 +00:00

41 lines
1 KiB
Text

import Lean.ErrorExplanation
import Lean.Exception
import Lean.Log
/-!
# Error explanation interactive tests
Tests completions and hovers for error explanations.
-/
/-- Example -/
register_error_explanation testPkg.bar {
summary := "Error 0"
sinceVersion := "4.0.0"
}
/-- Example -/
register_error_explanation testPkg.foo1 {
summary := "Error 1"
sinceVersion := "4.0.0"
}
/-- Example -/
register_error_explanation testPkg.foo2 {
summary := "Error 2"
sinceVersion := "4.0.0"
}
#check throwNamedError testPkg
--^ textDocument/completion
#check throwNamedError testPkg.
--^ textDocument/completion
#check throwNamedError testPkg.f
--^ textDocument/completion
#check throwNamedError testPkg.f "test"
--^ textDocument/completion
#check throwNamedError testPkg.foo2
--^ textDocument/hover
#check throwNamedError testPkg.foo2 "test"
--^ textDocument/hover