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.
98 lines
2.1 KiB
Text
98 lines
2.1 KiB
Text
import Std.Data.HashSet
|
|
|
|
structure S' where
|
|
foo : Nat
|
|
bar : Nat
|
|
|
|
structure S extends S' where
|
|
foobar : Nat
|
|
barfoo : Nat
|
|
|
|
example : S where -- No completions expected
|
|
--^ completion
|
|
|
|
example : S where -- All field completions expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
-- All field completions expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
f -- All field completions matching `f` expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
foo -- All field completions matching `foo` expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
foo := -- No completions expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
foo :=
|
|
-- No completions expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
foo := 1
|
|
-- All field completions expected
|
|
--^ completion
|
|
|
|
example : S where
|
|
foo := 1; -- All field completions expected
|
|
--^ completion
|
|
|
|
example : S := { } -- All field completions expected
|
|
--^ completion
|
|
|
|
example : S := {
|
|
-- All field completions expected
|
|
--^ completion
|
|
}
|
|
|
|
example : S := {
|
|
f -- All field completions matching `f` expected
|
|
--^ completion
|
|
}
|
|
|
|
example : S := {
|
|
foo -- All field completions matching `foo` expected
|
|
--^ completion
|
|
}
|
|
|
|
example : S := {
|
|
foo :=
|
|
-- No completions expected
|
|
--^ completion
|
|
}
|
|
|
|
example : S := {
|
|
foo := 1
|
|
-- All field completions expected
|
|
--^ completion
|
|
}
|
|
|
|
example : S :=
|
|
{ foo := 1
|
|
} -- All field completions expected
|
|
--^ completion
|
|
|
|
|
|
example : S := { foo := 1, } -- All field completions expected
|
|
--^ completion
|
|
|
|
example (s : S) : S := { s with } -- All field completions expected
|
|
--^ completion
|
|
|
|
example (s : S) : S := { s with : S } -- All field completions expected
|
|
--^ completion
|
|
|
|
example (s : S) : S := { s with f } -- All field completions matching `f` expected
|
|
--^ completion
|
|
|
|
def aLongUniqueIdentifier := 0
|
|
|
|
example : Std.HashSet Nat := { aLongUniqueIdentifier } -- Identifier completion matching `aLongUniqueIdentifier`
|
|
--^ completion
|