fix: swallow exception on hover formatting
This commit is contained in:
parent
a379d2db5e
commit
fc821745ae
3 changed files with 10 additions and 2 deletions
|
|
@ -131,8 +131,10 @@ partial def InfoTree.hoverableInfoAt? (t : InfoTree) (hoverPos : String.Pos) : O
|
|||
def Info.fmtHover? (ci : ContextInfo) (i : Info) : IO (Option Format) := do
|
||||
ci.runMetaM i.lctx do
|
||||
let mut fmts := #[]
|
||||
if let some f ← fmtTerm? then
|
||||
fmts := fmts.push f
|
||||
try
|
||||
if let some f ← fmtTerm? then
|
||||
fmts := fmts.push f
|
||||
catch _ => pure ()
|
||||
if let some f ← fmtDoc? then
|
||||
fmts := fmts.push f
|
||||
if fmts.isEmpty then
|
||||
|
|
|
|||
3
tests/lean/interactive/hoverException.lean
Normal file
3
tests/lean/interactive/hoverException.lean
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
inductive Foo
|
||||
| mk : (a b : Bar) → Foo
|
||||
--^ textDocument/hover
|
||||
3
tests/lean/interactive/hoverException.lean.expected.out
Normal file
3
tests/lean/interactive/hoverException.lean.expected.out
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{"textDocument": {"uri": "file://hoverException.lean"},
|
||||
"position": {"line": 1, "character": 14}}
|
||||
null
|
||||
Loading…
Add table
Reference in a new issue