forked from qt-creator/qt-creator
LSP: Simplify content parsing
JsonRpcMessageHandler::toJsonObject can be expensive for huge json objects like the clangd ast responses for big c++ files. Avoid calling this function in Request::responseHandler. We already generate a JsonRpcMessage in JsonRpcMessageHandler::parseContent to get the id of the response so pass this around. While at it also pass around references instead of pointers to simplify the memory handling of generated messages. Change-Id: I9a3c7e85428fc064d1ea1197d897739725265192 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -61,17 +61,6 @@ LanguageClientManager::LanguageClientManager(QObject *parent)
|
||||
{
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
JsonRpcMessageHandler::registerMessageProvider<PublishDiagnosticsNotification>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<ApplyWorkspaceEditRequest>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<LogMessageNotification>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<ShowMessageRequest>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<ShowMessageNotification>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<WorkSpaceFolderRequest>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<RegisterCapabilityRequest>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<UnregisterCapabilityRequest>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<WorkDoneProgressCreateRequest>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<ProgressNotification>();
|
||||
JsonRpcMessageHandler::registerMessageProvider<SemanticTokensRefreshRequest>();
|
||||
connect(EditorManager::instance(), &EditorManager::editorOpened,
|
||||
this, &LanguageClientManager::editorOpened);
|
||||
connect(EditorManager::instance(), &EditorManager::documentOpened,
|
||||
|
||||
Reference in New Issue
Block a user