Line Markers: Filter out irrelevant declarations before resolving in KotlinTestRunLineMarkerContributor

#KT-12647 Fixed
(cherry picked from commit cceeaeb)
This commit is contained in:
Alexey Sedunov
2016-06-22 17:15:17 +03:00
parent 068a120600
commit 932892243c
2 changed files with 3 additions and 0 deletions
@@ -53,6 +53,8 @@ class KotlinTestRunLineMarkerContributor : RunLineMarkerContributor() {
val declaration = element.getStrictParentOfType<KtNamedDeclaration>() ?: return null
if (declaration.nameIdentifier != element) return null
if (declaration !is KtClassOrObject && declaration !is KtNamedFunction) return null
// To prevent IDEA failing on red code
if (declaration.resolveToDescriptorIfAny() == null) return null