Debugger: Fix breakpoint firing in '$suspendImpl' (KT-27645)

This commit is contained in:
Yan Zhulanow
2019-08-01 21:18:16 +09:00
parent 9096d211d3
commit 0a092d6613
9 changed files with 208 additions and 129 deletions
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.util
import org.jetbrains.kotlin.cfg.pseudocode.containingDeclarationForPseudocode
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.KtPsiUtil
fun KtElement.containingNonLocalDeclaration(): KtDeclaration? {
var container = this.containingDeclarationForPseudocode
while (container != null && KtPsiUtil.isLocal(container)) {
container = container.containingDeclarationForPseudocode
}
return container
}