浏览代码

upgrade with API Level 2024.3

windchargerj 10 月之前
父节点
当前提交
3fa38433bb

+ 4 - 3
build.gradle.kts

@@ -29,7 +29,7 @@ val buildIdeType: String = when (2) {
     else -> "IC"
 }
 
-val buildIdeVersion = "2024.2"
+val buildIdeVersion = "2024.3"
 
 val runIdeType: String = when (2) {
     0 -> "IC" // You can build with the Ultimate version, but run with the Community version.
@@ -39,7 +39,7 @@ val runIdeType: String = when (2) {
     else -> "IC"
 }
 
-val runIdeVersion = "2024.2"
+val runIdeVersion = "2024.3"
 
 plugins {
     id("java")
@@ -105,7 +105,8 @@ tasks {
             listOf(
                 "2023.3",
                 "2024.1",
-                "2024.2"
+                "2024.2",
+                "2024.3"
             )
         )
     }

+ 2 - 2
gradle.properties

@@ -1,6 +1,6 @@
 pluginVersion=1.4.2
-pluginSinceBuild=233.11799.238
-pluginUntilBuild=242.*
+pluginSinceBuild=243.21565.193
+pluginUntilBuild=243.*
 
 # Opt-out flag for bundling Kotlin standard library.
 # See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.

+ 4 - 3
src/main/kotlin/io/xmake/project/directory/ui/DirectoryBrowser.kt

@@ -23,11 +23,11 @@ class DirectoryBrowser(val project: Project?) : TextFieldWithBrowseButton() {
     private fun createLocalBrowseListener(): ActionListener {
         val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
         val browseFolderListener = BrowseFolderActionListener(
-            "Working Directory",
-            null,
             this,
             project,
-            fileChooserDescriptor,
+            fileChooserDescriptor
+                .withTitle("Working Directory")
+                .withDescription("Select the working directory"),
             TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
         )
         return browseFolderListener
@@ -64,6 +64,7 @@ class DirectoryBrowser(val project: Project?) : TextFieldWithBrowseButton() {
                 listeners.add(wslBrowseListener)
                 Log.debug("addActionListener wsl: $wslBrowseListener")
             }
+
             SSH -> {
                 EP_NAME.extensions.first { it.KEY == "SSH" }.let { extension ->
                     println("host: $host")

+ 6 - 2
src/main/kotlin/io/xmake/project/wizard/NewProjectWizardDirectoryGeneratorAdapter.kt

@@ -5,6 +5,7 @@
  * - Changed class from final to open
  * - Date: 2024-08-07
  * - Author: windchargerj
+ * - Reference: [com.jetbrains.python.newProject.NewProjectWizardDirectoryGeneratorAdapter]
  */
 
 package io.xmake.project.wizard
@@ -16,6 +17,7 @@ import com.intellij.ide.wizard.GeneratorNewProjectWizard
 import com.intellij.ide.wizard.NewProjectWizardStepPanel
 import com.intellij.openapi.module.Module
 import com.intellij.openapi.project.Project
+import com.intellij.openapi.ui.TextFieldWithBrowseButton
 import com.intellij.openapi.ui.VerticalFlowLayout
 import com.intellij.openapi.vfs.VirtualFile
 import com.intellij.platform.DirectoryProjectGeneratorBase
@@ -26,6 +28,8 @@ import javax.swing.JButton
 import javax.swing.JComponent
 import javax.swing.JPanel
 
+// Todo: Refactor to transform a project wizard to a [com.intellij.platform.DirectoryProjectGenerator] directly.
+
 /**
  * A base adapter class to turn a [GeneratorNewProjectWizard] into a
  * [com.intellij.platform.DirectoryProjectGenerator] and register as an extension point.
@@ -47,7 +51,7 @@ open class NewProjectWizardDirectoryGeneratorAdapter<T : Any>(val wizard: Genera
     override fun createPeer(): ProjectGeneratorPeer<T> {
         val context = WizardContext(null) {}
         return object : GeneratorPeerImpl<T>() {
-            override fun getComponent(): JComponent {
+            override fun getComponent(myLocationField: TextFieldWithBrowseButton, checkValid: Runnable): JComponent {
                 panel = NewProjectWizardStepPanel(wizard.createStep(context))
                 return panel.component
             }
@@ -68,7 +72,7 @@ open class NewProjectWizardProjectSettingsStep<T : Any>(private val projectGener
 
     override fun createAndFillContentPanel(): JPanel =
         JPanel(VerticalFlowLayout()).apply {
-            add(peer.component)
+            add(peer.getComponent(TextFieldWithBrowseButton()) {})
         }
 
     override fun registerValidators() {}

+ 2 - 4
src/main/kotlin/io/xmake/utils/extension/SshToolkitHostExtensionImpl.kt

@@ -5,7 +5,6 @@ import com.intellij.execution.configurations.GeneralCommandLine
 import com.intellij.openapi.application.EDT
 import com.intellij.openapi.application.runWriteAction
 import com.intellij.openapi.diagnostic.logger
-import com.intellij.openapi.diagnostic.runAndLogException
 import com.intellij.openapi.progress.ProgressIndicator
 import com.intellij.openapi.progress.ProgressManager
 import com.intellij.openapi.progress.Task
@@ -88,13 +87,12 @@ class SshToolkitHostExtensionImpl : ToolkitHostExtension {
                         when (direction) {
                             SyncDirection.LOCAL_TO_UPSTREAM -> {
 
-                                Log.runAndLogException {
+                                Log.runCatching {
                                     tryRunWithException<SftpChannelNoSuchFileException, List<SftpChannel.FileInfo>> {
                                         sftpChannel.ls(
                                             remoteDirectory
                                         )
-                                    }
-                                        .also { Log.info("before: $it") }
+                                    }.also { Log.info("before: $it") }
                                     sftpChannel.rmRecur(remoteDirectory)
                                     Log.info("after: " + sftpChannel.ls("Project"))
                                 }