diff --git a/build.gradle.kts b/build.gradle.kts index fa5524d2..d1742a01 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,8 +29,8 @@ version = pluginVersion plugins { id("java") - kotlin("jvm") version "2.0.21" - id("org.jetbrains.intellij.platform") version "2.1.0" + kotlin("jvm") version "2.1.0" + id("org.jetbrains.intellij.platform") version "2.2.0" id("org.jetbrains.grammarkit") version "2022.3.2.2" id("net.saliman.properties") version "1.5.2" id("de.undercouch.download") version "5.6.0" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c352119..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b..94113f20 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosCommandConfigurationType.kt b/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosCommandConfigurationType.kt index d033eac5..f822581e 100644 --- a/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosCommandConfigurationType.kt +++ b/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosCommandConfigurationType.kt @@ -8,13 +8,12 @@ import org.move.cli.runConfigurations.aptos.cmd.AptosCommandConfigurationFactory import org.move.ide.MoveIcons class AptosCommandConfigurationType: - ConfigurationTypeBase( + AptosConfigurationTypeBase( "AptosCommandConfiguration", "Aptos", "Aptos command execution", - NotNullLazyValue.createConstantValue(MoveIcons.APTOS_LOGO) + MoveIcons.APTOS_LOGO ) { - init { addFactory(AptosCommandConfigurationFactory(this)) } diff --git a/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosConfigurationTypeBase.kt b/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosConfigurationTypeBase.kt new file mode 100644 index 00000000..5c5f54fc --- /dev/null +++ b/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosConfigurationTypeBase.kt @@ -0,0 +1,11 @@ +package org.move.cli.runConfigurations.aptos + +import com.intellij.execution.configurations.ConfigurationTypeBase +import javax.swing.Icon + +abstract class AptosConfigurationTypeBase( + id: String, + displayName: String, + description: String?, + icon: Icon? +): ConfigurationTypeBase(id, displayName, description, icon) \ No newline at end of file diff --git a/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosTransactionConfigurationType.kt b/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosTransactionConfigurationType.kt index ee425d79..e4b0d636 100644 --- a/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosTransactionConfigurationType.kt +++ b/src/main/kotlin/org/move/cli/runConfigurations/aptos/AptosTransactionConfigurationType.kt @@ -8,11 +8,11 @@ import org.move.cli.runConfigurations.aptos.view.ViewCommandConfigurationFactory import org.move.ide.MoveIcons class AptosTransactionConfigurationType : - ConfigurationTypeBase( + AptosConfigurationTypeBase( "AptosTransactionConfiguration", "Aptos Transaction", "Aptos transaction execution", - NotNullLazyValue.createConstantValue(MoveIcons.APTOS_LOGO) + MoveIcons.APTOS_LOGO ) { init { diff --git a/src/main/kotlin/org/move/stdext/Collections.kt b/src/main/kotlin/org/move/stdext/Collections.kt index a66abc98..fa66295f 100644 --- a/src/main/kotlin/org/move/stdext/Collections.kt +++ b/src/main/kotlin/org/move/stdext/Collections.kt @@ -155,8 +155,6 @@ inline fun Iterable.joinToWithBuffer( fun Iterator.nextOrNull(): T? = if (hasNext()) next() else null -fun MutableList.removeLast(): T = removeAt(size - 1) - inline fun > enumSetOf(): EnumSet = EnumSet.noneOf(T::class.java) typealias LookbackValue = Pair diff --git a/src/test/kotlin/org/move/utils/tests/RunConfigurationProducerTestBase.kt b/src/test/kotlin/org/move/utils/tests/RunConfigurationProducerTestBase.kt index dc556dc1..66034a7d 100644 --- a/src/test/kotlin/org/move/utils/tests/RunConfigurationProducerTestBase.kt +++ b/src/test/kotlin/org/move/utils/tests/RunConfigurationProducerTestBase.kt @@ -6,6 +6,7 @@ import com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl import com.intellij.psi.PsiElement import com.intellij.psi.PsiFileSystemItem import org.jdom.Element +import org.move.cli.runConfigurations.aptos.AptosConfigurationTypeBase import org.move.cli.runConfigurations.aptos.cmd.AptosCommandConfiguration import org.move.lang.core.psi.ext.ancestorOrSelf import org.move.openapiext.toXmlString @@ -19,8 +20,8 @@ abstract class RunConfigurationProducerTestBase(val testDir: String): MvProjectT protected fun checkNoConfigurationOnFsItem(fsItem: PsiFileSystemItem) { val configurationContext = ConfigurationContext(fsItem) - val configurations = configurationContext.configurationsFromContext.orEmpty() - check(configurations.isEmpty()) { "Found unexpected run configurations" } + val configurations = configurationContext.aptosConfigurationsFromContext + check(configurations.isEmpty()) { "Found unexpected run configurations $configurations" } } protected inline fun checkOnElement() { @@ -36,7 +37,7 @@ abstract class RunConfigurationProducerTestBase(val testDir: String): MvProjectT ?.ancestorOrSelf() ?: error("Failed to find element of `${T::class.simpleName}` class at caret") val configurationContext = ConfigurationContext(element) - val configurations = configurationContext.configurationsFromContext.orEmpty() + val configurations = configurationContext.aptosConfigurationsFromContext check(configurations.isEmpty()) { "Found unexpected run configurations" } } @@ -93,4 +94,7 @@ abstract class RunConfigurationProducerTestBase(val testDir: String): MvProjectT } } } + + protected val ConfigurationContext.aptosConfigurationsFromContext get() = + this.configurationsFromContext.orEmpty().filter { it.configurationType is AptosConfigurationTypeBase } }