diff --git a/gradle.properties b/gradle.properties index 6c0870a..c3f835c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ kotlin.code.style=official baseIDE=idea # if you change the version of ide, also change psiViewerPluginVersion accordingly (cf https://plugins.jetbrains.com/plugin/227-psiviewer/versions) -ideaVersion=IC-2023.3 +ideaVersion=IU-2023.3.5 pycharmCommunityVersion=PC-2023.3 psiViewerPluginVersion=233.2 @@ -30,4 +30,5 @@ enableBuildSearchableOptions=false # Opt-out flag for bundling Kotlin standard library. # See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details. # suppress inspection "UnusedProperty" -kotlin.stdlib.default.dependency = false \ No newline at end of file +kotlin.stdlib.default.dependency = false +kotlin.incremental.useClasspathSnapshot=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..033e24c 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 3a47f67..a80b22c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists \ No newline at end of file +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..fcb6fca 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# 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"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then done 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 diff --git a/plugin/src/main/resources/META-INF/plugin.xml b/plugin/src/main/resources/META-INF/plugin.xml index 376c7c3..53be57d 100644 --- a/plugin/src/main/resources/META-INF/plugin.xml +++ b/plugin/src/main/resources/META-INF/plugin.xml @@ -24,6 +24,7 @@ on how to target different products --> com.intellij.modules.platform com.intellij.modules.lang + com.intellij.modules.ultimate diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/lsp/RegalLsp.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/lsp/RegalLsp.kt new file mode 100644 index 0000000..9bcd2a2 --- /dev/null +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/lsp/RegalLsp.kt @@ -0,0 +1,27 @@ +/* + * Use of this source code is governed by the MIT license that can be + * found in the LICENSE file. + */ + +package org.openpolicyagent.ideaplugin.ide.lsp + +import com.intellij.execution.configurations.GeneralCommandLine +import com.intellij.openapi.project.Project +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.platform.lsp.api.LspServerSupportProvider +import com.intellij.platform.lsp.api.ProjectWideLspServerDescriptor +import org.openpolicyagent.ideaplugin.lang.psi.isRegoFile + + +internal class RegalLspServerSupportProvider : LspServerSupportProvider { + override fun fileOpened(project: Project, file: VirtualFile, serverStarter: LspServerSupportProvider.LspServerStarter) { + if (file.isRegoFile) { + serverStarter.ensureServerStarted(RegalLspServerDescriptor(project)) + } + } +} + +private class RegalLspServerDescriptor(project: Project) : ProjectWideLspServerDescriptor(project, "Foo") { + override fun isSupportedFile(file: VirtualFile) = file.isRegoFile + override fun createCommandLine() = GeneralCommandLine("/usr/local/bin/regal", "language-server") +} \ No newline at end of file diff --git a/src/main/resources/META-INF/opa-core.xml b/src/main/resources/META-INF/opa-core.xml index ae140ab..5e6c7ba 100644 --- a/src/main/resources/META-INF/opa-core.xml +++ b/src/main/resources/META-INF/opa-core.xml @@ -53,7 +53,10 @@ displayName="Open Policy Agent" instance="org.openpolicyagent.ideaplugin.opa.project.settings.OpaOptionsConfigurable"/> - + + + +