boolean (@NotNull final RunProfile profile) { if (profile instanceof DebugAwareConfiguration) { // if configuration knows whether debug is allowed return ((DebugAwareConfiguration)profile).canRunUnderDebug(); } if (profile instanceof AbstractPythonRunConfiguration) { // Any python configuration is debuggable return true; } // No even a python configuration return false; }