Made private things private
This commit is contained in:
+14
-17
@@ -44,28 +44,25 @@ public abstract class DeclarationProviderFactoryService {
|
|||||||
filesScope: GlobalSearchScope
|
filesScope: GlobalSearchScope
|
||||||
): DeclarationProviderFactory {
|
): DeclarationProviderFactory {
|
||||||
return ServiceManager.getService(project, javaClass<DeclarationProviderFactoryService>())!!
|
return ServiceManager.getService(project, javaClass<DeclarationProviderFactoryService>())!!
|
||||||
.create(project, storageManager, syntheticFiles, SyntheticFilesFilteringScope.filter(syntheticFiles, filesScope))
|
.create(project, storageManager, syntheticFiles, filteringScope(syntheticFiles, filesScope))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun filteringScope(syntheticFiles: Collection<JetFile>, baseScope: GlobalSearchScope): GlobalSearchScope {
|
||||||
|
if (syntheticFiles.isEmpty()) {
|
||||||
|
return baseScope
|
||||||
|
}
|
||||||
|
return SyntheticFilesFilteringScope(syntheticFiles, baseScope)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SyntheticFilesFilteringScope(syntheticFiles: Collection<JetFile>, baseScope: GlobalSearchScope) :
|
|
||||||
DelegatingGlobalSearchScope(baseScope) {
|
|
||||||
val originals = syntheticFiles.map {
|
|
||||||
it.getOriginalFile().getVirtualFile()
|
|
||||||
}.filterNotNullTo(HashSet<VirtualFile>())
|
|
||||||
|
|
||||||
override fun contains(file: VirtualFile): Boolean {
|
private class SyntheticFilesFilteringScope(syntheticFiles: Collection<JetFile>, baseScope: GlobalSearchScope)
|
||||||
return super.contains(file) && file !in originals
|
: DelegatingGlobalSearchScope(baseScope) {
|
||||||
}
|
|
||||||
|
|
||||||
class object {
|
private val originals = syntheticFiles
|
||||||
fun filter(syntheticFiles: Collection<JetFile>, baseScope: GlobalSearchScope): GlobalSearchScope {
|
.map { it.getOriginalFile().getVirtualFile() }
|
||||||
if (syntheticFiles.isEmpty()) {
|
.filterNotNullTo(HashSet<VirtualFile>())
|
||||||
return baseScope
|
|
||||||
}
|
override fun contains(file: VirtualFile) = super.contains(file) && file !in originals
|
||||||
return SyntheticFilesFilteringScope(syntheticFiles, baseScope)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user