From 7dd09ea46f9c2419937701b7c61a3cbb08b3224b Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Tue, 1 Nov 2022 18:50:20 +0100 Subject: [PATCH] PY-55889 Execute Python console documentation command with checks for cancellation GitOrigin-RevId: 5d3c71a2b86b1ffe06b357e9e8165eb9d444a9b6 --- .../python/console/PydevConsoleCommunication.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java index 7c2703e4dfe2..2a965b048d42 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java @@ -442,16 +442,15 @@ public abstract class PydevConsoleCommunication extends AbstractConsoleCommunica throw new PyDebuggerException("Documentation in Python Console shouldn't be called from Dispatch Thread!"); } - return executeBackgroundTask( - () -> - { + ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); + indicator.setText(createRuntimeMessage(PyBundle.message("console.getting.documentation"))); + return ApplicationUtil.runWithCheckCanceled( + () -> { final String resultDescription = getPythonConsoleBackendClient().getDescription(text); myPrevNameToDescription = Pair.create(text, resultDescription); return resultDescription; }, - true, - createRuntimeMessage(PyBundle.message("console.getting.documentation")), - "Error when Getting Description in Python Console: "); + indicator); } /**