Files
clice/include/Server/Server.h
2024-10-18 11:32:08 +08:00

34 lines
770 B
C++

#pragma once
#include <Server/Scheduler.h>
#include <Protocol/Protocol.h>
namespace clice {
struct Server {
using Handler = llvm::unique_function<void(json::Value, json::Value)>;
Scheduler scheduler;
llvm::StringMap<Handler> handlers;
static Server instance;
Server();
int run(int argc, const char** argv);
void handleMessage(std::string_view message);
void notify();
void response(json::Value id, json::Value result);
public:
// LSP methods, if the return type is void, the method is used for notification.
// otherwise, the method is used for request.
auto initialize(proto::InitializeParams params) -> proto::InitializeResult;
void initialized(proto::InitializedParams params);
};
} // namespace clice