diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b003545..d757ec0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ name: Build - on: + # Trigger the workflow on pushes to only the 'master' branch (this avoids duplicate checks being run e.g., for dependabot pull requests) push: branches: [ master ] + # Trigger the workflow on any pull request pull_request: concurrency: @@ -11,30 +12,32 @@ concurrency: jobs: - # Prepare environment and build the plugin + # Prepare the environment and build the plugin build: name: Build runs-on: ubuntu-latest outputs: version: ${{ steps.properties.outputs.version }} changelog: ${{ steps.properties.outputs.changelog }} - pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} steps: + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + large-packages: false + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Validate wrapper - - name: Gradle Wrapper Validation - uses: gradle/actions/wrapper-validation@v3 - - # Set up Java environment for the next steps + # Set up the Java environment for the next steps - name: Setup Java uses: actions/setup-java@v4 with: distribution: zulu - java-version: 17 + java-version: 21 # Setup Gradle - name: Setup Gradle @@ -50,8 +53,6 @@ jobs: CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT - echo "changelog<> $GITHUB_OUTPUT echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -60,7 +61,7 @@ jobs: - name: Build plugin run: ./gradlew buildPlugin - # Run tests + # Run tests and upload a code coverage report test: name: Test (${{ matrix.os }}) needs: [ build ] @@ -73,20 +74,30 @@ jobs: - macos-latest steps: + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@v1.3.1 + if: runner.os == 'Linux' + with: + tool-cache: false + large-packages: false + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Set up Java environment for the next steps + # Set up the Java environment for the next steps - name: Setup Java uses: actions/setup-java@v4 with: distribution: zulu - java-version: 17 + java-version: 21 # Setup Gradle - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: true # Run tests - name: Run Tests @@ -97,7 +108,7 @@ jobs: if: ${{ failure() }} uses: actions/upload-artifact@v4 with: - name: tests-result + name: tests-result-${{ matrix.os }} path: ${{ github.workspace }}/build/reports/tests # Run plugin structure verification along with IntelliJ Plugin Verifier @@ -107,24 +118,33 @@ jobs: runs-on: ubuntu-latest steps: + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + large-packages: false + # Check out the current repository - name: Fetch Sources uses: actions/checkout@v4 - # Set up Java environment for the next steps + # Set up the Java environment for the next steps - name: Setup Java uses: actions/setup-java@v4 with: distribution: zulu - java-version: 17 + java-version: 21 # Setup Gradle - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: true # Run Verify Plugin task and IntelliJ Plugin Verifier tool - name: Run Plugin Verification tasks - run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} + run: ./gradlew verifyPlugin # Collect Plugin Verifier Result - name: Collect Plugin Verifier Result diff --git a/.gitignore b/.gitignore index 885ef5b..fe4b8f3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .qodana build src/test/fixtures/gen/ +.kotlin diff --git a/CHANGELOG.md b/CHANGELOG.md index f2ad792..33cc28a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +## 1.1.10 - 04.08.2025 + +- Adapt code for PhpStorm 2025.1 + ## 1.1.9 - 31.07.2025 - Fix `UninitializedPropertyAccessException` in some cases diff --git a/build.gradle.kts b/build.gradle.kts index 149482e..b3ec2f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,7 @@ plugins { alias(libs.plugins.kotlin) // Kotlin support alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin alias(libs.plugins.changelog) // Gradle Changelog Plugin + alias(libs.plugins.kover) // Gradle Kover Plugin } group = providers.gradleProperty("pluginGroup").get() @@ -13,7 +14,7 @@ version = providers.gradleProperty("pluginVersion").get() // Set the JVM language level used to build the project. kotlin { - jvmToolchain(17) + jvmToolchain(21) } // Configure project's dependencies @@ -29,6 +30,7 @@ repositories { // Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog dependencies { testImplementation(libs.junit) + testImplementation(libs.opentest4j) // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html intellijPlatform { @@ -40,9 +42,6 @@ dependencies { // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace. plugins(providers.gradleProperty("platformPlugins").map { it.split(',') }) - instrumentationTools() - pluginVerifier() - zipSigner() testFramework(TestFrameworkType.Platform) } } @@ -50,6 +49,7 @@ dependencies { // Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html intellijPlatform { pluginConfiguration { + name = providers.gradleProperty("pluginName") version = providers.gradleProperty("pluginVersion") val changelog = project.changelog // local variable for configuration cache compatibility @@ -92,6 +92,23 @@ changelog { repositoryUrl = providers.gradleProperty("pluginRepositoryUrl") } +// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration +kover { + reports { + total { + xml { + onCheck = true + } + } + } + + currentProject { + instrumentation { + excludedClasses.add("org.apache.velocity.*") + } + } +} + tasks { test { delete("src/test/fixtures/gen") diff --git a/gradle.properties b/gradle.properties index b25d545..8f94f3c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,25 +5,24 @@ pluginName = modulite pluginRepositoryUrl = https://github.com/VKCOM/modulite # SemVer format -> https://semver.org -pluginVersion = 1.1.9 +pluginVersion = 1.1.10 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html -pluginSinceBuild = 243 -pluginUntilBuild = 243.* +pluginSinceBuild = 251 +pluginUntilBuild = 251.* # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension -platformType = IU -platformVersion = 2024.3 +platformType = PS +platformVersion = 2025.1 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP -# PHP Plugin - https://plugins.jetbrains.com/plugin/6610-php/versions -platformPlugins = com.jetbrains.php:243.21565.211 +platformPlugins = # Example: platformBundledPlugins = com.intellij.java -platformBundledPlugins = com.intellij.java, org.jetbrains.plugins.yaml +platformBundledPlugins = com.jetbrains.php, org.jetbrains.plugins.yaml, Git4Idea # Gradle Releases -> https://github.com/gradle/gradle/releases -gradleVersion = 8.10.2 +gradleVersion = 8.14.3 # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib kotlin.stdlib.default.dependency = false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 75b9f01..4e1ffdc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,16 +1,20 @@ [versions] # libraries junit = "4.13.2" +opentest4j = "1.3.0" # plugins -changelog = "2.2.1" -intelliJPlatform = "2.0.1" # TODO: update this in next update: https://youtrack.jetbrains.com/issue/MP-7019 -kotlin = "1.9.25" +changelog = "2.3.0" +intelliJPlatform = "2.7.0" +kotlin = "2.2.0" +kover = "0.9.1" [libraries] junit = { group = "junit", name = "junit", version.ref = "junit" } +opentest4j = { group = "org.opentest4j", name = "opentest4j", version.ref = "opentest4j" } [plugins] changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index a4b76b9..1b33c55 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 df97d72..d4081da 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.14.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6..23d15a9 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -115,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -206,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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. @@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9d21a21..db3a6ac 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle.kts b/settings.gradle.kts index 069a4f2..9772a01 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } rootProject.name = "modulite" diff --git a/src/main/kotlin/com/vk/modulite/actions/NewModuliteAction.kt b/src/main/kotlin/com/vk/modulite/actions/NewModuliteAction.kt index c20036e..c10d829 100644 --- a/src/main/kotlin/com/vk/modulite/actions/NewModuliteAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/NewModuliteAction.kt @@ -1,6 +1,7 @@ package com.vk.modulite.actions import com.intellij.icons.AllIcons +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys @@ -16,4 +17,6 @@ class NewModuliteAction : AnAction( val folder = e.getData(CommonDataKeys.VIRTUAL_FILE) ?: return ModuliteBuilder(project).startBuild(folder, fromSource = false) } + + override fun getActionUpdateThread() = ActionUpdateThread.BGT } diff --git a/src/main/kotlin/com/vk/modulite/actions/NewModuliteFromFolderAction.kt b/src/main/kotlin/com/vk/modulite/actions/NewModuliteFromFolderAction.kt index 1968193..df55a5f 100644 --- a/src/main/kotlin/com/vk/modulite/actions/NewModuliteFromFolderAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/NewModuliteFromFolderAction.kt @@ -1,6 +1,7 @@ package com.vk.modulite.actions import com.intellij.icons.AllIcons +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys @@ -35,4 +36,6 @@ class NewModuliteFromFolderAction : AnAction( return } } + + override fun getActionUpdateThread() = ActionUpdateThread.BGT } diff --git a/src/main/kotlin/com/vk/modulite/actions/RegenerateModuleRequiresAction.kt b/src/main/kotlin/com/vk/modulite/actions/RegenerateModuleRequiresAction.kt index fa1512a..21e4d52 100644 --- a/src/main/kotlin/com/vk/modulite/actions/RegenerateModuleRequiresAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/RegenerateModuleRequiresAction.kt @@ -1,5 +1,6 @@ package com.vk.modulite.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys @@ -17,7 +18,8 @@ class RegenerateModuleRequiresAction : AnAction() { val file = e.getData(CommonDataKeys.VIRTUAL_FILE) if (file == null || file.name != ".modulite.yaml") { e.presentation.isEnabledAndVisible = false - return } } + + override fun getActionUpdateThread() = ActionUpdateThread.BGT } diff --git a/src/main/kotlin/com/vk/modulite/actions/SelectionBasedPsiElementAction.kt b/src/main/kotlin/com/vk/modulite/actions/SelectionBasedPsiElementAction.kt index 89975dd..c0c3762 100644 --- a/src/main/kotlin/com/vk/modulite/actions/SelectionBasedPsiElementAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/SelectionBasedPsiElementAction.kt @@ -1,6 +1,7 @@ package com.vk.modulite.actions import com.intellij.codeInsight.hint.HintManager +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys @@ -105,6 +106,8 @@ abstract class SelectionBasedPsiElementAction( return PsiTreeUtil.findElementOfClassAtRange(file, selectionStart, selectionEnd, myClass) } + override fun getActionUpdateThread() = ActionUpdateThread.BGT + companion object { private fun getEditor(e: AnActionEvent) = e.getData(CommonDataKeys.EDITOR) private fun getPsiFile(e: AnActionEvent) = e.getData(CommonDataKeys.PSI_FILE) diff --git a/src/main/kotlin/com/vk/modulite/actions/usages/base/UsagesBaseFinder.kt b/src/main/kotlin/com/vk/modulite/actions/usages/base/UsagesBaseFinder.kt index 0b2169d..53f0d3b 100644 --- a/src/main/kotlin/com/vk/modulite/actions/usages/base/UsagesBaseFinder.kt +++ b/src/main/kotlin/com/vk/modulite/actions/usages/base/UsagesBaseFinder.kt @@ -60,6 +60,7 @@ abstract class UsagesBaseFinder { it is DefaultSearchScopeProviders.CustomNamed } ?: return + // TODO: remove `allowSlowOperations` val scopes = SlowOperations.allowSlowOperations, RuntimeException> { provider.getSearchScopes( element.project, diff --git a/src/main/kotlin/com/vk/modulite/actions/usages/php/FindSymbolUsagesInCurrentModuleAction.kt b/src/main/kotlin/com/vk/modulite/actions/usages/php/FindSymbolUsagesInCurrentModuleAction.kt index db2f406..169920e 100644 --- a/src/main/kotlin/com/vk/modulite/actions/usages/php/FindSymbolUsagesInCurrentModuleAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/usages/php/FindSymbolUsagesInCurrentModuleAction.kt @@ -2,11 +2,9 @@ package com.vk.modulite.actions.usages.php import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys -import com.intellij.util.SlowOperations import com.jetbrains.php.lang.psi.elements.PhpPsiElement import com.jetbrains.php.lang.psi.elements.Variable import com.vk.modulite.actions.PhpPsiElementAction -import com.vk.modulite.modulite.Modulite import com.vk.modulite.psi.extensions.files.containingModulite class FindSymbolUsagesInCurrentModuleAction : PhpPsiElementAction(PhpPsiElement::class.java) { @@ -20,9 +18,7 @@ class FindSymbolUsagesInCurrentModuleAction : PhpPsiElementAction return } - val modulite = SlowOperations.allowSlowOperations { - e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) - } + val modulite = e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) if (modulite == null) { e.presentation.isEnabledAndVisible = false diff --git a/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindAllowedSymbolUsagesInModuleAction.kt b/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindAllowedSymbolUsagesInModuleAction.kt index 4781e12..a1a8500 100644 --- a/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindAllowedSymbolUsagesInModuleAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindAllowedSymbolUsagesInModuleAction.kt @@ -1,5 +1,6 @@ package com.vk.modulite.actions.usages.yaml +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.util.SlowOperations @@ -19,9 +20,7 @@ class FindAllowedSymbolUsagesInModuleAction : YamlPsiElementAction { - e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) - } + val modulite = e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) if (element == null || modulite == null) { e.presentation.isEnabledAndVisible = false diff --git a/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindModuleUsagesInCurrentModuleAction.kt b/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindModuleUsagesInCurrentModuleAction.kt index e1a976c..c40e7b6 100644 --- a/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindModuleUsagesInCurrentModuleAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindModuleUsagesInCurrentModuleAction.kt @@ -1,5 +1,6 @@ package com.vk.modulite.actions.usages.yaml +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.psi.PsiElement @@ -40,10 +41,7 @@ class FindModuleUsagesInCurrentModuleAction : YamlPsiElementAction { - e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) - } + val module = e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) if (element == null || module == null) { e.presentation.isEnabledAndVisible = false diff --git a/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindSymbolUsagesInCurrentModuleAction.kt b/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindSymbolUsagesInCurrentModuleAction.kt index 97f05be..868499b 100644 --- a/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindSymbolUsagesInCurrentModuleAction.kt +++ b/src/main/kotlin/com/vk/modulite/actions/usages/yaml/FindSymbolUsagesInCurrentModuleAction.kt @@ -1,5 +1,6 @@ package com.vk.modulite.actions.usages.yaml +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.util.SlowOperations @@ -15,10 +16,7 @@ class FindSymbolUsagesInCurrentModuleAction : YamlPsiElementAction { - e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) - } + val modulite = e.getData(CommonDataKeys.VIRTUAL_FILE)?.containingModulite(e.project!!) if (element == null || modulite == null) { e.presentation.isEnabledAndVisible = false