This PR significantly improves the test coverage of the language server, providing at least a single basic test for every request that is used by the client. It also implements infrastructure for testing all of these requests, e.g. the ability to run interactive tests in a project context and refactors the interactive test runner to be more maintainable. Finally, it also fixes a small bug with the recently implemented unknown identifier code actions for auto-implicits (#10442) that was discovered in testing, where the "import all unambiguous unknown identifiers" code action didn't work correctly on auto-implicit identifiers.
28 lines
671 B
Text
28 lines
671 B
Text
import Lean.Server.Test.Refs
|
||
--^ waitForILeans
|
||
|
||
inductive Unit' where
|
||
| mk
|
||
|
||
inductive Sum' (α β) where
|
||
| left (a : α)
|
||
| right (b : β)
|
||
|
||
def foo : Unit' := .mk
|
||
def bar := foo
|
||
def foobar (s : Sum' α β) : Unit' :=
|
||
match s with
|
||
| .left _ => foo
|
||
| .right _ => bar
|
||
def barfoo (s : Sum' α β) := foobar s
|
||
--^ outgoingCallHierarchy
|
||
|
||
def test12 (_ : Lean.Server.Test.Refs.Test6) : Unit' := .mk
|
||
|
||
def test11 (s : Sum' α β) : Unit' :=
|
||
match s with
|
||
| .left _ => barfoo s
|
||
| .right _ => test12 Lean.Server.Test.Refs.test10
|
||
|
||
def test13 (s : Sum' α β) := test11 s
|
||
--^ outgoingCallHierarchy
|