aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythonlanguageclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
-rw-r--r--src/plugins/python/pythonlanguageclient.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp
index a43227a1500..eab9cb9dbe8 100644
--- a/src/plugins/python/pythonlanguageclient.cpp
+++ b/src/plugins/python/pythonlanguageclient.cpp
@@ -411,22 +411,29 @@ void PyLSConfigureAssistant::handlePyLSState(const FilePath &python,
auto message = Tr::tr("Update Python language server (PyLS) for %1 (%2).")
.arg(pythonName(python), python.toUserOutput());
InfoBarEntry info(updatePylsInfoBarId, message);
- info.addCustomButton(Tr::tr("Always Update"), [this, python, document, state] {
- document->infoBar()->removeInfo(updatePylsInfoBarId);
- Core::ICore::settings()->setValue(alwaysUpdateKey, true);
- InfoBar::globallySuppressInfo(updatePylsInfoBarId);
- installPythonLanguageServer(python, document, state.pylsModulePath, false, true);
- });
- info.addCustomButton(Tr::tr("Update"), [this, python, document, state] {
- document->infoBar()->removeInfo(updatePylsInfoBarId);
- installPythonLanguageServer(python, document, state.pylsModulePath, false, true);
- });
- info.addCustomButton(Tr::tr("Never"), [document, python] {
- document->infoBar()->removeInfo(updatePylsInfoBarId);
- InfoBar::globallySuppressInfo(updatePylsInfoBarId);
- if (auto client = clientForPython(python))
- LanguageClientManager::openDocumentWithClient(document, client);
- });
+ info.addCustomButton(
+ Tr::tr("Always Update"),
+ [this, python, document, state] {
+ Core::ICore::settings()->setValue(alwaysUpdateKey, true);
+ installPythonLanguageServer(python, document, state.pylsModulePath, false, true);
+ },
+ {},
+ InfoBarEntry::ButtonAction::SuppressPersistently);
+ info.addCustomButton(
+ Tr::tr("Update"),
+ [this, python, document, state] {
+ installPythonLanguageServer(python, document, state.pylsModulePath, false, true);
+ },
+ {},
+ InfoBarEntry::ButtonAction::Hide);
+ info.addCustomButton(
+ Tr::tr("Never"),
+ [document, python] {
+ if (auto client = clientForPython(python))
+ LanguageClientManager::openDocumentWithClient(document, client);
+ },
+ {},
+ InfoBarEntry::ButtonAction::SuppressPersistently);
info.setCancelButtonInfo([python, document]{
if (auto client = clientForPython(python))
LanguageClientManager::openDocumentWithClient(document, client);