| 111 | } |
| 112 | |
| 113 | std::shared_ptr<lsp::Serializable> LSPHandle::OnDidChange( |
| 114 | std::shared_ptr<lsp::DidChangeTextDocumentParams> params) { |
| 115 | if (params->contentChanges.size() == 1) { |
| 116 | auto &content = params->contentChanges.front(); |
| 117 | if (content.range.has_value()) { |
| 118 | _server->GetVFS().UpdateFile(params->textDocument.uri, content.range.value(), |
| 119 | std::move(content.text)); |
| 120 | } else { |
| 121 | _server->GetVFS().UpdateFile(params->textDocument.uri, |
| 122 | std::move(content.text)); |
| 123 | } |
| 124 | } else { |
| 125 | _server->GetVFS().UpdateFile(params->textDocument.uri, params->contentChanges); |
| 126 | } |
| 127 | |
| 128 | return nullptr; |
| 129 | } |
| 130 | |
| 131 | std::shared_ptr<lsp::Serializable> LSPHandle::OnDidOpen( |
| 132 | std::shared_ptr<lsp::DidOpenTextDocumentParams> params) { |
nothing calls this directly
no test coverage detected