Avoid rebuilds after changes of layouts xml-files

This commit makes IC react more granularly on these changes
Precisely, it marks dirty only kt-files that having lookups into
synthetic package built upon a changed layout-file

 #KT-21622 Fixed
This commit is contained in:
Denis Zharkov
2017-12-05 17:52:21 +03:00
parent 58123f2103
commit e24e711208
11 changed files with 99 additions and 19 deletions
@@ -35,8 +35,14 @@ fun LookupTracker.record(from: LookupLocation, scopeOwner: ClassDescriptor, name
}
fun LookupTracker.record(from: LookupLocation, scopeOwner: PackageFragmentDescriptor, name: Name) {
recordPackageLookup(from, scopeOwner.fqName.asString(), name.asString())
}
fun LookupTracker.recordPackageLookup(from: LookupLocation, packageFqName: String, name: String) {
if (this === LookupTracker.DO_NOTHING) return
val location = from.location ?: return
val position = if (requiresPosition) location.position else Position.NO_POSITION
record(location.filePath, position, scopeOwner.fqName.asString(), ScopeKind.PACKAGE, name.asString())
record(location.filePath, position, packageFqName, ScopeKind.PACKAGE, name)
}
const val ANDROID_LAYOUT_CONTENT_LOOKUP_NAME = "<LAYOUT-CONTENT>"