diff --git a/compiler/frontend/src/org/jetbrains/kotlin/incremental/utils.kt b/compiler/frontend/src/org/jetbrains/kotlin/incremental/utils.kt index 1af2911323f..f356650dcf2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/incremental/utils.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/incremental/utils.kt @@ -25,7 +25,6 @@ import org.jetbrains.kotlin.incremental.components.NoLookupLocation import org.jetbrains.kotlin.incremental.components.ScopeKind import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.doNotAnalyze -import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe import org.jetbrains.kotlin.resolve.scopes.JetScope @@ -43,7 +42,6 @@ public fun LookupTracker.record(from: LookupLocation, inScope: JetScope, name: N val lineAndColumn = if (requiresLookupLineAndColumn) getLineAndColumnInPsiFile(containingJetFile, from.element.textRange) else null val scopeContainingDeclaration = inScope.getContainingDeclaration() - val scopeFilePath = DescriptorToSourceUtils.getContainingFile(scopeContainingDeclaration)?.virtualFile?.path val scopeKind = when (scopeContainingDeclaration) { @@ -52,7 +50,5 @@ public fun LookupTracker.record(from: LookupLocation, inScope: JetScope, name: N else -> throw AssertionError("Unexpected containing declaration type: ${scopeContainingDeclaration.javaClass}") } - record(containingFilePath, lineAndColumn?.line, lineAndColumn?.column, - scopeContainingDeclaration.fqNameUnsafe.asString(), scopeFilePath, scopeKind, - name.asString()) + record(containingFilePath, lineAndColumn?.line, lineAndColumn?.column, scopeContainingDeclaration.fqNameUnsafe.asString(), scopeKind, name.asString()) } diff --git a/core/descriptors/src/org/jetbrains/kotlin/incremental/components/LookupTracker.kt b/core/descriptors/src/org/jetbrains/kotlin/incremental/components/LookupTracker.kt index 29dae9f32b2..5213d9cd623 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/incremental/components/LookupTracker.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/incremental/components/LookupTracker.kt @@ -26,7 +26,6 @@ public interface LookupTracker { lookupLine: Int?, lookupColumn: Int?, scopeFqName: String, - scopeContainingFile: String?, scopeKind: ScopeKind, name: String ) @@ -38,7 +37,6 @@ public interface LookupTracker { lookupLine: Int?, lookupColumn: Int?, scopeFqName: String, - scopeContainingFile: String?, scopeKind: ScopeKind, name: String ) { diff --git a/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt b/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt index 71295fc989b..27e54d25e60 100644 --- a/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt +++ b/jps-plugin/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt @@ -66,13 +66,10 @@ abstract class AbstractLookupTrackerTest : AbstractIncrementalJpsTest( val end = column - 1 parts.add(lineContent.subSequence(start, end)) - val stringifyLookupInfo: LookupInfo.() -> String = { - val scopeKindChar = scopeKind.toString()[0].toLowerCase() - val scopeFileOrEmpty = scopeContainingFile?.let { "($it)" } ?: "" - "$scopeKindChar:$scopeFqName$scopeFileOrEmpty" + val lookups = lookupsFromColumn.distinct().joinToString(separator = " ", prefix = "/*", postfix = "*/") { + it.scopeKind.toString()[0].toLowerCase().toString() + ":" + it.scopeFqName } - - parts.add(lookupsFromColumn.distinct().joinToString(separator = " ", prefix = "/*", postfix = "*/", transform = stringifyLookupInfo)) + parts.add(lookups) start = end } @@ -101,7 +98,6 @@ private data class LookupInfo( val lookupLine: Int?, val lookupColumn: Int?, val scopeFqName: String, - val scopeContainingFile: String?, val scopeKind: ScopeKind, val name: String ) @@ -114,10 +110,9 @@ private class TestLookupTracker : LookupTracker { override fun record( lookupContainingFile: String, lookupLine: Int?, lookupColumn: Int?, - scopeFqName: String, scopeContainingFile: String?, scopeKind: ScopeKind, - name: String + scopeFqName: String, scopeKind: ScopeKind, name: String ) { - lookups.add(LookupInfo(lookupContainingFile, lookupLine, lookupColumn, scopeFqName, scopeContainingFile, scopeKind, name)) + lookups.add(LookupInfo(lookupContainingFile, lookupLine, lookupColumn, scopeFqName, scopeKind, name)) } }