LanguageClient: improve the performance of the inspector

... by caching frequently accessed data of the massages.

Change-Id: I0a0a70c404cbc2fd8d26340004a45aa364843055
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-07-13 11:00:14 +02:00
parent 1e20d4a4ee
commit 9c7b4f0a89
2 changed files with 83 additions and 50 deletions

View File

@@ -37,11 +37,26 @@
namespace LanguageClient {
struct LspLogMessage
class LspLogMessage
{
public:
enum MessageSender { ClientMessage, ServerMessage } sender;
LspLogMessage();
LspLogMessage(MessageSender sender,
const QTime &time,
const LanguageServerProtocol::BaseMessage &message);
QTime time;
LanguageServerProtocol::BaseMessage message;
LanguageServerProtocol::MessageId id() const;
QString displayText() const;
QJsonObject &json() const;
private:
mutable Utils::optional<LanguageServerProtocol::MessageId> m_id;
mutable Utils::optional<QString> m_displayText;
mutable Utils::optional<QJsonObject> m_json;
};
struct Capabilities