From 7e4b3ceedea6bcac3a769f3c032cffa991e39b78 Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Wed, 20 Mar 2019 19:24:14 +0700 Subject: [PATCH] Minor: refactoring KotlinUnusedImportInspection --- .../kotlin/idea/inspections/KotlinUnusedImportInspection.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinUnusedImportInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinUnusedImportInspection.kt index ca57ac24eb1..d8c3125285a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinUnusedImportInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinUnusedImportInspection.kt @@ -195,14 +195,14 @@ class KotlinUnusedImportInspection : AbstractKotlinInspection() { val document = editor.document var hasErrors = false - DaemonCodeAnalyzerEx.processHighlights(document, project, HighlightSeverity.ERROR, 0, document.textLength, { highlightInfo -> + DaemonCodeAnalyzerEx.processHighlights(document, project, HighlightSeverity.ERROR, 0, document.textLength) { highlightInfo -> if (!importsRange.containsRange(highlightInfo.startOffset, highlightInfo.endOffset)) { hasErrors = true false } else { true } - }) + } if (hasErrors) return false return DaemonListeners.canChangeFileSilently(file)