Compare lookups without respect to their order
Original commit: 7526ff9484
This commit is contained in:
committed by
Ilya Chernikov
parent
68fbddd3d7
commit
68619252a8
+11
-10
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user