mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gradle] IDEA-357140 Migrate Gradle Java Plugin descriptors to V2: toml and groovy-toml modules
GitOrigin-RevId: 61ee2ea1a094062adf5d51ee8b4786ad977c8af4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
77163310b6
commit
6072c55a67
Generated
+3
@@ -459,9 +459,12 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/gradle-declarative-sync/intellij.gradle.declarativeSync.tests.iml" filepath="$PROJECT_DIR$/plugins/gradle/gradle-declarative-sync/intellij.gradle.declarativeSync.tests.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/gradle-dependency-updater/intellij.gradle.dependencyUpdater.iml" filepath="$PROJECT_DIR$/plugins/gradle/gradle-dependency-updater/intellij.gradle.dependencyUpdater.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/java/intellij.gradle.java.iml" filepath="$PROJECT_DIR$/plugins/gradle/java/intellij.gradle.java.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/java/groovy/intellij.gradle.java.groovy.iml" filepath="$PROJECT_DIR$/plugins/gradle/java/groovy/intellij.gradle.java.groovy.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/java/groovy/toml/intellij.gradle.java.groovy.toml.iml" filepath="$PROJECT_DIR$/plugins/gradle/java/groovy/toml/intellij.gradle.java.groovy.toml.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle-maven/intellij.gradle.java.maven.iml" filepath="$PROJECT_DIR$/plugins/gradle-maven/intellij.gradle.java.maven.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/java/performance/intellij.gradle.java.performance.iml" filepath="$PROJECT_DIR$/plugins/gradle/java/performance/intellij.gradle.java.performance.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/java/intellij.gradle.java.tests.iml" filepath="$PROJECT_DIR$/plugins/gradle/java/intellij.gradle.java.tests.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/java/toml/intellij.gradle.java.toml.iml" filepath="$PROJECT_DIR$/plugins/gradle/java/toml/intellij.gradle.java.toml.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/jps-plugin/intellij.gradle.jps.iml" filepath="$PROJECT_DIR$/plugins/gradle/jps-plugin/intellij.gradle.jps.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/kotlin/tests/intellij.gradle.kotlin.tests.iml" filepath="$PROJECT_DIR$/plugins/gradle/kotlin/tests/intellij.gradle.kotlin.tests.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/gradle/native/intellij.gradle.native.iml" filepath="$PROJECT_DIR$/plugins/gradle/native/intellij.gradle.native.iml" />
|
||||
|
||||
@@ -997,7 +997,10 @@ plugins/gradle/gradle-declarative-sync
|
||||
plugins/gradle/gradle-dependency-updater
|
||||
plugins/gradle/intellij.gradle.analysis
|
||||
plugins/gradle/java
|
||||
plugins/gradle/java/groovy
|
||||
plugins/gradle/java/groovy/toml
|
||||
plugins/gradle/java/performance
|
||||
plugins/gradle/java/toml
|
||||
plugins/gradle/jps-plugin
|
||||
plugins/gradle/kotlin/tests
|
||||
plugins/gradle/native
|
||||
|
||||
@@ -174,6 +174,7 @@ jvm_library(
|
||||
"//platform/statistics/testFramework",
|
||||
"//platform/execution",
|
||||
"//platform/refactoring",
|
||||
"//plugins/gradle/java/toml",
|
||||
],
|
||||
runtime_deps = [":java-tests"]
|
||||
)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
### auto-generated section `build intellij.gradle.java.groovy` start
|
||||
load("@rules_jvm//:jvm.bzl", "jvm_library", "resourcegroup")
|
||||
|
||||
resourcegroup(
|
||||
name = "groovy_resources",
|
||||
srcs = glob(["resources/**/*"]),
|
||||
strip_prefix = "resources"
|
||||
)
|
||||
|
||||
jvm_library(
|
||||
name = "groovy",
|
||||
module_name = "intellij.gradle.java.groovy",
|
||||
visibility = ["//visibility:public"],
|
||||
srcs = glob(["src/**/*.kt", "src/**/*.java", "src/**/*.form"], allow_empty = True),
|
||||
resources = [":groovy_resources"]
|
||||
)
|
||||
### auto-generated section `build intellij.gradle.java.groovy` end
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="com.intellij.gradle.java.groovy" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,2 @@
|
||||
<idea-plugin>
|
||||
</idea-plugin>
|
||||
@@ -0,0 +1,38 @@
|
||||
### auto-generated section `build intellij.gradle.java.groovy.toml` start
|
||||
load("@rules_jvm//:jvm.bzl", "jvm_library", "resourcegroup")
|
||||
|
||||
resourcegroup(
|
||||
name = "toml_resources",
|
||||
srcs = glob(["resources/**/*"]),
|
||||
strip_prefix = "resources"
|
||||
)
|
||||
|
||||
jvm_library(
|
||||
name = "toml",
|
||||
module_name = "intellij.gradle.java.groovy.toml",
|
||||
visibility = ["//visibility:public"],
|
||||
srcs = glob(["src/**/*.kt", "src/**/*.java", "src/**/*.form"], allow_empty = True),
|
||||
resources = [":toml_resources"],
|
||||
deps = [
|
||||
"@lib//:kotlin-stdlib",
|
||||
"@lib//:jetbrains-annotations",
|
||||
"//plugins/toml/core",
|
||||
"//platform/util/multiplatform",
|
||||
"//platform/analysis-api:analysis",
|
||||
"//platform/core-api:core",
|
||||
"//platform/core-impl",
|
||||
"//platform/util",
|
||||
"//platform/lang-impl",
|
||||
"//platform/core-ui",
|
||||
"//platform/editor-ui-api:editor-ui",
|
||||
"//platform/indexing-api:indexing",
|
||||
"//platform/usageView",
|
||||
"//plugins/gradle/java",
|
||||
"//java/java-psi-api:psi",
|
||||
"//platform/refactoring",
|
||||
"//plugins/groovy/groovy-psi:psi",
|
||||
"//plugins/gradle/java/toml",
|
||||
"//uast/uast-common:uast",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build intellij.gradle.java.groovy.toml` end
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="com.intellij.gradle.java.groovy.toml" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||
<orderEntry type="library" name="jetbrains-annotations" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.toml.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.multiplatform" />
|
||||
<orderEntry type="module" module-name="intellij.platform.analysis" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.editor.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.indexing" />
|
||||
<orderEntry type="module" module-name="intellij.platform.usageView" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java" />
|
||||
<orderEntry type="module" module-name="intellij.java.psi" />
|
||||
<orderEntry type="module" module-name="intellij.platform.refactoring" />
|
||||
<orderEntry type="module" module-name="intellij.groovy.psi" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java.toml" />
|
||||
<orderEntry type="module" module-name="intellij.platform.uast" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,15 @@
|
||||
<idea-plugin>
|
||||
<dependencies>
|
||||
<module name="intellij.gradle.java.toml"/>
|
||||
<module name="intellij.gradle.java.groovy"/>
|
||||
</dependencies>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<gotoDeclarationHandler implementation="com.intellij.gradle.java.groovy.toml.service.GradleVersionCatalogTomlAwareGotoDeclarationHandler"/>
|
||||
<referencesSearch implementation="com.intellij.gradle.java.groovy.toml.service.GradleGroovyVersionCatalogReferencesSearcher"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||
<dslInspectionProvider language="Groovy" implementationClass="com.intellij.gradle.java.groovy.toml.GroovyGradleDslInspectionProvider"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
+10
-4
@@ -1,11 +1,17 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.codeInspection.groovy
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.gradle.java.groovy.toml
|
||||
|
||||
import com.intellij.codeInspection.ProblemsHolder
|
||||
import com.intellij.openapi.util.io.FileUtilRt
|
||||
import com.intellij.psi.PsiElementVisitor
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.plugins.gradle.codeInspection.GradleDslInspectionProvider
|
||||
import org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyAvoidDependencyNamedArgumentsNotationInspectionVisitor
|
||||
import org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyConfigurationAvoidanceVisitor
|
||||
import org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyDeprecatedConfigurationInspectionVisitor
|
||||
import org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyForeignDelegateInspectionVisitor
|
||||
import org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyIncorrectDependencyNotationArgumentInspectionVisitor
|
||||
import org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyPluginDslStructureInspectionVisitor
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementVisitor
|
||||
|
||||
@@ -30,11 +36,11 @@ class GroovyGradleDslInspectionProvider : GradleDslInspectionProvider {
|
||||
FileUtilRt.extensionEquals(file.name, GradleConstants.EXTENSION)
|
||||
|
||||
override fun getAvoidDependencyNamedArgumentsNotationInspectionVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor =
|
||||
GroovyPsiElementVisitor(GroovyAvoidDependencyNamedArgumentsNotationInspectionVisitor(holder))
|
||||
GroovyPsiElementVisitor(GroovyAvoidDependencyNamedArgumentsNotationInspectionVisitor(holder))
|
||||
|
||||
override fun isRedundantKotlinStdLibInspectionAvailable(file: PsiFile): Boolean =
|
||||
FileUtilRt.extensionEquals(file.name, GradleConstants.EXTENSION)
|
||||
|
||||
override fun getRedundantKotlinStdLibInspectionVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor =
|
||||
GroovyPsiElementVisitor(GroovyRedundantKotlinStdLibInspectionVisitor(holder))
|
||||
GroovyPsiElementVisitor(GroovyRedundantKotlinStdLibInspectionVisitor(holder))
|
||||
}
|
||||
+3
-3
@@ -1,10 +1,12 @@
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.codeInspection.groovy
|
||||
package com.intellij.gradle.java.groovy.toml
|
||||
|
||||
import com.intellij.codeInspection.CommonQuickFixBundle
|
||||
import com.intellij.codeInspection.ProblemsHolder
|
||||
import com.intellij.codeInspection.util.IntentionFamilyName
|
||||
import com.intellij.codeInspection.util.IntentionName
|
||||
import com.intellij.gradle.java.toml.getResolvedDependency
|
||||
import com.intellij.gradle.java.toml.getResolvedPlugin
|
||||
import com.intellij.modcommand.ModPsiUpdater
|
||||
import com.intellij.modcommand.PsiUpdateModCommandQuickFix
|
||||
import com.intellij.openapi.diagnostic.debug
|
||||
@@ -16,8 +18,6 @@ import com.intellij.psi.util.childrenOfType
|
||||
import org.jetbrains.plugins.gradle.codeInspection.GradleInspectionBundle
|
||||
import org.jetbrains.plugins.gradle.service.resolve.GradleCommonClassNames.GRADLE_API_DEPENDENCY_HANDLER
|
||||
import org.jetbrains.plugins.gradle.service.resolve.GradleDependencyHandlerContributor.Companion.dependencyMethodKind
|
||||
import org.jetbrains.plugins.gradle.toml.getResolvedDependency
|
||||
import org.jetbrains.plugins.gradle.toml.getResolvedPlugin
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile
|
||||
+3
-3
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.service.toml
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.gradle.java.groovy.toml.service
|
||||
|
||||
import com.intellij.gradle.java.toml.getVersionCatalogParts
|
||||
import com.intellij.lang.java.beans.PropertyKind
|
||||
import com.intellij.openapi.application.QueryExecutorBase
|
||||
import com.intellij.openapi.application.runReadAction
|
||||
@@ -14,7 +15,6 @@ import com.intellij.psi.util.PropertyUtilBase
|
||||
import com.intellij.psi.util.parentOfType
|
||||
import com.intellij.util.Processor
|
||||
import com.intellij.util.asSafely
|
||||
import org.jetbrains.plugins.gradle.toml.getVersionCatalogParts
|
||||
import org.jetbrains.plugins.groovy.findUsages.GroovyScopeUtil
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrMethodCall
|
||||
+4
-4
@@ -1,7 +1,9 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.service.toml
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.gradle.java.groovy.toml.service
|
||||
|
||||
import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler
|
||||
import com.intellij.gradle.java.toml.findOriginInTomlFile
|
||||
import com.intellij.gradle.java.toml.findTomlFile
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.psi.PsiElement
|
||||
@@ -9,8 +11,6 @@ import com.intellij.psi.PsiMethod
|
||||
import com.intellij.psi.util.parentOfType
|
||||
import com.intellij.psi.util.parents
|
||||
import org.jetbrains.plugins.gradle.service.project.CommonGradleProjectResolverExtension
|
||||
import org.jetbrains.plugins.gradle.toml.findOriginInTomlFile
|
||||
import org.jetbrains.plugins.gradle.toml.findTomlFile
|
||||
import org.jetbrains.plugins.gradle.util.isInVersionCatalogAccessor
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.api.GroovyPropertyBase
|
||||
@@ -65,5 +65,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.statistics.testFramework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.execution" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.refactoring" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java.toml" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,6 +1,5 @@
|
||||
<idea-plugin>
|
||||
<depends optional="true" config-file="gradle-groovy-ml-integration.xml">com.intellij.completion.ml.ranking</depends>
|
||||
<depends optional="true" config-file="gradle-groovy-toml-integration.xml">org.toml.lang</depends>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint qualifiedName="org.jetbrains.plugins.gradle.resolve.contributor" interface="org.jetbrains.plugins.gradle.service.resolve.GradleMethodContextContributor"
|
||||
@@ -24,7 +23,6 @@
|
||||
<executionEnvironmentProvider implementation="org.jetbrains.plugins.gradle.execution.build.GroovyGradleApplicationEnvironmentProvider"/>
|
||||
<frameworkSupport implementation="org.jetbrains.plugins.gradle.frameworkSupport.GradleGroovyFrameworkSupportProvider"/>
|
||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.plugins.gradle.frameworkSupport.KotlinDslGradleGroovyFrameworkSupportProvider" />
|
||||
<dslInspectionProvider language="Groovy" implementationClass="org.jetbrains.plugins.gradle.codeInspection.groovy.GroovyGradleDslInspectionProvider"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<idea-plugin>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<gotoDeclarationHandler implementation="org.jetbrains.plugins.gradle.service.toml.GradleVersionCatalogTomlAwareGotoDeclarationHandler"/>
|
||||
<referencesSearch implementation="org.jetbrains.plugins.gradle.service.toml.GradleGroovyVersionCatalogReferencesSearcher"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -1,27 +0,0 @@
|
||||
<idea-plugin>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<elementDescriptionProvider implementation="org.jetbrains.plugins.gradle.toml.navigation.VersionCatalogDescriptionProvider"/>
|
||||
<useScopeEnlarger implementation="org.jetbrains.plugins.gradle.service.toml.GradleTomlUseScopeEnlarger"/>
|
||||
<findUsagesHandlerFactory implementation="org.jetbrains.plugins.gradle.toml.findUsages.GradleVersionCatalogFindUsagesFactory"/>
|
||||
<psi.referenceContributor language="TOML"
|
||||
implementation="org.jetbrains.plugins.gradle.toml.navigation.VersionCatalogReferenceContributor"/>
|
||||
<renameInputValidator implementation="org.jetbrains.plugins.gradle.toml.navigation.VersionCatalogRenameInputValidator"/>
|
||||
|
||||
<completion.contributor language="TOML"
|
||||
implementationClass="org.jetbrains.plugins.gradle.toml.completion.TomlVersionCatalogCompletionContributor" />
|
||||
<completion.confidence language="TOML"
|
||||
id="EnableAutoPopupInTomlVersionCatalogCompletion"
|
||||
implementationClass="org.jetbrains.plugins.gradle.toml.completion.EnableAutoPopupInTomlVersionCatalogCompletion" />
|
||||
|
||||
<localInspection language="TOML" groupPath="Gradle" shortName="UnusedVersionCatalogEntry"
|
||||
bundle="messages.GradleInspectionBundle" key="inspection.display.name.unused.version.catalog.entry"
|
||||
groupBundle="messages.GradleInspectionBundle" groupKey="inspection.style"
|
||||
enabledByDefault="true"
|
||||
implementationClass="org.jetbrains.plugins.gradle.codeInspection.toml.UnusedVersionCatalogEntryInspection"/>
|
||||
<lang.inspectionSuppressor language="TOML"
|
||||
implementationClass="org.jetbrains.plugins.gradle.codeInspection.toml.GradleTomlInspectionSuppressor"/>
|
||||
|
||||
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -21,7 +21,6 @@
|
||||
<depends optional="true" config-file="gradle-coverage-integration.xml">Coverage</depends>
|
||||
<depends optional="true" config-file="gradle-groovy-integration.xml">org.intellij.groovy</depends>
|
||||
<depends optional="true" config-file="gradle-properties-integration.xml">com.intellij.properties</depends>
|
||||
<depends optional="true" config-file="gradle-toml-integration.xml">org.toml.lang</depends>
|
||||
|
||||
<content namespace="jetbrains">
|
||||
<module name="intellij.gradle.profiler"/>
|
||||
@@ -29,6 +28,9 @@
|
||||
<module name="intellij.gradle.analysis"/>
|
||||
<module name="intellij.gradle.dependencyUpdater"/>
|
||||
<module name="intellij.gradle.java.performance"/>
|
||||
<module name="intellij.gradle.java.toml"/>
|
||||
<module name="intellij.gradle.java.groovy"/>
|
||||
<module name="intellij.gradle.java.groovy.toml"/>
|
||||
</content>
|
||||
|
||||
<resource-bundle>messages.GradleInspectionBundle</resource-bundle>
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
@file:ApiStatus.Internal
|
||||
package org.jetbrains.plugins.gradle.util
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiMethod
|
||||
import com.intellij.psi.util.PropertyUtilBase
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
internal fun getCapitalizedAccessorName(method: PsiMethod): String? {
|
||||
fun getCapitalizedAccessorName(method: PsiMethod): String? {
|
||||
val propertyName = PropertyUtilBase.getPropertyName(method) ?: return null
|
||||
val methodFinalPart = StringUtil.capitalize(propertyName)
|
||||
val methodParts = method.containingClass?.takeUnless { it.name?.startsWith(LIBRARIES_FOR_PREFIX) == true }?.name?.trimAccessorName()
|
||||
@@ -37,10 +40,10 @@ private fun getTopContainingClass(psiMethod: PsiMethod?): PsiClass? {
|
||||
return topClass
|
||||
}
|
||||
|
||||
internal const val BUNDLE_ACCESSORS_SUFFIX = "BundleAccessors"
|
||||
internal const val LIBRARY_ACCESSORS_SUFFIX = "LibraryAccessors"
|
||||
internal const val PLUGIN_ACCESSORS_SUFFIX = "PluginAccessors"
|
||||
internal const val VERSION_ACCESSORS_SUFFIX = "VersionAccessors"
|
||||
const val BUNDLE_ACCESSORS_SUFFIX: String = "BundleAccessors"
|
||||
const val LIBRARY_ACCESSORS_SUFFIX: String = "LibraryAccessors"
|
||||
const val PLUGIN_ACCESSORS_SUFFIX: String = "PluginAccessors"
|
||||
const val VERSION_ACCESSORS_SUFFIX: String = "VersionAccessors"
|
||||
|
||||
internal const val LIBRARIES_FOR_PREFIX = "LibrariesFor"
|
||||
const val LIBRARIES_FOR_PREFIX: String = "LibrariesFor"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.toml
|
||||
|
||||
import com.intellij.gradle.java.toml.findTomlCatalogKey
|
||||
import com.intellij.openapi.externalSystem.util.runReadAction
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiFileFactory
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
### auto-generated section `build intellij.gradle.java.toml` start
|
||||
load("@rules_jvm//:jvm.bzl", "jvm_library", "resourcegroup")
|
||||
|
||||
resourcegroup(
|
||||
name = "toml_resources",
|
||||
srcs = glob(["resources/**/*"]),
|
||||
strip_prefix = "resources"
|
||||
)
|
||||
|
||||
jvm_library(
|
||||
name = "toml",
|
||||
module_name = "intellij.gradle.java.toml",
|
||||
visibility = ["//visibility:public"],
|
||||
srcs = glob(["src/**/*.kt", "src/**/*.java", "src/**/*.form"], allow_empty = True),
|
||||
resources = [":toml_resources"],
|
||||
deps = [
|
||||
"@lib//:kotlin-stdlib",
|
||||
"@lib//:jetbrains-annotations",
|
||||
"//plugins/toml/core",
|
||||
"//platform/util/multiplatform",
|
||||
"//platform/analysis-api:analysis",
|
||||
"//platform/core-api:core",
|
||||
"//platform/core-impl",
|
||||
"//platform/util",
|
||||
"//platform/lang-impl",
|
||||
"//platform/core-ui",
|
||||
"//platform/editor-ui-api:editor-ui",
|
||||
"//platform/indexing-api:indexing",
|
||||
"//platform/usageView",
|
||||
"//plugins/gradle/java",
|
||||
"//java/java-psi-api:psi",
|
||||
"//platform/refactoring",
|
||||
"//platform/projectModel-api:projectModel",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build intellij.gradle.java.toml` end
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="com.intellij.gradle.java.toml" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||
<orderEntry type="library" name="jetbrains-annotations" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.toml.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.multiplatform" />
|
||||
<orderEntry type="module" module-name="intellij.platform.analysis" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.editor.ui" />
|
||||
<orderEntry type="module" module-name="intellij.platform.indexing" />
|
||||
<orderEntry type="module" module-name="intellij.platform.usageView" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java" />
|
||||
<orderEntry type="module" module-name="intellij.java.psi" />
|
||||
<orderEntry type="module" module-name="intellij.platform.refactoring" />
|
||||
<orderEntry type="module" module-name="intellij.platform.projectModel" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,30 @@
|
||||
<idea-plugin>
|
||||
<dependencies>
|
||||
<plugin id="org.toml.lang"/>
|
||||
</dependencies>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<elementDescriptionProvider implementation="com.intellij.gradle.java.toml.navigation.VersionCatalogDescriptionProvider"/>
|
||||
<useScopeEnlarger implementation="com.intellij.gradle.java.toml.service.GradleTomlUseScopeEnlarger"/>
|
||||
<findUsagesHandlerFactory implementation="com.intellij.gradle.java.toml.findUsages.GradleVersionCatalogFindUsagesFactory"/>
|
||||
<psi.referenceContributor language="TOML"
|
||||
implementation="com.intellij.gradle.java.toml.navigation.VersionCatalogReferenceContributor"/>
|
||||
<renameInputValidator implementation="com.intellij.gradle.java.toml.navigation.VersionCatalogRenameInputValidator"/>
|
||||
|
||||
<completion.contributor language="TOML"
|
||||
implementationClass="com.intellij.gradle.java.toml.completion.TomlVersionCatalogCompletionContributor" />
|
||||
<completion.confidence language="TOML"
|
||||
id="EnableAutoPopupInTomlVersionCatalogCompletion"
|
||||
implementationClass="com.intellij.gradle.java.toml.completion.EnableAutoPopupInTomlVersionCatalogCompletion" />
|
||||
|
||||
<localInspection language="TOML" groupPath="Gradle" shortName="UnusedVersionCatalogEntry"
|
||||
bundle="messages.GradleInspectionBundle" key="inspection.display.name.unused.version.catalog.entry"
|
||||
groupBundle="messages.GradleInspectionBundle" groupKey="inspection.style"
|
||||
enabledByDefault="true"
|
||||
implementationClass="org.jetbrains.plugins.gradle.codeInspection.toml.UnusedVersionCatalogEntryInspection"/>
|
||||
<lang.inspectionSuppressor language="TOML"
|
||||
implementationClass="org.jetbrains.plugins.gradle.codeInspection.toml.GradleTomlInspectionSuppressor"/>
|
||||
|
||||
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml.completion
|
||||
package com.intellij.gradle.java.toml.completion
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionConfidence
|
||||
import com.intellij.codeInsight.completion.CompletionContributor
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml.findUsages
|
||||
package com.intellij.gradle.java.toml.findUsages
|
||||
|
||||
import com.intellij.find.findUsages.FindUsagesHandler
|
||||
import com.intellij.find.findUsages.FindUsagesHandlerFactory
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml.findUsages
|
||||
package com.intellij.gradle.java.toml.findUsages
|
||||
|
||||
import com.intellij.find.findUsages.FindUsagesHandler
|
||||
import com.intellij.find.findUsages.FindUsagesOptions
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml.navigation
|
||||
package com.intellij.gradle.java.toml.navigation
|
||||
|
||||
import com.intellij.psi.ElementDescriptionLocation
|
||||
import com.intellij.psi.ElementDescriptionProvider
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml.navigation
|
||||
package com.intellij.gradle.java.toml.navigation
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.patterns.ElementPattern
|
||||
@@ -14,8 +14,8 @@ import com.intellij.psi.PsiReferenceProvider
|
||||
import com.intellij.psi.PsiReferenceRegistrar
|
||||
import com.intellij.util.ProcessingContext
|
||||
import com.intellij.util.asSafely
|
||||
import org.jetbrains.plugins.gradle.toml.getLibraries
|
||||
import org.jetbrains.plugins.gradle.toml.getVersions
|
||||
import com.intellij.gradle.java.toml.getLibraries
|
||||
import com.intellij.gradle.java.toml.getVersions
|
||||
import org.toml.lang.psi.TomlArray
|
||||
import org.toml.lang.psi.TomlInlineTable
|
||||
import org.toml.lang.psi.TomlKeySegment
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml.navigation
|
||||
package com.intellij.gradle.java.toml.navigation
|
||||
|
||||
import com.intellij.patterns.ElementPattern
|
||||
import com.intellij.patterns.PatternCondition
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.service.toml
|
||||
package com.intellij.gradle.java.toml.service
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.search.SearchScope
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.toml
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:ApiStatus.Internal
|
||||
package com.intellij.gradle.java.toml
|
||||
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.module.ModuleUtilCore
|
||||
@@ -16,6 +17,7 @@ import com.intellij.psi.util.InheritanceUtil
|
||||
import com.intellij.psi.util.childrenOfType
|
||||
import com.intellij.util.asSafely
|
||||
import com.intellij.util.containers.tail
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.plugins.gradle.service.resolve.GradleCommonClassNames.GRADLE_API_PROVIDER_PROVIDER
|
||||
import org.jetbrains.plugins.gradle.service.resolve.GradleCommonClassNames.GRADLE_API_PROVIDER_PROVIDER_CONVERTIBLE
|
||||
import org.jetbrains.plugins.gradle.service.resolve.VersionCatalogsLocator
|
||||
@@ -48,7 +50,7 @@ internal fun getVersions(context: PsiElement): List<TomlKeySegment> = getTableEn
|
||||
|
||||
internal fun getLibraries(context: PsiElement): List<TomlKeySegment> = getTableEntries(context, "libraries")
|
||||
|
||||
internal fun String.getVersionCatalogParts() : List<String> = split("_", "-")
|
||||
fun String.getVersionCatalogParts() : List<String> = split("_", "-")
|
||||
|
||||
fun findTomlFile(context: PsiElement, name: String): TomlFile? {
|
||||
val module = ModuleUtilCore.findModuleForPsiElement(context) ?: return null
|
||||
@@ -65,7 +67,7 @@ private fun findTomlFileDynamically(context: PsiElement, name: String): VirtualF
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a [TomlFile] and a path, returns the corresponding key element.
|
||||
* Given a [org.toml.lang.psi.TomlFile] and a path, returns the corresponding key element.
|
||||
* For example, given "versions.foo", it will locate the `foo =` key/value
|
||||
* pair under the `\[versions]` table and return it. As a special case,
|
||||
* `libraries` don't have to be explicitly named in the path.
|
||||
@@ -28,6 +28,7 @@ jvm_library(
|
||||
"//platform/indexing-api:indexing",
|
||||
"//plugins/gradle/java",
|
||||
"//plugins/toml",
|
||||
"//plugins/gradle/java/toml",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build intellij.kotlin.gradle.codeInsight.toml` end
|
||||
@@ -22,5 +22,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.indexing" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java" />
|
||||
<orderEntry type="module" module-name="intellij.toml" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java.toml" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -24,6 +24,7 @@ jvm_library(
|
||||
"//platform/core-impl",
|
||||
"//platform/util",
|
||||
"//java/java-psi-impl:psi-impl",
|
||||
"//plugins/gradle/java/toml",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build intellij.kotlin.gradle.codeInsight.toml.k2` end
|
||||
+1
@@ -18,5 +18,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.core.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||
<orderEntry type="module" module-name="intellij.java.psi.impl" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java.toml" />
|
||||
</component>
|
||||
</module>
|
||||
+1
-1
@@ -1,12 +1,12 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.kotlin.idea.gradle.versionCatalog.toml.k2
|
||||
|
||||
import com.intellij.gradle.java.toml.findTomlFile
|
||||
import org.jetbrains.kotlin.idea.gradle.versionCatalog.toml.KtTomlVersionCatalogReference
|
||||
import org.jetbrains.kotlin.idea.gradle.versionCatalog.toml.matchesTopmostCatalogReferencePattern
|
||||
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
|
||||
import org.jetbrains.kotlin.references.KotlinPsiReferenceProviderContributor
|
||||
import org.jetbrains.kotlin.references.KotlinPsiReferenceProviderContributor.ReferenceProvider
|
||||
import org.jetbrains.plugins.gradle.toml.findTomlFile
|
||||
|
||||
internal class K2GradleTomlVersionCatalogPsiReferenceProviderContributor : KotlinPsiReferenceProviderContributor<KtDotQualifiedExpression> {
|
||||
override val elementClass: Class<KtDotQualifiedExpression>
|
||||
|
||||
+1
-1
@@ -4,6 +4,7 @@
|
||||
package org.jetbrains.kotlin.idea.gradle.versionCatalog.toml
|
||||
|
||||
import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler
|
||||
import com.intellij.gradle.java.toml.findOriginInTomlFile
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.psi.PsiElement
|
||||
@@ -12,7 +13,6 @@ import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.UnsafeCastFunction
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import org.jetbrains.plugins.gradle.service.project.CommonGradleProjectResolverExtension.GRADLE_VERSION_CATALOGS_DYNAMIC_SUPPORT
|
||||
import org.jetbrains.plugins.gradle.toml.findOriginInTomlFile
|
||||
import org.jetbrains.plugins.gradle.util.isInVersionCatalogAccessor
|
||||
import org.jetbrains.uast.toUElement
|
||||
import org.jetbrains.uast.tryResolve
|
||||
|
||||
+1
-1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.kotlin.idea.gradle.versionCatalog.toml
|
||||
|
||||
import com.intellij.gradle.java.toml.getTomlParentSectionName
|
||||
import com.intellij.openapi.application.QueryExecutorBase
|
||||
import com.intellij.openapi.application.runReadAction
|
||||
import com.intellij.psi.PsiElement
|
||||
@@ -15,7 +16,6 @@ import com.intellij.util.Processor
|
||||
import org.jetbrains.kotlin.idea.base.util.restrictToKotlinSources
|
||||
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
|
||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||
import org.jetbrains.plugins.gradle.toml.getTomlParentSectionName
|
||||
import org.toml.lang.psi.TomlKeySegment
|
||||
import org.toml.lang.psi.TomlKeyValue
|
||||
|
||||
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.kotlin.idea.gradle.versionCatalog.toml
|
||||
|
||||
import com.intellij.gradle.java.toml.findTomlCatalogKey
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiReferenceBase
|
||||
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
|
||||
import org.jetbrains.plugins.gradle.toml.findTomlCatalogKey
|
||||
import org.toml.lang.psi.TomlFile
|
||||
|
||||
class KtTomlVersionCatalogReference(
|
||||
|
||||
@@ -80,6 +80,7 @@ jvm_library(
|
||||
"//plugins/gradle/java",
|
||||
"//plugins/kotlin/code-insight/impl-base:kotlin-codeInsight-shared",
|
||||
"//plugins/kotlin/uast/uast-kotlin-base:kotlin-uast-base",
|
||||
"//plugins/gradle/java/toml",
|
||||
]
|
||||
)
|
||||
|
||||
@@ -167,6 +168,7 @@ jvm_library(
|
||||
"//plugins/kotlin/uast/uast-kotlin-base:kotlin-uast-base",
|
||||
"//plugins/gradle/completion",
|
||||
"//plugins/gradle/completion:completion_test_lib",
|
||||
"//plugins/gradle/java/toml",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build intellij.kotlin.gradle.scripting` end
|
||||
|
||||
+1
@@ -92,5 +92,6 @@
|
||||
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.kotlin.uast.base" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.completion" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.gradle.java.toml" />
|
||||
</component>
|
||||
</module>
|
||||
+2
-2
@@ -5,6 +5,8 @@ import com.intellij.codeInspection.CommonQuickFixBundle
|
||||
import com.intellij.codeInspection.ProblemsHolder
|
||||
import com.intellij.codeInspection.util.IntentionFamilyName
|
||||
import com.intellij.codeInspection.util.IntentionName
|
||||
import com.intellij.gradle.java.toml.getResolvedDependency
|
||||
import com.intellij.gradle.java.toml.getResolvedPlugin
|
||||
import com.intellij.modcommand.ModPsiUpdater
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiMethod
|
||||
@@ -21,8 +23,6 @@ import org.jetbrains.kotlin.psi.KtValueArgumentList
|
||||
import org.jetbrains.kotlin.psi.KtVisitorVoid
|
||||
import org.jetbrains.kotlin.utils.PathUtil.KOTLIN_JAVA_STDLIB_NAME
|
||||
import org.jetbrains.plugins.gradle.codeInspection.GradleInspectionBundle
|
||||
import org.jetbrains.plugins.gradle.toml.getResolvedDependency
|
||||
import org.jetbrains.plugins.gradle.toml.getResolvedPlugin
|
||||
import org.jetbrains.uast.UExpression
|
||||
import org.jetbrains.uast.toUElementOfType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user