mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
PY-85634 Move InterpreterSettingsQuickFix to a separate file
GitOrigin-RevId: 1f7710f5403d865fcbab137c46b4004b4cc65dcf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a4113620a0
commit
9069551acf
@@ -19,17 +19,17 @@ import com.intellij.util.concurrency.annotations.RequiresEdt
|
||||
import com.intellij.util.concurrency.annotations.RequiresReadLock
|
||||
import com.intellij.util.ui.FormBuilder
|
||||
import com.jetbrains.python.PyBundle
|
||||
import com.jetbrains.python.sdk.impl.PySdkBundle
|
||||
import com.jetbrains.python.Result
|
||||
import com.jetbrains.python.configuration.PyConfigurableInterpreterList
|
||||
import com.jetbrains.python.errorProcessing.ErrorSink
|
||||
import com.jetbrains.python.errorProcessing.emit
|
||||
import com.jetbrains.python.inspections.interpreter.PyInterpreterInspection
|
||||
import com.jetbrains.python.inspections.interpreter.InterpreterSettingsQuickFix
|
||||
import com.jetbrains.python.projectCreation.createVenvAndSdk
|
||||
import com.jetbrains.python.sdk.PySdkToInstall
|
||||
import com.jetbrains.python.sdk.add.PySdkPathChoosingComboBox
|
||||
import com.jetbrains.python.sdk.add.addBaseInterpretersAsync
|
||||
import com.jetbrains.python.sdk.findBaseSdks
|
||||
import com.jetbrains.python.sdk.impl.PySdkBundle
|
||||
import com.jetbrains.python.sdk.pythonSdk
|
||||
import com.jetbrains.python.statistics.modules
|
||||
import com.jetbrains.python.util.ShowingMessageErrorSync
|
||||
@@ -175,7 +175,7 @@ internal class PythonLangSupport(private val errorSink: ErrorSink = ShowingMessa
|
||||
}
|
||||
val configureCallbackId = LearningUiManager.addCallback {
|
||||
val module = project.modules.singleOrNull()
|
||||
PyInterpreterInspection.InterpreterSettingsQuickFix.showPythonInterpreterSettings(project, module)
|
||||
InterpreterSettingsQuickFix.showPythonInterpreterSettings(project, module)
|
||||
}
|
||||
if (useUserProjects || isLearningProject(project, primaryLanguage)) {
|
||||
showWarning(PythonLessonsBundle.message("no.interpreter.in.learning.project", configureCallbackId),
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.intellij.openapi.util.NlsSafe
|
||||
import com.intellij.openapi.util.UserDataHolderBase
|
||||
import com.intellij.ui.dsl.builder.Panel
|
||||
import com.jetbrains.python.configuration.PyConfigurableInterpreterList
|
||||
import com.jetbrains.python.inspections.interpreter.PyInterpreterInspection
|
||||
import com.jetbrains.python.inspections.interpreter.InterpreterSettingsQuickFix
|
||||
import com.jetbrains.python.sdk.findBaseSdks
|
||||
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor
|
||||
import com.jetbrains.python.sdk.pythonSdk
|
||||
@@ -33,7 +33,7 @@ object PythonLessonsUtil {
|
||||
fun LessonContext.showWarningIfPython3NotFound() {
|
||||
task {
|
||||
val callbackId = LearningUiManager.addCallback {
|
||||
PyInterpreterInspection.InterpreterSettingsQuickFix.showPythonInterpreterSettings(project, project.modules.first())
|
||||
InterpreterSettingsQuickFix.showPythonInterpreterSettings(project, project.modules.first())
|
||||
}
|
||||
stateCheck { isPython3Installed(project) }
|
||||
showWarning(PythonLessonsBundle.message("python.3.required.warning.message", callbackId)) {
|
||||
@@ -42,13 +42,15 @@ object PythonLessonsUtil {
|
||||
}
|
||||
}
|
||||
|
||||
fun prepareFeedbackDataForOnboardingLesson(project: Project,
|
||||
configPropertyName: String,
|
||||
reportTitle: String,
|
||||
feedbackReportId: String,
|
||||
primaryLanguage: LangSupport,
|
||||
lessonEndInfo: LessonEndInfo,
|
||||
usedInterpreterAtStart: String) {
|
||||
fun prepareFeedbackDataForOnboardingLesson(
|
||||
project: Project,
|
||||
configPropertyName: String,
|
||||
reportTitle: String,
|
||||
feedbackReportId: String,
|
||||
primaryLanguage: LangSupport,
|
||||
lessonEndInfo: LessonEndInfo,
|
||||
usedInterpreterAtStart: String,
|
||||
) {
|
||||
if (!shouldCollectFeedbackResults()) {
|
||||
return
|
||||
}
|
||||
@@ -68,6 +70,7 @@ object PythonLessonsUtil {
|
||||
}
|
||||
|
||||
val usedInterpreter = project.pythonSdk?.versionString ?: "none"
|
||||
|
||||
@Suppress("HardCodedStringLiteral", "DialogTitleCapitalization") // a very strange warning report here
|
||||
val startInterpreter = if (usedInterpreterAtStart == usedInterpreter) "same" else usedInterpreterAtStart
|
||||
|
||||
|
||||
Reference in New Issue
Block a user