Move GradleQuickFixTest checks in EDT Thread
This commit is contained in:
+10
-8
@@ -60,15 +60,17 @@ class GradleQuickFixTest : GradleImportingTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun applyInspectionFixes(tool: LocalInspectionTool, file: VirtualFile) {
|
private fun applyInspectionFixes(tool: LocalInspectionTool, file: VirtualFile) {
|
||||||
invokeTestRunnable {
|
runInEdtAndWait {
|
||||||
val presentation = runInspection(tool, myProject, listOf(file))
|
invokeTestRunnable {
|
||||||
|
val presentation = runInspection(tool, myProject, listOf(file))
|
||||||
|
|
||||||
WriteCommandAction.runWriteCommandAction(myProject) {
|
WriteCommandAction.runWriteCommandAction(myProject) {
|
||||||
val foundProblems = presentation.problemElements.values.mapNotNull { it as? ProblemDescriptorBase }
|
val foundProblems = presentation.problemElements.values.mapNotNull { it as? ProblemDescriptorBase }
|
||||||
for (problem in foundProblems) {
|
for (problem in foundProblems) {
|
||||||
val fixes = problem.fixes
|
val fixes = problem.fixes
|
||||||
if (fixes != null) {
|
if (fixes != null) {
|
||||||
fixes[0].applyFix(myProject, problem)
|
fixes[0].applyFix(myProject, problem)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user