| 1 |
#pragma once |
| 2 |
#include <string> |
| 3 |
#include <functional> |
| 4 |
|
| 5 |
namespace lsp |
| 6 |
{ |
| 7 |
/// The encoding style of the JSON-RPC messages (both input and output). |
| 8 |
enum JSONStreamStyle |
| 9 |
{ |
| 10 |
/// Encoding per the LSP specification, with mandatory Content-Length header. |
| 11 |
Standard, |
| 12 |
/// Messages are delimited by a '// -----' line. Comment lines start with //. |
| 13 |
Delimited |
| 14 |
}; |
| 15 |
} // namespace lsp |
| 16 |
class MessageProducer |
| 17 |
{ |
| 18 |
public: |
| 19 |
typedef std::function<void(std::string&&)> MessageConsumer; |
| 20 |
virtual ~MessageProducer() = default; |
| 21 |
virtual void listen(MessageConsumer) = 0; |
| 22 |
}; |