Update Server.

This commit is contained in:
ykiko
2024-09-11 17:40:32 +08:00
parent f4461ee53a
commit 90dfc40665
10 changed files with 102 additions and 90 deletions

View File

@@ -2,16 +2,13 @@
#include <Server/Option.h>
#include <Server/Command.h>
#include <Server/Scheduler .h>
#include <Server/Scheduler.h>
#include <Protocol/Protocol.h>
namespace clice {
struct Server {
int argc;
const char** argv;
using Handler = llvm::unique_function<void(json::Value&, json::Value&)>;
using Handler = llvm::unique_function<void(json::Value, json::Value)>;
Option option;
Scheduler scheduler;
@@ -26,6 +23,10 @@ struct Server {
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.