From f37de11f09add81465603c5afd1d8d19e8288d6d Mon Sep 17 00:00:00 2001 From: Anton Kucherov Date: Wed, 20 May 2026 00:25:41 +0300 Subject: [PATCH 1/3] Update plugin to support 2026.1 releases Signed-off-by: Anton Kucherov --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6d93c594..240b7db5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,8 +15,8 @@ platformVersion=2025.3.1 psiViewerPluginVersion=253.7181 # see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for more information -sinceBuild=252 -untilBuild=253.* +sinceBuild=253 +untilBuild=261.* # these two variables will be overwritten by the release process (i.e. the GitHub action) thanks to the env variables: # - ORG_GRADLE_PROJECT_publishToken From 79962513a3f99d4017802c8ef59760f542904dae Mon Sep 17 00:00:00 2001 From: Anton Kucherov Date: Tue, 26 May 2026 23:28:50 +0300 Subject: [PATCH 2/3] Update Kotlin version to support 2026.1 releases Signed-off-by: Anton Kucherov --- build.gradle.kts | 2 +- gradle.properties | 2 +- .../org/openpolicyagent/ideaplugin/ide/actions/utils.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8645eeb7..66bc4cc5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,7 +40,7 @@ idea { plugins { idea - kotlin("jvm") version "2.1.20" + kotlin("jvm") version "2.3.20" id("org.jetbrains.intellij.platform.module") version "2.16.0" id("org.jetbrains.grammarkit") version "2022.3.2.2" diff --git a/gradle.properties b/gradle.properties index 240b7db5..6e3bdbeb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ kotlin.code.style=official # platformType=IU # IntelliJ IDEA Ultimate # platformType=PY # PyCharm platformType=IU -platformVersion=2025.3.1 +platformVersion=2026.1.2 # if you update the version of IDE, also change psiViewerPluginVersion # https://plugins.jetbrains.com/plugin/227-psiviewer/versions psiViewerPluginVersion=253.7181 diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/actions/utils.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/actions/utils.kt index 25c53752..c0eb2ab6 100644 --- a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/actions/utils.kt +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/actions/utils.kt @@ -49,7 +49,7 @@ fun getPackageAsString(document: Document, project: Project): String { val file = document.virtualFile ?: return "" val fileView = PsiManager.getInstance(project).findViewProvider(file) ?: return "" val psiTree = fileView.getPsi(RegoLanguage) - val children = psiTree.children + val children = psiTree!!.children for (child in children) { if (child is RegoPackage) { return child.ref.text @@ -65,7 +65,7 @@ fun getImportsAsString(document: Document, project: Project): MutableList() val fileView = PsiManager.getInstance(project).findViewProvider(file) ?: return mutableListOf() val psiTree = fileView.getPsi(RegoLanguage) - val children = psiTree.children + val children = psiTree!!.children var imports = mutableListOf() for (child in children) { if (child is RegoImport) { From 2f4007d23c13d26f5446624be96dcbc8734e4dce Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Wed, 27 May 2026 16:28:57 +0100 Subject: [PATCH 3/3] Fix IntelliJ platform API deprecations - replace runReadAction with ApplicationManager pattern - migrate ProcessAdapter to ProcessListener - update FileTypeDescriptor to FileChooserDescriptor API - isolate fastutil in grammarKitClasspath to prevent runtime conflicts with the platform's bundled version. - Add -jvm-default=no-compatibility to prevent bridge method issues. - Remove redundant null operators. Signed-off-by: Charlie Egan --- build.gradle.kts | 13 ++++++++++--- .../ide/extensions/OPAActionToolWindow.kt | 4 ++-- .../ide/runconfig/ui/OpaEvalRunCommandEditor.kt | 7 +++---- .../ideaplugin/openapiext/CommandLineExt.kt | 7 ++++--- .../ide/runconfig/RunConfigurationTestBase.kt | 5 ++--- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 66bc4cc5..255a5f6b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,6 +65,7 @@ allprojects { all { resolutionStrategy.sortArtifacts(ResolutionStrategy.SortOrder.DEPENDENCY_FIRST) } + create("grammarKitClasspath") } dependencies { @@ -74,7 +75,7 @@ allprojects { exclude("org.jetbrains.kotlin") } testImplementation("org.assertj:assertj-core:3.24.2") - implementation("it.unimi.dsi:fastutil:8.5.12") + "grammarKitClasspath"("it.unimi.dsi:fastutil:8.5.12") intellijPlatform { create(platformType, platformVersion) @@ -206,9 +207,10 @@ project(":") { purgeOldFiles.set(true) } - // Ensure fastutil is available for grammar-kit tasks + // fastutil is needed by GrammarKit but must not be in implementation — it conflicts with the + // platform's bundled version at test runtime, causing NoSuchMethodError in every test. tasks.withType { - classpath = configurations.compileClasspath.get() + classpath = configurations.compileClasspath.get() + configurations["grammarKitClasspath"] } tasks.withType { @@ -216,6 +218,11 @@ project(":") { generateRegoLexer, generateRegoParser ) + compilerOptions { + // prevents Kotlin from generating bridge stubs for interface default methods, + // which the plugin verifier flags as deprecated API overrides + freeCompilerArgs.add("-jvm-default=no-compatibility") + } } } diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/extensions/OPAActionToolWindow.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/extensions/OPAActionToolWindow.kt index 056d9bca..a312acb7 100644 --- a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/extensions/OPAActionToolWindow.kt +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/extensions/OPAActionToolWindow.kt @@ -106,7 +106,7 @@ class OPAActionToolWindow { //if the tool window currently has a console view with the same opa task //in it, remove the old console before creating a new one - val existing = toolWindow.contentManager.findContent(title) ?: null + val existing = toolWindow.contentManager.findContent(title) if (existing != null) { toolWindow.contentManager.removeContent(existing, true) } @@ -131,7 +131,7 @@ class OPAActionToolWindow { val consoleContent = ContentImpl(consoleView.component, title, false) //the tool window shouldn't have two consoles with the sdame title (task) - val existing = toolWindow.contentManager.findContent(title) ?: null + val existing = toolWindow.contentManager.findContent(title) if (existing != null) { toolWindow.contentManager.removeContent(existing, true) } diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/ui/OpaEvalRunCommandEditor.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/ui/OpaEvalRunCommandEditor.kt index 2cf0a794..83e01ec9 100644 --- a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/ui/OpaEvalRunCommandEditor.kt +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/ui/OpaEvalRunCommandEditor.kt @@ -7,7 +7,6 @@ package org.openpolicyagent.ideaplugin.ide.runconfig.ui import com.intellij.execution.configuration.EnvironmentVariablesComponent import com.intellij.openapi.fileChooser.FileChooserDescriptor -import com.intellij.openapi.fileChooser.FileTypeDescriptor import com.intellij.openapi.options.SettingsEditor import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ProjectRootManager @@ -31,10 +30,10 @@ class OpaEvalRunCommandEditor(private val project: Project) : SettingsEditor) = @@ -88,7 +88,6 @@ class AnsiAwareCapturingProcessAdapter : ProcessAdapter() { output.appendStdout(event.text) } - override fun processTerminated(event: ProcessEvent) { output.exitCode = event.exitCode }