in src/main/kotlin/com/jetbrains/micropython/run/MicroPythonRunConfiguration.kt [99:130]
override fun checkConfiguration() {
super.checkConfiguration()
if (StringUtil.isEmpty(path)) {
throw RuntimeConfigurationError("Path is not specified")
}
val m = module ?: throw RuntimeConfigurationError("Module for path is not found")
val showSettings = Runnable {
when {
PlatformUtils.isPyCharm() ->
ShowSettingsUtil.getInstance().showSettingsDialog(project, MicroPythonProjectConfigurable::class.java)
PlatformUtils.isIntelliJ() ->
ProjectSettingsService.getInstance(project).openModuleSettings(module)
else ->
ShowSettingsUtil.getInstance().showSettingsDialog(project)
}
}
val facet = m.microPythonFacet ?: throw RuntimeConfigurationError(
"MicroPython support is not enabled for selected module in IDE settings",
showSettings
)
val validationResult = facet.checkValid()
if (validationResult != ValidationResult.OK) {
val runQuickFix = Runnable {
validationResult.quickFix.run(null)
}
throw RuntimeConfigurationError(validationResult.errorMessage, runQuickFix)
}
facet.pythonPath ?: throw RuntimeConfigurationError("Python interpreter is not found")
if (!facet.autoDetectDevicePath && facet.devicePath == null) {
throw RuntimeConfigurationError("Device path is not specified in IDE settings", showSettings)
}
}