Revert Open build tool window on Gradle DSL errors
Proper fix is (to handle any exceptions within ProjectModelContributor EPs) is done in a platform ^EA-236697 Fixed
This commit is contained in:
+6
-1
@@ -12,6 +12,7 @@ import com.intellij.openapi.vfs.VfsUtil
|
||||
import org.gradle.tooling.model.kotlin.dsl.EditorReportSeverity
|
||||
import org.gradle.tooling.model.kotlin.dsl.KotlinDslScriptsModel
|
||||
import org.jetbrains.kotlin.gradle.BrokenKotlinDslScriptsModel
|
||||
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
|
||||
import org.jetbrains.kotlin.idea.scripting.gradle.getGradleScriptInputsStamp
|
||||
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRootsManager
|
||||
import org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel
|
||||
@@ -72,7 +73,11 @@ fun processScriptModel(
|
||||
it.failed = true
|
||||
}
|
||||
}
|
||||
handleError(project, errors)
|
||||
throw IllegalStateException(
|
||||
KotlinIdeaGradleBundle.message("title.kotlin.build.script")
|
||||
+ ":\n"
|
||||
+ errors.joinToString("\n") { it.text + "\n" + it.details }
|
||||
)
|
||||
}
|
||||
errors.isEmpty()
|
||||
}
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.scripting.gradle.importing
|
||||
|
||||
import com.intellij.build.BuildContentManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
|
||||
import org.jetbrains.kotlin.idea.util.application.invokeLater
|
||||
import org.jetbrains.kotlin.idea.util.application.isUnitTestMode
|
||||
|
||||
internal fun handleError(project: Project, errors: List<KotlinDslScriptModel.Message>) {
|
||||
if (isUnitTestMode()) {
|
||||
throw IllegalStateException(
|
||||
KotlinIdeaGradleBundle.message("title.kotlin.build.script")
|
||||
+ ":\n"
|
||||
+ errors.joinToString("\n") { it.text + "\n" + it.details }
|
||||
)
|
||||
}
|
||||
invokeLater(project.disposed) {
|
||||
BuildContentManager.getInstance(project).orCreateToolWindow.activate(null, false, false)
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.scripting.gradle.importing
|
||||
|
||||
import com.intellij.build.BuildContentManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.idea.util.application.invokeLater
|
||||
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
|
||||
|
||||
// FIX ME WHEN BUNCH 193 REMOVED
|
||||
internal fun handleError(project: Project, errors: List<KotlinDslScriptModel.Message>) {
|
||||
throw IllegalStateException(
|
||||
KotlinIdeaGradleBundle.message("title.kotlin.build.script")
|
||||
+ ":\n"
|
||||
+ errors.joinToString("\n") { it.text + "\n" + it.details }
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user