Minor: refactoring KotlinUnusedImportInspection
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user