diff --git a/.github/actions/checkout-intellij-community/action.yaml b/.github/actions/checkout-intellij-community/action.yaml index c680a27..ed2231f 100644 --- a/.github/actions/checkout-intellij-community/action.yaml +++ b/.github/actions/checkout-intellij-community/action.yaml @@ -16,7 +16,7 @@ runs: id: intellij-tag with: repository: JetBrains/intellij-community - regex: ^idea\/222\.4554(?:\.\d+)?$ + regex: ^idea\/232\.10227(?:\.\d+)?$ - name: Checkout intellij-community repository uses: actions/checkout@v4 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ec0d35c..bbb5933 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -39,7 +39,7 @@ jobs: uses: ./.github/actions/checkout-intellij-community - name: Setup Java environment for the next steps - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 @@ -103,7 +103,7 @@ jobs: # Set up Java environment for the next steps - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 @@ -127,7 +127,7 @@ jobs: path: ${{ github.workspace }}/build/reports/tests - name: Add coverage report to PR - uses: mi-kas/kover-report@v1.7 + uses: mi-kas/kover-report@v1.8 if: github.event_name == 'pull_request' with: path: ${{ github.workspace }}/build/reports/kover/report.xml @@ -144,7 +144,7 @@ jobs: # Free GitHub Actions Environment Disk Space - name: Maximize Build Space - uses: jlumbroso/free-disk-space@main + uses: jlumbroso/free-disk-space@v1.3.1 with: tool-cache: false large-packages: false @@ -158,7 +158,7 @@ jobs: # Set up Java environment for the next steps - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index abeda9b..125abc2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: # Set up Java environment for the next steps - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4922cbc..bab0151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ ### Added ### Changed -- Update Kotlin to 1.9.10 -- Update gradle-intellij-plugin to 1.15.0 +- Update Kotlin to 1.9.22 +- Update gradle-intellij-plugin to 1.16.1 +- Update OPENRNDR/ORX to 0.4.4 +- Raise minimum supported IntelliJ version to 2023.2 due to https://youtrack.jetbrains.com/issue/KT-58021 ### Removed diff --git a/README.md b/README.md index c854e6b..6b9ac28 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The plugin tests have a dependency on openrndr-color which unfortunately means i to run the tests. Make sure you check out intellij-community repository to the same tag you're trying to build the plugin against. -So for example, if this plugin is targeting `222.4554.10`, you will need to run `git switch --detach idea/222.4554.10`. +So for example, if this plugin is targeting `232.10227.8`, you will need to run `git switch --detach idea/232.10227.8`. Clone https://github.com/JetBrains/intellij-community ([consult their README](https://github.com/JetBrains/intellij-community#getting-intellij-idea-community-edition-source-code=)) in a directory adjacent to where you cloned this project so the resulting directory layout looks like the following. diff --git a/build.gradle.kts b/build.gradle.kts index da73223..225d86b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,7 +39,7 @@ intellij { pluginName = properties("pluginName") // https://www.jetbrains.com/intellij-repository/releases/ // https://www.jetbrains.com/intellij-repository/snapshots/ - version = "222.4554.10" + version = "232.10227.8" type = "IC" // Target IDE Platform plugins = listOf("com.intellij.java", "org.jetbrains.kotlin") @@ -64,7 +64,7 @@ val defaultIntellijSourcesPath: String = File("$projectDir/../intellij-community tasks { wrapper { - gradleVersion = "8.3" + gradleVersion = "8.5" } val test by getting(Test::class) { @@ -83,7 +83,7 @@ tasks { patchPluginXml { version = properties("pluginVersion") - sinceBuild = "222" + sinceBuild = "232" // No restrictions on compatible IDE versions untilBuild = "" diff --git a/gradle.properties b/gradle.properties index cebbf91..34842df 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ pluginName = OPENRNDR -pluginVersion = 1.1.3 +pluginVersion = 1.1.4 # Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library kotlin.stdlib.default.dependency = false @@ -10,7 +10,5 @@ kotlin.stdlib.default.dependency = false org.gradle.configuration-cache = true # Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html org.gradle.caching = true -# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment -systemProp.org.gradle.unsafe.kotlin.assignment = true # Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom kotlin.incremental.useClasspathSnapshot = false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1d7819a..7848aa5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] -kotlin = "1.9.10" -openrndr = "0.4.3" -orx = "0.4.3" +kotlin = "1.9.22" +openrndr = "0.4.4" +orx = "0.4.4" [libraries] openrndr-color = { group = "org.openrndr", name = "openrndr-color", version.ref = "openrndr" } @@ -10,6 +10,6 @@ orx-color = { group = "org.openrndr.extra", name = "orx-color", version.ref = "o [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -intellij = { id = "org.jetbrains.intellij", version = "1.15.0" } +intellij = { id = "org.jetbrains.intellij", version = "1.16.1" } changelog = { id = "org.jetbrains.changelog", version = "2.2.0" } kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..d64cd49 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 ac72c34..1af9e09 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.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/src/main/kotlin/org/openrndr/plugin/intellij/completion/ColorRGBaCompletionContributor.kt b/src/main/kotlin/org/openrndr/plugin/intellij/completion/ColorRGBaCompletionContributor.kt index 9de8ebf..797c1b4 100644 --- a/src/main/kotlin/org/openrndr/plugin/intellij/completion/ColorRGBaCompletionContributor.kt +++ b/src/main/kotlin/org/openrndr/plugin/intellij/completion/ColorRGBaCompletionContributor.kt @@ -10,7 +10,7 @@ import com.intellij.codeInsight.lookup.LookupElementRenderer import com.intellij.psi.util.PsiTreeUtil import com.intellij.ui.scale.JBUIScale import org.jetbrains.kotlin.descriptors.ValueDescriptor -import org.jetbrains.kotlin.idea.core.completion.DeclarationLookupObject +import org.jetbrains.kotlin.idea.core.completion.DescriptorBasedDeclarationLookupObject import org.jetbrains.kotlin.psi.KtCallExpression import org.jetbrains.kotlin.psi.KtDeclarationWithInitializer import org.openrndr.plugin.intellij.ui.RoundColorIcon @@ -22,7 +22,7 @@ class ColorRGBaCompletionContributor : CompletionContributor() { override fun fillCompletionVariants(parameters: CompletionParameters, result: CompletionResultSet) { result.runRemainingContributors(parameters) { completionResult -> val element = completionResult.lookupElement - val lookupObject = element.`object` as? DeclarationLookupObject + val lookupObject = element.`object` as? DescriptorBasedDeclarationLookupObject val descriptor = (lookupObject?.descriptor as? ValueDescriptor)?.takeIf { it.isColorModelPackage() } ?: return@runRemainingContributors result.passResult(completionResult) val decoratedLookupElement = element.decorateWithIcon(descriptor) diff --git a/src/main/kotlin/org/openrndr/plugin/intellij/editor/ColorRGBaColorProvider.kt b/src/main/kotlin/org/openrndr/plugin/intellij/editor/ColorRGBaColorProvider.kt index e17d046..12b9905 100644 --- a/src/main/kotlin/org/openrndr/plugin/intellij/editor/ColorRGBaColorProvider.kt +++ b/src/main/kotlin/org/openrndr/plugin/intellij/editor/ColorRGBaColorProvider.kt @@ -84,6 +84,7 @@ class ColorRGBaColorProvider : ElementColorProvider { val ref = argumentMap?.firstNotNullOfOrNull { it.takeIf { (p, _) -> p.isRef() }?.value } as? ConstantValueContainer.WhitePoint val colorArguments = colorRGBaDescriptor.argumentsFromColor(color, ref?.value) + @Suppress("SimpleRedundantLet") outerExpression.getChildOfType()?.let { it.replace(it.constructReplacement(resolvedCall.valueArguments, colorArguments)) } ?: outerExpression.getChildOfType()?.let { @@ -107,7 +108,7 @@ class ColorRGBaColorProvider : ElementColorProvider { private fun KtValueArgumentList.constructReplacement( resolvedArgumentMap: Map, replacementArguments: Array ): KtValueArgumentList { - val psiFactory = KtPsiFactory(this) + val psiFactory = KtPsiFactory.contextual(this, true) // It handles overloads where the resolved function call is not the one we want anymore // because it is incapable of expressing the desired color accurately, such as `rgb` with 2 arguments.