Debugger: Support Kotlin variables for inlined lambdas inside inline functions (KT-31418)

This commit is contained in:
Yan Zhulanow
2019-05-22 17:27:23 +09:00
parent afa0bec6f6
commit b4f515a436
8 changed files with 63 additions and 15 deletions
@@ -22,7 +22,6 @@ fun getInlineDepth(variables: List<LocalVariableProxyImpl>): Int {
if (depth > 0) {
return depth
} else if (name.startsWith(LOCAL_VARIABLE_NAME_PREFIX_INLINE_ARGUMENT)) {
// TODO this heuristics doesn't support debugging inlined lambdas inside inline functions.
return 0
}
}
@@ -47,6 +46,15 @@ fun getInlineDepth(variableName: String): Int {
return depth
}
fun dropInlineSuffix(name: String): String {
val depth = getInlineDepth(name)
if (depth == 0) {
return name
}
return name.dropLast(depth * INLINE_FUN_VAR_SUFFIX.length)
}
private fun getLocalVariableNameRegexInlineAware(name: String): Regex {
val escapedName = Regex.escape(name)
val escapedSuffix = Regex.escape(INLINE_FUN_VAR_SUFFIX)