commit
ca04975d54
62 files changed
+3381
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <vls/Framing.hpp>
|
||||
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace vls {
|
||||
|
||||
inline constexpr std::string_view server_version = "0.1.0";
|
||||
|
||||
struct DispatchResult {
|
||||
std::optional<std::string> response;
|
||||
std::optional<int> exit_code;
|
||||
};
|
||||
|
||||
class Server {
|
||||
public:
|
||||
[[nodiscard]] DispatchResult handle(std::string_view body);
|
||||
|
||||
private:
|
||||
enum class State { awaiting_initialize, running, shutdown };
|
||||
State state_{State::awaiting_initialize};
|
||||
};
|
||||
|
||||
// Thin transport loop shared by the executable and stream-failure unit tests.
|
||||
[[nodiscard]] int run_stdio(std::istream &input, std::ostream &output, std::ostream &diagnostics,
|
||||
FrameLimits limits = {});
|
||||
|
||||
} // namespace vls
|
||||
Reference in new issue
Block a user