Fix class run configuration applicability (KT-33787)

The bug appeared when we turned “ultra light classes” on by default.
  The difference with the old implementation is that
  PsiClass.getTextRange() returns the correct non-null value.
  This triggers JavaExecutionUtil#stepIntoSingleClass() to return
  a light class instead of the original location (of a PsiIdentifier).
  So AbstractJavaTestConfigurationProducer#isConfigurationFromContext()
  returns true, and the wrong configuration is reused instead of
  creating the new one.

By the way, for Java it also returns an identifier because of the
  PsiTreeUtil.getParentOfType(element, PsiClass.class) != null check.

The proper fix should land in the newer versions of IDEA, however this
  (hopefully, temporary) hack will fix test method gutters for
  all platform versions.
This commit is contained in:
Yan Zhulanow
2020-02-14 17:51:42 +09:00
parent b360fb5119
commit 390d062721
6 changed files with 33 additions and 18 deletions
+5
View File
@@ -175,6 +175,11 @@
defaultValue="true"
restartRequired="false"/>
<registryKey key="kotlin.ultra.light.classes.empty.text.range"
description="Return 'null' text range as in old light class implementation"
defaultValue="true"
restartRequired="false"/>
<registryKey key="kotlin.uast.force.uinjectionhost"
description="Whether to convert `KtStringTemplateExpression` to `KotlinStringTemplateUPolyadicExpression` in all cases"
defaultValue="true"