diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62f89ab..eef61d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,11 +18,18 @@ jobs: version: ${{ steps.properties.outputs.version }} changelog: ${{ steps.properties.outputs.changelog }} steps: + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + - name: Check out - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 - name: Download Lama Cache - uses: actions/cache@v2 + uses: actions/cache@v3 id: opam-cache with: path: | @@ -101,10 +108,10 @@ jobs: limactl copy default:~/opam_cache.tar.xz ~/opam_cache.tar.xz - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.4 + uses: gradle/wrapper-validation-action@v1.0.6 - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: liberica java-version: 17 @@ -118,14 +125,14 @@ jobs: VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - echo "::set-output name=version::$VERSION" - echo "::set-output name=name::$NAME" - echo "::set-output name=changelog::$CHANGELOG" - echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "name=$NAME" >> $GITHUB_OUTPUT + echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT + + echo "changelog<> $GITHUB_OUTPUT + echo "$CHANGELOG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier @@ -134,13 +141,13 @@ jobs: - name: Collect Tests Result if: ${{ failure() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: tests-result path: ${{ github.workspace }}/build/reports/tests - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3 with: path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} @@ -150,14 +157,14 @@ jobs: - name: Collect Plugin Verifier Result if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pluginVerifier-result path: ${{ github.workspace }}/build/reports/pluginVerifier - name: Qodana - Code Inspection if: ${{ matrix.os == 'ubuntu-latest' }} - uses: JetBrains/qodana-action@v4.2.5 + uses: JetBrains/qodana-action@v2023.1.5 - name: Prepare Plugin Artifact id: artifact @@ -168,11 +175,11 @@ jobs: FILENAME=`ls *.zip` unzip "$FILENAME" -d content - echo "::set-output name=filename::${FILENAME:0:-4}" + echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT - name: Upload artifact if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v3 with: name: ${{ steps.artifact.outputs.filename }} path: ./build/distributions/content/*/* @@ -184,7 +191,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 - name: Remove Old Release Drafts env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5137cc4..3d7986a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 with: ref: ${{ github.event.release.tag_name }} - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: liberica java-version: 17 @@ -30,11 +30,9 @@ jobs: EOM )" - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - - echo "::set-output name=changelog::$CHANGELOG" + echo "changelog<> $GITHUB_OUTPUT + echo "$CHANGELOG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: Patch Changelog if: ${{ steps.properties.outputs.changelog != '' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 96bd6d7..d8966c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ # LamaPlugin Changelog ## [Unreleased] +- Support 2023.2 EAP ## [0.2.5] - 2022-12-26 diff --git a/build.gradle.kts b/build.gradle.kts index 8a4e138..da3cad2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,10 +6,10 @@ fun properties(key: String) = project.findProperty(key).toString() plugins { id("java") - id("org.jetbrains.kotlin.jvm") version "1.7.22" - id("org.jetbrains.intellij") version "1.11.0" - id("org.jetbrains.changelog") version "2.0.0" - id("org.jetbrains.qodana") version "0.1.13" + alias(libs.plugins.kotlin) + alias(libs.plugins.gradleIntelliJPlugin) + alias(libs.plugins.changelog) + alias(libs.plugins.qodana) } group = properties("pluginGroup") diff --git a/gradle.properties b/gradle.properties index ff161f0..0806f13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,24 +3,31 @@ pluginGroup=org.jetbrains.lama pluginName=Lama pluginRepositoryUrl = https://github.com/Mervap/LamaPlugin -pluginVersion=0.2.5 +pluginVersion=0.2.6 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. pluginSinceBuild=222 -pluginUntilBuild=231.* +pluginUntilBuild=232.* -# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties +# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType=IC platformVersion=2022.2 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 platformPlugins = -gradleVersion=7.5.1 -# 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" +gradleVersion=8.1.1 +# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib kotlin.stdlib.default.dependency=false # Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html -org.gradle.unsafe.configuration-cache = true \ No newline at end of file +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 new file mode 100644 index 0000000..04515f6 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,20 @@ +[versions] +# libraries +annotations = "24.0.1" + +# plugins +dokka = "1.8.10" +kotlin = "1.8.21" +changelog = "2.1.0" +gradleIntelliJPlugin = "1.14.1" +qodana = "0.1.13" + +[libraries] +annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" } + +[plugins] +changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" } +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..c1962a7 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 ae04661..37aef8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# 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"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -143,12 +140,16 @@ fi 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 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +194,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/gradlew.bat b/gradlew.bat index f127cfd..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/src/main/kotlin/org/jetbrains/lama/editor/LamaContextType.kt b/src/main/kotlin/org/jetbrains/lama/editor/LamaContextType.kt index d1782ce..33c108b 100755 --- a/src/main/kotlin/org/jetbrains/lama/editor/LamaContextType.kt +++ b/src/main/kotlin/org/jetbrains/lama/editor/LamaContextType.kt @@ -1,12 +1,12 @@ package org.jetbrains.lama.editor import com.intellij.codeInsight.template.FileTypeBasedContextType -import com.intellij.psi.PsiFile +import com.intellij.codeInsight.template.TemplateActionContext import org.jetbrains.lama.psi.LamaFileType import org.jetbrains.lama.psi.LamaLanguage class LamaContextType : FileTypeBasedContextType("Lama", "&Lama", LamaFileType) { - override fun isInContext(file: PsiFile, offset: Int): Boolean { - return file.language.isKindOf(LamaLanguage) + override fun isInContext(templateActionContext: TemplateActionContext): Boolean { + return templateActionContext.file.language.isKindOf(LamaLanguage) } } \ No newline at end of file