diff --git a/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt b/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt index 9ad02b0d9c1a..c75eae1f92c3 100644 --- a/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt +++ b/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt @@ -17,7 +17,6 @@ package com.intellij.javascript.debugger import com.google.common.base.CharMatcher import com.intellij.openapi.editor.Document -import com.intellij.openapi.util.registry.Registry import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.PsiElement import com.intellij.psi.PsiNamedElement @@ -40,8 +39,11 @@ open class NameMapper(private val document: Document, private val transpiledDocu // PsiNamedElement, JSVariable for example // returns generated name - @JvmOverloads - open fun map(identifierOrNamedElement: PsiElement, forceMapBySourceCode: Boolean = false): String? { + open fun map(identifierOrNamedElement: PsiElement): String? { + return doMap(identifierOrNamedElement, false) + } + + protected fun doMap(identifierOrNamedElement: PsiElement, mapBySourceCode: Boolean): String? { val offset = identifierOrNamedElement.textOffset val line = document.getLineNumber(offset) @@ -70,7 +72,7 @@ open class NameMapper(private val document: Document, private val transpiledDocu } var sourceName = sourceEntry.name - if (sourceName == null || forceMapBySourceCode || Registry.`is`("js.debugger.name.mappings.by.source.code", false)) { + if (sourceName == null || mapBySourceCode) { sourceName = (identifierOrNamedElement as? PsiNamedElement)?.name ?: identifierOrNamedElement.text ?: sourceName ?: return null } diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 3501142dd6d1..f44caccd5529 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -965,7 +965,9 @@ js.debugger.v8.use.any.breakpoint=true js.debugger.chrome.use.any.breakpoint=true nodejs.debugger.use.jb.support=true js.debugger.name.mappings.by.source.code=false -js.debugger.map.this.by.source.code=true +js.debugger.name.mappings.by.source.code.description=Use source map positions to get names matching all local symbols +js.debugger.map.this.by.source.code=false +js.debugger.map.this.by.source.code.description=Use source map positions to get name matching 'this' js.debugger.v8.log= js.debugger.wip.log= js.debugger.fix.jspm.source.maps=false