Logo fantomas

LSPFantomasService Module

Types

Type Description

DaemonOperations<'daemon>

How the cache reaches the world. Only the two things it cannot answer for itself: everything a daemon knows about itself is on `IDaemon`.

GetDaemonError

IDaemon

What the cache needs of a daemon it is holding: enough to tell a live one from a crashed one, to start a replacement the way the original was started, and to let one go. This, rather than `RunningFantomasTool`, is what `'daemon` stands for everywhere in this module. It is an interface so that the cache can be exercised without starting a process: everything here is a question about a daemon, and none of it needs the daemon to be a real one.

LSPFantomasService

ServiceState<'daemon>

Which daemon serves which folder. `'daemon` is anything satisfying `IDaemon`; the tool itself uses a `RunningFantomasTool`, and a test uses a record with a flag on it.

Functions and values

Function or value Description

resolveDaemon operations state folder

Full Usage: resolveDaemon operations state folder

Parameters:
Returns: Result<'daemon, GetDaemonError> * ServiceState<'daemon>
Type parameters: 'daemon (requires :> Fantomas.Client.LSPFantomasService.IDaemon)

Hand out the daemon serving `folder`, starting one if no running daemon serves its version yet, along with the cache that leaves behind. Daemons are keyed by version rather than by folder, so two folders that pin the same Fantomas share one process. Never leaves a folder pinned to a version with no daemon behind it, and recovers rather than erroring if it is ever handed a cache in that state.

operations : DaemonOperations<'daemon>
state : ServiceState<'daemon>
folder : Folder
Returns: Result<'daemon, GetDaemonError> * ServiceState<'daemon>

Type something to start searching.