Minor: refactoring KotlinUnusedImportInspection

This commit is contained in:
Dmitry Gridin
2019-03-20 19:24:14 +07:00
parent 4e3d13fcee
commit 7e4b3ceede
@@ -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)