EA-215375: Check range, not rangeMarker with nullable 'range' inside

This commit is contained in:
Yan Zhulanow
2019-11-13 20:44:13 +09:00
parent 89bd3b8767
commit 3d17af0ada
@@ -152,10 +152,11 @@ class J2kPostProcessor(private val formatCode: Boolean) : PostProcessor {
}
private fun analyzeFileRange(file: KtFile, rangeMarker: RangeMarker?): Diagnostics {
val elements = if (rangeMarker == null)
val range = rangeMarker?.range
val elements = if (range == null)
listOf(file)
else
file.elementsInRange(rangeMarker.range!!).filterIsInstance<KtElement>()
file.elementsInRange(range).filterIsInstance<KtElement>()
return if (elements.isNotEmpty())
file.getResolutionFacade().analyzeWithAllCompilerChecks(elements).bindingContext.diagnostics