Documentation

Lean.Server.FileWorker.Utils

Tracks diagnostics and incremental diagnostic reporting state for a single document version.

The sticky diagnostics are shared across all document versions via an IO.Ref, while per-version diagnostics are stored directly. The whole state is wrapped in a Std.Mutex on EditableDocumentCore to ensure atomic updates.

Instances For

    A document bundled with processing information. Turned into EditableDocument as soon as the reporter task has been started.

    Instances For

      Appends a sticky diagnostic and marks the next publish as non-incremental. Removes any existing sticky diagnostic whose message.stripTags matches the new one.

      Instances For

        Creates a new EditableDocumentCore for a new document version, sharing the same sticky diagnostics with the previous version.

        Instances For

          Collects diagnostics for a textDocument/publishDiagnostics notification, updates the incremental tracking fields and writes the notification to the client.

          When incrementalDiagnosticSupport is true and the state allows it, sends only the newly added diagnostics with isIncremental? := some true. Otherwise, sends all sticky and non-sticky diagnostics non-incrementally.

          The state update and the write are performed atomically under the diagnostics mutex to prevent reordering between concurrent publishers (the reporter task and the main thread).

          Instances For

            EditableDocumentCore with reporter task.

            Instances For

              Construct a VersionedTextDocumentIdentifier from an EditableDocument -

              Instances For
                Instances For