Compare lookups without respect to their order

Original commit: 7526ff9484
This commit is contained in:
Ilya Muradyan
2020-06-17 15:33:29 +03:00
committed by Ilya Chernikov
parent 68fbddd3d7
commit 68619252a8
47 changed files with 352 additions and 351 deletions
@@ -320,20 +320,21 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() {
val end = column - 1
parts.add(lineContent.subSequence(start, end))
val lookups = lookupsFromColumn.distinct().joinToString(separator = " ", prefix = "/*", postfix = "*/") {
val lookups = lookupsFromColumn.mapTo(sortedSetOf()) {
val rest = lineContent.substring(end)
val name =
when {
rest.startsWith(it.name) || // same name
rest.startsWith("$" + it.name) || // backing field
DECLARATION_STARTS_WITH.any { rest.startsWith(it) } // it's declaration
-> ""
else -> "(" + it.name + ")"
}
when {
rest.startsWith(it.name) || // same name
rest.startsWith("$" + it.name) || // backing field
DECLARATION_STARTS_WITH.any { rest.startsWith(it) } // it's declaration
-> ""
else -> "(" + it.name + ")"
}
it.scopeKind.toString()[0].toLowerCase().toString() + ":" + it.scopeFqName.let { if (it.isNotEmpty()) it else "<root>" } + name
}
it.scopeKind.toString()[0].toLowerCase()
.toString() + ":" + it.scopeFqName.let { if (it.isNotEmpty()) it else "<root>" } + name
}.joinToString(separator = " ", prefix = "/*", postfix = "*/")
parts.add(lookups)