loom
29 строк · 1.1 Кб
1#include "SegmentationFault.h"
2#include "simodo/lsp-server/ServerContext.h"
3#include "simodo/lsp-server/DocumentContext.h"
4
5#include "simodo/variable/json/Rpc.h"
6#include "simodo/variable/json/Serialization.h"
7
8namespace simodo::lsp
9{
10
11void SegmentationFault::work()
12{
13if (_jsonrpc.is_valid()) {
14lsp::TextDocumentPositionParams doc_position;
15DocumentContext * doc = _server.findDocument(doc_position.textDocument.uri);
16variable::Value result = doc->produceHoverResponse(doc_position.position);
17
18_server.sending().push(variable::JsonRpc(result, _jsonrpc.id()));
19return;
20}
21_server.log().error("There are wrong parameter structure of 'SegmentationFault' command",
22variable::toJson(_jsonrpc.value()));
23_server.sending().push(
24/// @todo Скорректировать коды (и тексты) ошибок
25variable::JsonRpc(-1,u"There are wrong parameter structure of 'SegmentationFault' command",
26_jsonrpc.id()));
27}
28
29}