Re: KDevelop can't load project: "too large document"?

Matthew Woehlke <[email protected]>
Newsgroups gmane.comp.kde.users.kdevelop
Message-ID <[email protected]>
On 2017-12-12 06:55, Aleix Pol wrote:
> If you can narrow down the issue a bit I'll be happy to look into it.

What's to narrow down? At cmakeserver.cpp:150, QJson refuses to parse an
enormous payload, at which point the server goes out to lunch, because
it is waiting on a reply that it will never receive. I already posted a
patch (although it seems it is only enough for KDevelop to limp along
rather than getting totally stuck; the CMake support isn't really able
to recover from a server failure at this time).

The problem can be (artificially) reproduced by applying the attached patch.

-- 
Matthew
reproduce.patch (text/x-patch, 611 B)
diff --git a/plugins/cmake/cmakeserver.cpp b/plugins/cmake/cmakeserver.cpp
index bfdfb6fe02..07e23a0a0b 100644
--- a/plugins/cmake/cmakeserver.cpp
+++ b/plugins/cmake/cmakeserver.cpp
@@ -156,7 +156,9 @@ void CMakeServer::emitResponse(const QByteArray& data)
         doc = QJsonDocument{resp};
     }
     Q_ASSERT(doc.isObject());
-    Q_EMIT response(doc.object());
+    if (!(doc.object().value("type") == "reply" && doc.object().value("inReplyTo") == "codemodel")) {
+        Q_EMIT response(doc.object());
+    }
 }
 
 void CMakeServer::handshake(const KDevelop::Path& source, const KDevelop::Path& build)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.