loom
22 строки · 763.0 Байт
1#include "DocDidOpen.h"2#include "simodo/lsp/server/ServerContext.h"3
4#include "simodo/variable/json/Rpc.h"5#include "simodo/variable/json/Serialization.h"6
7namespace simodo::lsp8{
9
10void DocDidOpen::work()11{
12if (_jsonrpc.is_valid() && _jsonrpc.params().type() == variable::ValueType::Object) {13if (_server.openDocument(*_jsonrpc.params().getObject()))14return;15}16_server.log().error("There are wrong parameter structure of 'textDocument/didOpen' notification", variable::toJson(_jsonrpc.value()));17_server.sending().push(18/// @todo Скорректировать коды (и тексты) ошибок19variable::JsonRpc(-1,u"There are wrong parameter structure of 'textDocument/didOpen' notification",-1));20}
21
22}