The language server's state process, holding a Composer.LSP.Workspace.
GenLSP runs requests in tasks, so state can't live in the server.
Requests read a snapshot/1; document notifications update it. Lints
and reloads run in tasks the Session starts, one lint at a time, so
hover, goto and completion never wait on them. When a lint or reload
finishes, the Session sends the server:
{:composer_lsp, {:publish, [{uri, path, diagnostics}], encoding}}{:composer_lsp, {:reloaded, {:ok, count} | {:error, message}}}
The Session makes no GenLSP calls.
Options
:server- the pid messages are sent to (required):cookbooks,:local_dir,:root,:project,:entries- the workspace's (seeComposer.LSP.Workspace):lint-fn path, args -> result end, by defaultComposer.LSP.Diagnostics.run/2:discover-fn -> {:ok, cookbooks} | {:error, message} end, run byreload/1, by defaultComposer.LSP.reload_cookbooks/0
Summary
Functions
Replaces a document's text.
Returns a specification to start this module under a supervisor.
Forgets a closed document's text.
Sets the negotiated position encoding.
Records an opened document and lints it from disk.
Recompiles and rediscovers the cookbooks in a task. Returns :ok, or
:running when a reload is already running.
Lints a saved document from disk.
What a request needs; see Composer.LSP.Workspace.snapshot/1.
Starts a Session linked to the caller.
Functions
Replaces a document's text.
Returns a specification to start this module under a supervisor.
See Supervisor.
Forgets a closed document's text.
Sets the negotiated position encoding.
Records an opened document and lints it from disk.
Recompiles and rediscovers the cookbooks in a task. Returns :ok, or
:running when a reload is already running.
Lints a saved document from disk.
What a request needs; see Composer.LSP.Workspace.snapshot/1.
Starts a Session linked to the caller.