Skip to content

A logging backend that sends some logs to client #2729

Closed
@eddiemundo

Description

@eddiemundo

#2558 (comment)

For future work, we should have a logging backend that forwards some LSP messages (encoded as JSON values) to the LSP stream for testing invariants.

Which I think is related to #2558 (comment)

let eitherFormatOrInit =
          asum
            [ Left
                <$> satisfyLog
                  ( \case
                      KnownTargets.LogGetSigmaTargetsResult {} -> pure ()
                      _ -> empty
                  )
            , Right <$> responseForId STextDocumentFormatting rid
            ]
    res <- skipManyTill anyMessage eitherFormatOrInit
   ...

How I understand this is we want a Recorder that sends some subset of logs to the client by converting them to JSON, sending them using a custom LSP message, then converting them back to the Log type so we can inspect them in client tests.

I'm not certain how exactly the mechanics of choosing log messages to send will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions