mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] KTIJ-29202 LoadConfigurationAction triggers eager loading of KotlinIcons
GitOrigin-RevId: 84f4ca8f1ee04b83c8ce37eee87d0d49e8df5013
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7c0ce1b768
commit
8fe3ff820d
@@ -142,8 +142,10 @@
|
||||
<serialization.IdeaKotlinSerializationContext implementation="org.jetbrains.kotlin.idea.gradleJava.configuration.serialize.IntellijIdeaKotlinSerializationContext"/>
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
<action id="LoadConfigurationAction" class="org.jetbrains.kotlin.idea.gradleJava.scripting.LoadConfigurationAction">
|
||||
<actions resource-bundle="messages.KotlinIdeaGradleBundle">
|
||||
<action id="LoadKtGradleConfiguration"
|
||||
class="org.jetbrains.kotlin.idea.gradleJava.scripting.LoadKtGradleConfigurationAction"
|
||||
icon="org.jetbrains.kotlin.idea.KotlinIcons.LOAD_SCRIPT_CONFIGURATION">
|
||||
<add-to-group group-id="ExternalSystem.ProjectRefreshActionGroup" anchor="first"/>
|
||||
</action>
|
||||
</actions>
|
||||
|
||||
+3
-7
@@ -18,8 +18,8 @@ import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.testFramework.LightVirtualFileBase
|
||||
import org.gradle.tooling.model.kotlin.dsl.KotlinDslModelsParameters
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.kotlin.idea.KotlinIcons
|
||||
import org.jetbrains.kotlin.idea.core.script.settings.KotlinScriptingSettings
|
||||
import org.jetbrains.kotlin.idea.gradle.KotlinIdeaGradleBundle
|
||||
import org.jetbrains.kotlin.idea.gradleJava.scripting.importing.KotlinDslScriptModelResolver
|
||||
@@ -59,7 +59,7 @@ fun runPartialGradleImport(project: Project, root: GradleBuildRoot) {
|
||||
}
|
||||
|
||||
@Nls fun configurationsAreMissingRequestNeeded() = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.text")
|
||||
@Nls fun getConfigurationsActionText() = KotlinIdeaGradleBundle.message("action.text.load.script.configurations")
|
||||
@Nls fun getConfigurationsActionText() = KotlinIdeaGradleBundle.message("action.LoadKtGradleConfiguration.text")
|
||||
@Nls fun configurationsAreMissingRequestNeededHelp(): String = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.help")
|
||||
@Nls fun configurationsAreMissingAfterRequest(): String = KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.text")
|
||||
|
||||
@@ -81,11 +81,7 @@ fun scriptConfigurationsNeedToBeUpdated(project: Project, file: VirtualFile) {
|
||||
|
||||
fun scriptConfigurationsAreUpToDate(project: Project): Boolean = true
|
||||
|
||||
class LoadConfigurationAction : AnAction(
|
||||
KotlinIdeaGradleBundle.message("action.text.load.script.configurations"),
|
||||
KotlinIdeaGradleBundle.message("action.description.load.script.configurations"),
|
||||
KotlinIcons.LOAD_SCRIPT_CONFIGURATION
|
||||
) {
|
||||
internal class LoadKtGradleConfigurationAction : AnAction() {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val project = e.project ?: return
|
||||
val editor = e.getData(CommonDataKeys.EDITOR) ?: return
|
||||
|
||||
+2
-2
@@ -3,7 +3,6 @@ package org.jetbrains.kotlin.gradle
|
||||
|
||||
import org.jetbrains.kotlin.idea.codeInsight.gradle.MultiplePluginVersionGradleImportingTestCase
|
||||
import org.jetbrains.kotlin.idea.completion.test.assertInstanceOf
|
||||
import org.jetbrains.kotlin.idea.gradleJava.scripting.LoadConfigurationAction
|
||||
import org.jetbrains.kotlin.idea.gradleJava.scripting.importing.KotlinDslScriptModel
|
||||
import org.jetbrains.kotlin.idea.gradleJava.scripting.roots.GradleBuildRoot
|
||||
import org.jetbrains.kotlin.idea.gradleJava.scripting.roots.GradleBuildRootsManager
|
||||
@@ -22,7 +21,8 @@ abstract class PartialGradleImportTest : MultiplePluginVersionGradleImportingTes
|
||||
class Regular : PartialGradleImportTest() {
|
||||
/**
|
||||
* Regular Gradle sync / import should not run in 'classpath' mode to prevent swallowing issues described in:
|
||||
* Only when running the special [LoadConfigurationAction] this special mode shall be used.
|
||||
* Only when running the special [org.jetbrains.kotlin.idea.gradleJava.scripting.LoadKtGradleConfigurationAction]
|
||||
* this special mode shall be used.
|
||||
* https://youtrack.jetbrains.com/issue/KT-48823
|
||||
* https://youtrack.jetbrains.com/issue/KTIJ-19823
|
||||
*/
|
||||
|
||||
+5
-3
@@ -29,9 +29,11 @@ notification.wasNotImportedAfterCreation.help=<div width=400>\
|
||||
Import the external Gradle project or load the configurations \
|
||||
to get script code insight.</p>\
|
||||
</div>
|
||||
action.text.load.script.configurations=Load Script Configurations
|
||||
action.description.load.script.configurations=The Gradle Kotlin DSL script configuration has been changed. Load the changes to get code insight without importing the external Gradle project.
|
||||
notification.notEvaluatedInLastImport.text=Code insight unavailable (script configuration wasn't received).
|
||||
|
||||
action.LoadKtGradleConfiguration.text=Load Script Configurations
|
||||
action.LoadKtGradleConfiguration.description=The Gradle Kotlin DSL script configuration has been changed. Load the changes to get code insight without importing the external Gradle project.
|
||||
|
||||
notification.notEvaluatedInLastImport.text=Code insight is unavailable (script configuration wasn't received).
|
||||
notification.notEvaluatedInLastImport.addAsStandaloneAction=Add to standalone scripts
|
||||
notification.notEvaluatedInLastImport.info=<div width=400>\
|
||||
<p>The Gradle project that evaluates this script needs to be imported to have it analyzed by the IDE. \
|
||||
|
||||
Reference in New Issue
Block a user