[Jupyter Debugger] PY-63031 The cython installation prompt keeps popping up every debugging attempt

* Added the platform-based action "Don't show again" for the corresponding notification. If this action is invoked, the notification really won't show again.
* Moved the documentation action to the Notification's content to have only 2 actions on this notification card.
* Fixed capitalization in the notification title

GitOrigin-RevId: ec3cb02776c1c4edb1e42a60ce49eca4848a8371
This commit is contained in:
Natalia.Murycheva
2025-04-07 22:49:05 +00:00
committed by intellij-monorepo-bot
parent 689770a5b3
commit 5bc8a9e6f0
3 changed files with 18 additions and 15 deletions
@@ -742,9 +742,9 @@ console.table.failed.to.load=Failed to load:
form.debugger.save.call.signatures=Save call signatures
compile.cython.extensions.title=Compile Cython extensions
compile.cython.extensions.help=How does it work
compile.cython.extensions.help=How does it work<a href=\"https://www.jetbrains.com/help/pycharm/cython-speedups.html\" target=\"_blank\">Learn more \u2197</a>
compile.cython.extensions.install=Install
compile.cython.extensions.notification=Python Debugger Extension Available
compile.cython.extensions.notification=Python debugger extension available
compile.cython.extensions.error=Compile Cython Extensions Error
run.debug.shadowing.name.import.error.title=Looks like {0} shadows standard library file name. This may cause unexpected Run/Debug action behavior
@@ -863,7 +863,7 @@ debugger.dataViewer.switch.between.tables.gotIt.link=Switch mode
debugger.remote.waiting.for.process.connection=Waiting for process connection\u2026
debugger.remote.waiting.for.connection=Waiting for connection
debugger.cython.python.run.configuration.should.be.selected=Python Run Configuration should be selected
debugger.cython.extension.speeds.up.python.debugging=Cython extension speeds up Python debugging
debugger.cython.extension.speeds.up.python.debugging=Cython extension speeds up Python debugging<br><a href=\"https://www.jetbrains.com/help/pycharm/cython-speedups.html\" target=\"_blank\">Learn more \u2197</a>
debugger.cython.extension.permission.denied=Permission denied
debugger.cython.extension.gcc=Command 'gcc' failed with exit status 1
debugger.cython.extension.gcc.failed=\n\nInstall a C compiler in order to build Cython extensions for the debugger.\n
@@ -589,7 +589,7 @@ public class RemoteDebugger implements ProcessDebugger {
}
}
catch (Throwable t) {
// shouldn't interrupt reader thread
// shouldn't interrupt the reader thread
LOG.error(t);
}
}
@@ -8,7 +8,10 @@ import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.execution.process.*;
import com.intellij.execution.util.ExecUtil;
import com.intellij.ide.IdeBundle;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationAction;
import com.intellij.notification.NotificationListener;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -56,8 +59,18 @@ public final class PyCythonExtensionWarning {
PyBundle.message("debugger.cython.extension.speeds.up.python.debugging"),
NotificationType.INFORMATION);
notification.setSuggestionType(true);
notification.setListener(NotificationListener.URL_OPENING_LISTENER);
notification.addAction(createInstallAction(notification, project));
notification.addAction(createDocsAction());
notification.addAction(new NotificationAction(IdeBundle.message("label.dont.show")) {
@Override
public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) {
notification.setDoNotAskFor(null);
notification.expire();
}
});
notification.configureDoNotAskOption("CythonDebuggerExtensionAvailable", PyBundle.message("compile.cython.extensions.notification"));
notification.notify(project);
}
@@ -72,16 +85,6 @@ public final class PyCythonExtensionWarning {
};
}
private static AnAction createDocsAction() {
return new DumbAwareAction(PyBundle.message("compile.cython.extensions.help")) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
HelpManager.getInstance().invokeHelp("Cython_Speedups");
}
};
}
private static boolean shouldSuppressNotification(@NotNull Project project) {
if (ProjectUtil.isNotificationSilentMode(project)) return true;
final RunManager runManager = RunManager.getInstance(project);