Inferred types: in hovers, and as inlay hints

A check keeps what the compiler inferred, through Inference.observe, as
each use of a name with its type there and each binding with the type it
binds. A hover shows (: name type) for a local, and a generic function's
type at the use hovered. Inlay hints show the type after each local name
where it is bound and no type is written.

Hints before the first change since the last check are sent; the ones after
it wait for the check, which then asks the client to ask again. A hover runs
a check that is due first.

🤖 Generated with [ECA](https://eca.dev)

Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
Linus Björnstam 2026-10-22 12:58:19 +02:00
parent cc62a8a360
commit 471b49d9e4
9 changed files with 571 additions and 20 deletions

16
Rpc.fs
View file

@ -80,6 +80,22 @@ let respondError (id: JsonNode) (code: int) (message: string) =
let notify (methodName: string) (parameters: JsonNode) =
write (JsonObject(dict [ "method", JsonValue.Create methodName :> JsonNode; "params", parameters ]))
let mutable private nextRequest = 0
/// A request to the client. Its answer arrives as a message with no method,
/// which the server reads and passes over: nothing it asks for needs one.
let request (methodName: string) (parameters: JsonNode) =
nextRequest <- nextRequest + 1
write (
JsonObject(
dict
[ "id", JsonValue.Create $"bjolang-%d{nextRequest}" :> JsonNode
"method", JsonValue.Create methodName
"params", parameters ]
)
)
/// A line for the server's log, which is stderr: the client shows it, and it
/// never mixes with the protocol on stdout.
let log (message: string) =