Found by clangd-fuzzer.
llvm-svn: 316652
void ClangdLSPServer::onDocumentDidChange(Ctx C,
DidChangeTextDocumentParams &Params) {
+ if (Params.contentChanges.size() != 1)
+ return C.replyError(-32602, "can only apply one change at a time");
// We only support full syncing right now.
Server.addDocument(Params.textDocument.uri.file,
Params.contentChanges[0].text);
\r
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///main.cpp","languageId":"cpp","version":1,"text":"struct fake { int a, bb, ccc; int f(int i, const float f) const; };\nint main() {\n fake f;\n f.\n}\n"}}}\r
\r
+Content-Length: 104\r
+\r
+{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///main.cpp"}}}\r
+\r
Content-Type: application/vscode-jsonrpc; charset-utf-8\r
Content-Length: 146\r
\r