PY-55889 Execute Python console documentation command with checks for cancellation

GitOrigin-RevId: 5d3c71a2b86b1ffe06b357e9e8165eb9d444a9b6
This commit is contained in:
Elizaveta Shashkova
2022-11-01 18:50:20 +01:00
committed by intellij-monorepo-bot
parent 9a38539ba8
commit 7dd09ea46f

View File

@@ -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);
}
/**