Minor: refactoring KotlinUnusedImportInspection
This commit is contained in:
@@ -195,14 +195,14 @@ class KotlinUnusedImportInspection : AbstractKotlinInspection() {
|
|||||||
|
|
||||||
val document = editor.document
|
val document = editor.document
|
||||||
var hasErrors = false
|
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)) {
|
if (!importsRange.containsRange(highlightInfo.startOffset, highlightInfo.endOffset)) {
|
||||||
hasErrors = true
|
hasErrors = true
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
if (hasErrors) return false
|
if (hasErrors) return false
|
||||||
|
|
||||||
return DaemonListeners.canChangeFileSilently(file)
|
return DaemonListeners.canChangeFileSilently(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user