gradle scripts: temporary disable irrelevant actions when script configuration was not received during import

This commit is contained in:
Sergey Rostov
2020-06-18 15:07:44 +03:00
parent a7675c16d5
commit d6fc830c24
@@ -58,21 +58,23 @@ class GradleScriptNotificationProvider(private val project: Project) :
notEvaluatedInLastImport -> EditorNotificationPanel().apply { notEvaluatedInLastImport -> EditorNotificationPanel().apply {
text(KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.text")) text(KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.text"))
// todo: this actions will be usefull only when gradle fix https://github.com/gradle/gradle/issues/12640
// suggest to reimport project if something changed after import // suggest to reimport project if something changed after import
val root = scriptUnderRoot.nearest as? Imported // val root = scriptUnderRoot.nearest as? Imported
val importTs = root?.data?.importTs val importTs = root?.data?.importTs
if (root != null && importTs != null && !root.areRelatedFilesChangedBefore(file, importTs)) { // if (root != null && importTs != null && !root.areRelatedFilesChangedBefore(file, importTs)) {
createActionLabel(getMissingConfigurationActionText()) { // createActionLabel(getMissingConfigurationActionText()) {
rootsManager.updateStandaloneScripts { // rootsManager.updateStandaloneScripts {
runPartialGradleImport(project, root) // runPartialGradleImport(project, root)
} // }
} // }
} // }
// todo: this actions will be usefull only when gradle fix https://github.com/gradle/gradle/issues/12640
// suggest to choose new gradle project // suggest to choose new gradle project
createActionLabel(KotlinIdeaGradleBundle.message("notification.outsideAnything.linkAction")) { // createActionLabel(KotlinIdeaGradleBundle.message("notification.outsideAnything.linkAction")) {
linkProject(project) // linkProject(project)
} // }
createActionLabel(KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.addAsStandaloneAction")) { createActionLabel(KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.addAsStandaloneAction")) {
rootsManager.updateStandaloneScripts { rootsManager.updateStandaloneScripts {