Minor: fix notification text when script configuration is missing after request
This commit is contained in:
@@ -34,7 +34,8 @@ action.label.import.project=Import Project
|
||||
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.
|
||||
action.label.enable.auto.import=Enable Auto-Import
|
||||
notification.notEvaluatedInLastImport.text=Code insight unavailable (configuration for this script wasn't received during the last Gradle project import).
|
||||
notification.notEvaluatedInLastImport.193.text=Code insight unavailable (script configuration wasn't received during the last Gradle project import).
|
||||
notification.notEvaluatedInLastImport.text=Code insight 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. \
|
||||
|
||||
+4
-3
@@ -56,9 +56,10 @@ fun runPartialGradleImport(project: Project, root: GradleBuildRoot) {
|
||||
)
|
||||
}
|
||||
|
||||
fun getMissingConfigurationsDescription() = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.text")
|
||||
fun getMissingConfigurationActionText() = KotlinIdeaGradleBundle.message("action.text.load.script.configurations")
|
||||
fun getMissingConfigurationsHelp(): String? = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.help")
|
||||
fun configurationsAreMissingRequestNeeded() = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.text")
|
||||
fun getConfigurationsActionText() = KotlinIdeaGradleBundle.message("action.text.load.script.configurations")
|
||||
fun configurationsAreMissingRequestNeededHelp(): String? = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.help")
|
||||
fun configurationsAreMissingAfterRequest(): String = KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.text")
|
||||
|
||||
fun autoReloadScriptConfigurations(project: Project, file: VirtualFile): Boolean {
|
||||
val definition = file.findScriptDefinition(project) ?: return false
|
||||
|
||||
+4
-3
@@ -49,9 +49,10 @@ fun runPartialGradleImport(project: Project, root: GradleBuildRoot) {
|
||||
)
|
||||
}
|
||||
|
||||
fun getMissingConfigurationsDescription() = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.193.text")
|
||||
fun getMissingConfigurationActionText() = KotlinIdeaGradleBundle.message("action.label.import.project")
|
||||
fun getMissingConfigurationsHelp(): String? = null
|
||||
fun configurationsAreMissingRequestNeeded() = KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.193.text")
|
||||
fun getConfigurationsActionText() = KotlinIdeaGradleBundle.message("action.label.import.project")
|
||||
fun configurationsAreMissingRequestNeededHelp(): String? = null
|
||||
fun configurationsAreMissingAfterRequest(): String = KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.193.text")
|
||||
|
||||
fun autoReloadScriptConfigurations(project: Project, root: GradleBuildRoot): Boolean {
|
||||
return ExternalSystemApiUtil
|
||||
|
||||
+5
-5
@@ -46,7 +46,7 @@ class GradleScriptNotificationProvider(private val project: Project) :
|
||||
val build: Imported = scriptUnderRoot.nearest as? Imported ?: return
|
||||
val importTs = build.data.importTs
|
||||
if (!build.areRelatedFilesChangedBefore(file, importTs)) {
|
||||
createActionLabel(getMissingConfigurationActionText()) {
|
||||
createActionLabel(getConfigurationsActionText()) {
|
||||
rootsManager.updateStandaloneScripts {
|
||||
runPartialGradleImport(project, build)
|
||||
}
|
||||
@@ -107,20 +107,20 @@ class GradleScriptNotificationProvider(private val project: Project) :
|
||||
}
|
||||
}
|
||||
wasNotImportedAfterCreation -> EditorNotificationPanel().apply {
|
||||
text(getMissingConfigurationsDescription())
|
||||
createActionLabel(getMissingConfigurationActionText()) {
|
||||
text(configurationsAreMissingRequestNeeded())
|
||||
createActionLabel(getConfigurationsActionText()) {
|
||||
val root = scriptUnderRoot.nearest
|
||||
if (root != null) {
|
||||
runPartialGradleImport(project, root)
|
||||
}
|
||||
}
|
||||
val help = getMissingConfigurationsHelp()
|
||||
val help = configurationsAreMissingRequestNeededHelp()
|
||||
if (help != null) {
|
||||
contextHelp(help)
|
||||
}
|
||||
}
|
||||
notEvaluatedInLastImport -> EditorNotificationPanel().apply {
|
||||
text(KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.text"))
|
||||
text(configurationsAreMissingAfterRequest())
|
||||
|
||||
// todo: this actions will be usefull only when gradle fix https://github.com/gradle/gradle/issues/12640
|
||||
// showActionsToFixNotEvaluated()
|
||||
|
||||
Reference in New Issue
Block a user