The language server's state, as a struct and pure transitions;
Composer.LSP.Session holds it in a process.
cookbooks- the code cookbooks, discovered without locallocal_dir- the local config directoryroot,project- the host project's directory and app nameencoding- the negotiated position encodingentries- the code cookbooks' completion entries (as in the completion index,Composer.Index)buffers- open documents,%{path => %{uri, text}}uris- the client's URI of each path it opened, to publish withgeneration- per path, bumped by each save; a lint result for an older generation is droppedpublished- the paths whose last published diagnostics were not emptydependents- per saved path, the files last linted with itqueue,running- lints run one at a time; a queued path is queued once
Summary
Functions
Replaces an open document's text (full sync).
Forgets a closed document's text. Its URI is kept for publishing.
Sets the negotiated position encoding.
Queues a lint of path, overtaking any earlier lint of it.
Records the result of the lint of path at generation, returning what
to publish, or :stale when a newer save has overtaken it.
A workspace from cookbooks, local_dir, root, project and entries.
Takes the next lint to run, unless one is running: {:ok, {path, generation, args}, ws}, where args is what
Composer.LSP.Diagnostics.run/2 takes; or {:none, ws}.
Records an opened document.
Swaps in reloaded cookbooks and their completion entries.
What a request needs, read without waiting on lints: the cookbooks, local dir, host, encoding, completion entries and open buffers.
The client's URI for path, or one built from the path.
Types
@type publish() :: [{String.t(), Path.t(), [Composer.Lint.Diagnostic.t()]}]
What to publish: the URI, path and diagnostics of each file.
Functions
Replaces an open document's text (full sync).
Forgets a closed document's text. Its URI is kept for publishing.
@spec encoding(t(), Composer.LSP.Position.encoding()) :: t()
Sets the negotiated position encoding.
Queues a lint of path, overtaking any earlier lint of it.
Records the result of the lint of path at generation, returning what
to publish, or :stale when a newer save has overtaken it.
Every file with diagnostics is published, and so is the saved file and each file whose last published diagnostics were not empty: an empty list clears them.
A workspace from cookbooks, local_dir, root, project and entries.
Takes the next lint to run, unless one is running: {:ok, {path, generation, args}, ws}, where args is what
Composer.LSP.Diagnostics.run/2 takes; or {:none, ws}.
Records an opened document.
Swaps in reloaded cookbooks and their completion entries.
What a request needs, read without waiting on lints: the cookbooks, local dir, host, encoding, completion entries and open buffers.
The client's URI for path, or one built from the path.