Rename: findSyntheticFiles -> filterNotInSource
This commit is contained in:
+4
-4
@@ -353,11 +353,11 @@ class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getFacadeToAnalyzeFiles(files: Collection<KtFile>): ResolutionFacade {
|
private fun getFacadeToAnalyzeFiles(files: Collection<KtFile>): ResolutionFacade {
|
||||||
val syntheticFiles = findSyntheticFiles(files)
|
val notInSourceFiles = files.filterNotInProjectSource()
|
||||||
val file = files.first()
|
val file = files.first()
|
||||||
val moduleInfo = file.getModuleInfo()
|
val moduleInfo = file.getModuleInfo()
|
||||||
if (syntheticFiles.isNotEmpty()) {
|
if (notInSourceFiles.isNotEmpty()) {
|
||||||
val projectFacade = getFacadeForSyntheticFiles(syntheticFiles)
|
val projectFacade = getFacadeForSyntheticFiles(notInSourceFiles)
|
||||||
return ResolutionFacadeImpl(projectFacade, moduleInfo)
|
return ResolutionFacadeImpl(projectFacade, moduleInfo)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -379,7 +379,7 @@ class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
|
|||||||
return ResolutionFacadeImpl(projectFacade, moduleInfo)
|
return ResolutionFacadeImpl(projectFacade, moduleInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun findSyntheticFiles(files: Collection<KtFile>) = files.mapNotNull {
|
private fun Collection<KtFile>.filterNotInProjectSource() = mapNotNull {
|
||||||
if (it is KtCodeFragment) it.getContextFile() else it
|
if (it is KtCodeFragment) it.getContextFile() else it
|
||||||
}.filter {
|
}.filter {
|
||||||
!ProjectRootsUtil.isInProjectSource(it)
|
!ProjectRootsUtil.isInProjectSource(it)
|
||||||
|
|||||||
Reference in New Issue
Block a user