From 6c4e1b37101cbdd5e2b8c8589b5504b09e29bc69 Mon Sep 17 00:00:00 2001 From: Cooper Oh Date: Sun, 11 Aug 2024 10:47:43 +0900 Subject: [PATCH] Revert "Merge pull request #13 from 134130/pycharm-support" This reverts commit e368d9bef4355dbd1a9164f6c6099cd27c6c45fd, reversing changes made to 91d1645f45b4cfdeafa237df49db5a90b30b1efe. --- .idea/gradle.xml | 2 - CHANGELOG.md | 10 --- README.md | 2 +- build.gradle.kts | 2 - gradle.properties | 2 +- .../l34130/mise/notifications/Notification.kt | 14 +--- modules/products/pythoncore/build.gradle.kts | 19 ----- .../PythonCoreRunConfigurationExtension.kt | 77 ------------------- modules/products/pythonid/build.gradle.kts | 19 ----- .../PythonidRunConfigurationExtension.kt | 76 ------------------ settings.gradle.kts | 2 - .../resources/META-INF/mise-pythoncore.xml | 7 -- src/main/resources/META-INF/mise-pythonid.xml | 7 -- src/main/resources/META-INF/plugin.xml | 2 - 14 files changed, 6 insertions(+), 235 deletions(-) delete mode 100644 modules/products/pythoncore/build.gradle.kts delete mode 100644 modules/products/pythoncore/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonCoreRunConfigurationExtension.kt delete mode 100644 modules/products/pythonid/build.gradle.kts delete mode 100644 modules/products/pythonid/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonidRunConfigurationExtension.kt delete mode 100644 src/main/resources/META-INF/mise-pythoncore.xml delete mode 100644 src/main/resources/META-INF/mise-pythonid.xml diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 2e618ddf..96a18ed5 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -13,8 +13,6 @@ diff --git a/CHANGELOG.md b/CHANGELOG.md index db16a0f8..d33499e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,22 +4,12 @@ ## [Unreleased] -## [1.3.0] - 2024-08-03 - -### Added - -- Add environment variables (run configuration) support for the PyCharm Community & Professional - ## [1.2.1] - 2024-07-24 -### Added - - Remove screenshots from plugin.xml. (JetBrains Marketplace guidelines) ## [1.2.0] - 2024-07-21 -### Added - - Add support for the Go SDK (GOROOT) integration from mise tools. ## [1.1.0] - 2024-07-20 diff --git a/README.md b/README.md index 7c80b335..ad51a759 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ from mise config files. see: **[mise-en-place](https://mise.jdx.dev)** - **IntelliJ IDEA** - **GoLand** - **WebStorm** -- **PyCharm** Community & Professional - _Submit issue if you need other IDE_ ### Features @@ -22,6 +21,7 @@ from mise config files. see: **[mise-en-place](https://mise.jdx.dev)** - **JDK Integration**: Set JDK from mise config files. - **Go SDK Integration**: Set Go SDK (GOROOT) from mise config files. + ### Screenshots diff --git a/build.gradle.kts b/build.gradle.kts index 7d330abf..e369b99a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,8 +35,6 @@ dependencies { implementation(project(":mise-products-gradle")) implementation(project(":mise-products-goland")) implementation(project(":mise-products-nodejs")) - implementation(project(":mise-products-pythonid")) - implementation(project(":mise-products-pythoncore")) } // Set the JVM language level used to build the project. diff --git a/gradle.properties b/gradle.properties index 7cb8b0ca..9f95dbd5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ pluginGroup = com.github.l34130.mise pluginName = mise pluginRepositoryUrl = https://github.com/134130/intellij-mise # SemVer format -> https://semver.org -pluginVersion = 1.3.0 +pluginVersion = 1.2.1 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 223 diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/notifications/Notification.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/notifications/Notification.kt index 80990957..31b1d3bf 100644 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/notifications/Notification.kt +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/notifications/Notification.kt @@ -6,16 +6,10 @@ import com.intellij.notification.NotificationType import com.intellij.openapi.project.Project object Notification { - fun notify( - content: String, - type: NotificationType, - project: Project? = null, - ) { - val notification = - NotificationGroupManager - .getInstance() - .getNotificationGroup(NOTIFICATION_GROUP_ID) - .createNotification(content, type) + fun notify(content :String, type: NotificationType, project: Project? = null) { + val notification = NotificationGroupManager.getInstance() + .getNotificationGroup(NOTIFICATION_GROUP_ID) + .createNotification(content, type) notification.icon = PluginIcons.Default notification.notify(project) diff --git a/modules/products/pythoncore/build.gradle.kts b/modules/products/pythoncore/build.gradle.kts deleted file mode 100644 index 9ddec28f..00000000 --- a/modules/products/pythoncore/build.gradle.kts +++ /dev/null @@ -1,19 +0,0 @@ -fun properties(key: String) = project.findProperty(key).toString() - -plugins { - id("org.jetbrains.intellij") - alias(libs.plugins.kotlin) // Kotlin support -} - -// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin -intellij { - version.set(properties("platformVersion")) - type.set("PC") - - // Plugin Dependencies - plugins.set(listOf("PythonCore")) -} - -dependencies { - implementation(project(":mise-core")) -} diff --git a/modules/products/pythoncore/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonCoreRunConfigurationExtension.kt b/modules/products/pythoncore/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonCoreRunConfigurationExtension.kt deleted file mode 100644 index d95c2984..00000000 --- a/modules/products/pythoncore/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonCoreRunConfigurationExtension.kt +++ /dev/null @@ -1,77 +0,0 @@ -package com.github.l34130.mise.runconfigs - -import com.github.l34130.mise.commands.MiseCmd -import com.github.l34130.mise.notifications.Notification -import com.github.l34130.mise.settings.ui.RunConfigurationSettingsEditor -import com.intellij.execution.configurations.GeneralCommandLine -import com.intellij.execution.configurations.RunnerSettings -import com.intellij.notification.NotificationType -import com.intellij.openapi.options.SettingsEditor -import com.intellij.openapi.project.Project -import com.jetbrains.python.run.AbstractPythonRunConfiguration -import com.jetbrains.python.run.PythonExecution -import com.jetbrains.python.run.PythonRunConfigurationExtension -import com.jetbrains.python.run.PythonRunParams -import com.jetbrains.python.run.target.HelpersAwareTargetEnvironmentRequest -import com.jetbrains.python.run.target.PythonCommandLineTargetEnvironmentProvider -import org.jdom.Element - -class PythonCoreRunConfigurationExtension : - PythonRunConfigurationExtension(), - PythonCommandLineTargetEnvironmentProvider { - override fun getEditorTitle(): String = RunConfigurationSettingsEditor.EDITOR_TITLE - - override fun

> createEditor(configuration: P): SettingsEditor

= - RunConfigurationSettingsEditor(configuration) - - override fun getSerializationId(): String = RunConfigurationSettingsEditor.SERIALIZATION_ID - - override fun readExternal( - runConfiguration: AbstractPythonRunConfiguration<*>, - element: Element, - ) { - RunConfigurationSettingsEditor.readExternal(runConfiguration, element) - } - - override fun writeExternal( - runConfiguration: AbstractPythonRunConfiguration<*>, - element: Element, - ) { - RunConfigurationSettingsEditor.writeExternal(runConfiguration, element) - } - - override fun patchCommandLine( - configuration: AbstractPythonRunConfiguration<*>, - runnerSettings: RunnerSettings?, - cmdLine: GeneralCommandLine, - runnerId: String, - ) { - Notification.notify("Patching command line for Pythonid run configuration", NotificationType.INFORMATION) - Notification.notify("${cmdLine.environment}", NotificationType.INFORMATION) - Notification.notify(configuration.getWorkingDirectorySafe(), NotificationType.INFORMATION) - - if (RunConfigurationSettingsEditor.isMiseEnabled(configuration)) { - cmdLine.environment.putAll(MiseCmd.loadEnv(configuration.workingDirectory)) - } - } - - override fun isApplicableFor(configuration: AbstractPythonRunConfiguration<*>): Boolean = true - - override fun isEnabledFor( - applicableConfiguration: AbstractPythonRunConfiguration<*>, - runnerSettings: RunnerSettings?, - ): Boolean = true - - override fun extendTargetEnvironment( - project: Project, - helpersAwareTargetRequest: HelpersAwareTargetEnvironmentRequest, - pythonExecution: PythonExecution, - runParams: PythonRunParams, - ) { - if (runParams is AbstractPythonRunConfiguration<*> && - RunConfigurationSettingsEditor.isMiseEnabled(runParams) - ) { - runParams.setEnvs(MiseCmd.loadEnv(runParams.workingDirectory)) - } - } -} diff --git a/modules/products/pythonid/build.gradle.kts b/modules/products/pythonid/build.gradle.kts deleted file mode 100644 index 621cef72..00000000 --- a/modules/products/pythonid/build.gradle.kts +++ /dev/null @@ -1,19 +0,0 @@ -fun properties(key: String) = project.findProperty(key).toString() - -plugins { - id("org.jetbrains.intellij") - alias(libs.plugins.kotlin) // Kotlin support -} - -// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin -intellij { - version.set(properties("platformVersion")) - type.set("PY") - - // Plugin Dependencies - plugins.set(listOf("Pythonid")) -} - -dependencies { - implementation(project(":mise-core")) -} diff --git a/modules/products/pythonid/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonidRunConfigurationExtension.kt b/modules/products/pythonid/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonidRunConfigurationExtension.kt deleted file mode 100644 index 1a822286..00000000 --- a/modules/products/pythonid/src/main/kotlin/com/github/l34130/mise/runconfigs/PythonidRunConfigurationExtension.kt +++ /dev/null @@ -1,76 +0,0 @@ -package com.github.l34130.mise.runconfigs - -import com.github.l34130.mise.commands.MiseCmd -import com.github.l34130.mise.notifications.Notification -import com.github.l34130.mise.settings.ui.RunConfigurationSettingsEditor -import com.intellij.execution.configurations.GeneralCommandLine -import com.intellij.execution.configurations.RunnerSettings -import com.intellij.notification.NotificationType -import com.intellij.openapi.options.SettingsEditor -import com.intellij.openapi.project.Project -import com.jetbrains.python.run.AbstractPythonRunConfiguration -import com.jetbrains.python.run.PythonExecution -import com.jetbrains.python.run.PythonRunConfigurationExtension -import com.jetbrains.python.run.PythonRunParams -import com.jetbrains.python.run.target.HelpersAwareTargetEnvironmentRequest -import com.jetbrains.python.run.target.PythonCommandLineTargetEnvironmentProvider -import org.jdom.Element - -class PythonidRunConfigurationExtension : - PythonRunConfigurationExtension(), - PythonCommandLineTargetEnvironmentProvider { - override fun getEditorTitle(): String = RunConfigurationSettingsEditor.EDITOR_TITLE - - override fun

> createEditor(configuration: P): SettingsEditor

= - RunConfigurationSettingsEditor(configuration) - - override fun getSerializationId(): String = RunConfigurationSettingsEditor.SERIALIZATION_ID - - override fun readExternal( - runConfiguration: AbstractPythonRunConfiguration<*>, - element: Element, - ) { - RunConfigurationSettingsEditor.readExternal(runConfiguration, element) - } - - override fun writeExternal( - runConfiguration: AbstractPythonRunConfiguration<*>, - element: Element, - ) { - RunConfigurationSettingsEditor.writeExternal(runConfiguration, element) - } - - override fun patchCommandLine( - configuration: AbstractPythonRunConfiguration<*>, - runnerSettings: RunnerSettings?, - cmdLine: GeneralCommandLine, - runnerId: String, - ) { - Notification.notify("Patching command line for Pythonid run configuration", NotificationType.INFORMATION) - Notification.notify("${cmdLine.environment}", NotificationType.INFORMATION) - - if (RunConfigurationSettingsEditor.isMiseEnabled(configuration)) { - cmdLine.environment.putAll(MiseCmd.loadEnv(configuration.workingDirectory)) - } - } - - override fun isApplicableFor(configuration: AbstractPythonRunConfiguration<*>): Boolean = true - - override fun isEnabledFor( - applicableConfiguration: AbstractPythonRunConfiguration<*>, - runnerSettings: RunnerSettings?, - ): Boolean = true - - override fun extendTargetEnvironment( - project: Project, - helpersAwareTargetRequest: HelpersAwareTargetEnvironmentRequest, - pythonExecution: PythonExecution, - runParams: PythonRunParams, - ) { - if (runParams is AbstractPythonRunConfiguration<*> && - RunConfigurationSettingsEditor.isMiseEnabled(runParams) - ) { - runParams.setEnvs(MiseCmd.loadEnv(runParams.workingDirectory)) - } - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts index 2735b39e..16cf7466 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,8 +4,6 @@ include( "modules/products/gradle", "modules/products/goland", "modules/products/nodejs", - "modules/products/pythonid", - "modules/products/pythoncore", ) rootProject.name = "mise" diff --git a/src/main/resources/META-INF/mise-pythoncore.xml b/src/main/resources/META-INF/mise-pythoncore.xml deleted file mode 100644 index 3799632c..00000000 --- a/src/main/resources/META-INF/mise-pythoncore.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/src/main/resources/META-INF/mise-pythonid.xml b/src/main/resources/META-INF/mise-pythonid.xml deleted file mode 100644 index a5ddbca0..00000000 --- a/src/main/resources/META-INF/mise-pythonid.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 4211be78..0c984491 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -23,6 +23,4 @@ com.intellij.gradle org.jetbrains.plugins.go JavaScript - Pythonid - PythonCore