2017-12-06 03:32:33 +00:00
|
|
|
#include "message_handler.h"
|
|
|
|
|
2017-12-06 04:39:44 +00:00
|
|
|
struct Ipc_TextDocumentDidChange
|
|
|
|
: public IpcMessage<Ipc_TextDocumentDidChange> {
|
|
|
|
const static IpcId kIpcId = IpcId::TextDocumentDidChange;
|
|
|
|
lsTextDocumentDidChangeParams params;
|
|
|
|
};
|
|
|
|
|
|
|
|
MAKE_REFLECT_STRUCT(Ipc_TextDocumentDidChange, params);
|
|
|
|
REGISTER_IPC_MESSAGE(Ipc_TextDocumentDidChange);
|
|
|
|
|
2017-12-06 03:32:33 +00:00
|
|
|
struct TextDocumentDidChangeHandler
|
|
|
|
: BaseMessageHandler<Ipc_TextDocumentDidChange> {
|
|
|
|
void Run(Ipc_TextDocumentDidChange* request) override {
|
|
|
|
std::string path = request->params.textDocument.uri.GetPath();
|
|
|
|
working_files->OnChange(request->params);
|
|
|
|
clang_complete->NotifyEdit(path);
|
|
|
|
clang_complete->DiagnosticsUpdate(
|
|
|
|
request->params.textDocument.AsTextDocumentIdentifier());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
REGISTER_MESSAGE_HANDLER(TextDocumentDidChangeHandler);
|