LanguageClient: Adjust restart limits

Changed restart timer to 2 minutes and max restarts to 5 for restarting
language client after it exits unexpectedly. This avoids disabling the
language client with clangd 14 in situations where it's likely to crash
during normal editing.

Change-Id: I333bb9d67ed1dbba2b52a1cd916f5d1cf3c0b60b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Aaron Barany
2022-08-27 14:21:47 -07:00
parent 454e0bca25
commit 8276bd265b

View File

@@ -177,7 +177,7 @@ public:
});
m_restartCountResetTimer.setSingleShot(true);
m_restartCountResetTimer.setInterval(5 * 60 * 1000);
m_restartCountResetTimer.setInterval(2 * 60 * 1000);
connect(&m_restartCountResetTimer, &QTimer::timeout,
this, [this] { m_restartsLeft = MaxRestarts; });
}
@@ -301,7 +301,7 @@ public:
AssistProviders m_clientProviders;
QMap<TextEditor::TextDocument *, AssistProviders> m_resetAssistProvider;
QHash<TextEditor::TextEditorWidget *, LanguageServerProtocol::MessageId> m_highlightRequests;
static const int MaxRestarts = 2;
static const int MaxRestarts = 5;
int m_restartsLeft = MaxRestarts;
QTimer m_restartCountResetTimer;
InterfaceController *m_clientInterface = nullptr;