mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Review comments
#KTIJ-20396 GitOrigin-RevId: 9b71f5a3895b0b1e34033bddc262b303598c0e1b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6496faa31f
commit
e070d9d891
+5
-7
@@ -118,12 +118,10 @@ class KotlinStdlibCacheImpl(val project: Project) : KotlinStdlibCache {
|
||||
|
||||
override fun findStdlibInModuleDependencies(module: IdeaModuleInfo): LibraryInfo? {
|
||||
ProgressManager.checkCanceled()
|
||||
var moduleSourceInfo: ModuleSourceInfo? = null
|
||||
val stdlibDependency = moduleStdlibDependencyCache.getOrPut(module) {
|
||||
|
||||
moduleSourceInfo = module.safeAs<ModuleSourceInfo>()
|
||||
val moduleSourceInfo = module.safeAs<ModuleSourceInfo>()
|
||||
val stdLib = moduleSourceInfo?.module?.moduleWithLibrariesScope?.let index@{ scope ->
|
||||
val filesWithinStdlib = DumbModeAccessType.RELIABLE_DATA_ONLY.ignoreDumbMode(ThrowableComputable {
|
||||
val stdlibManifests = DumbModeAccessType.RELIABLE_DATA_ONLY.ignoreDumbMode(ThrowableComputable {
|
||||
FileBasedIndex.getInstance().getContainingFiles(
|
||||
KotlinStdlibIndex.KEY,
|
||||
KotlinStdlibIndex.KOTLIN_STDLIB_NAME,
|
||||
@@ -131,8 +129,8 @@ class KotlinStdlibCacheImpl(val project: Project) : KotlinStdlibCache {
|
||||
)
|
||||
})
|
||||
val index = ProjectFileIndex.SERVICE.getInstance(project)
|
||||
for (file in filesWithinStdlib) {
|
||||
val orderEntries = index.getOrderEntriesForFile(file)
|
||||
for (manifest in stdlibManifests) {
|
||||
val orderEntries = index.getOrderEntriesForFile(manifest)
|
||||
orderEntries.firstNotNullOfOrNull { it.safeAs<LibraryOrderEntry>()?.library.safeAs<LibraryEx>() }?.let {
|
||||
createLibraryInfo(project, it)
|
||||
}?.firstOrNull(::isStdlib)?.let {
|
||||
@@ -143,8 +141,8 @@ class KotlinStdlibCacheImpl(val project: Project) : KotlinStdlibCache {
|
||||
} ?: module.safeAs<LibraryInfo>()?.takeIf(::isStdlib) ?: module.dependencies().firstOrNull {
|
||||
it is LibraryInfo && isStdlib(it)
|
||||
} as LibraryInfo?
|
||||
|
||||
val stdlibDependency = StdlibDependency(stdLib)
|
||||
// if stdlib is created (i.e. is not fetched from a cache) for a module source info
|
||||
moduleSourceInfo?.let { _ ->
|
||||
// all module dependencies have same stdlib as module itself
|
||||
module.dependencies().forEach {
|
||||
|
||||
Reference in New Issue
Block a user