Refactoring: extracted 'BindingContext.getDataFlowInfo'
This commit is contained in:
@@ -29,6 +29,7 @@ import java.io.File
|
||||
import org.jetbrains.jet.plugin.JetLightCodeInsightFixtureTestCase
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.jet.lang.resolve.bindingContextUtil.getDataFlowInfo
|
||||
|
||||
public abstract class AbstractDataFlowValueRenderingTest: JetLightCodeInsightFixtureTestCase() {
|
||||
override fun getTestDataPath() : String {
|
||||
@@ -46,7 +47,7 @@ public abstract class AbstractDataFlowValueRenderingTest: JetLightCodeInsightFix
|
||||
val jetFile = fixture.getFile() as JetFile
|
||||
val element = jetFile.findElementAt(fixture.getCaretOffset())
|
||||
val expression = PsiTreeUtil.getParentOfType(element, javaClass<JetExpression>())!!
|
||||
val info = AnalyzerFacadeWithCache.getContextForElement(expression)[BindingContext.EXPRESSION_DATA_FLOW_INFO, expression]!!
|
||||
val info = AnalyzerFacadeWithCache.getContextForElement(expression).getDataFlowInfo(expression)
|
||||
|
||||
val allValues = (info.getCompleteTypeInfo().keySet() + info.getCompleteNullabilityInfo().keySet()).toSet()
|
||||
val actual = allValues.map { renderDataFlowValue(it) }.filterNotNull().sort().makeString("\n")
|
||||
|
||||
Reference in New Issue
Block a user