KT-63096 [LL] Remove KtModuleScopeProvider
It has no usages anymore
This commit is contained in:
-3
@@ -18,8 +18,6 @@ import org.jetbrains.kotlin.analysis.decompiled.light.classes.DecompiledLightCla
|
||||
import org.jetbrains.kotlin.analysis.decompiler.psi.BuiltInDefinitionFile
|
||||
import org.jetbrains.kotlin.analysis.decompiler.psi.KotlinBuiltInFileType
|
||||
import org.jetbrains.kotlin.analysis.decompiler.psi.file.KtClsFile
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProvider
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProviderImpl
|
||||
import org.jetbrains.kotlin.analysis.providers.*
|
||||
import org.jetbrains.kotlin.analysis.providers.impl.*
|
||||
import org.jetbrains.kotlin.analysis.test.framework.project.structure.ktModuleProvider
|
||||
@@ -74,7 +72,6 @@ object AnalysisApiBaseTestServiceRegistrar: AnalysisApiTestServiceRegistrar() {
|
||||
testServices.environmentManager.getProjectEnvironment()
|
||||
).distinct()
|
||||
project.apply {
|
||||
registerService(KtModuleScopeProvider::class.java, KtModuleScopeProviderImpl())
|
||||
registerService(KotlinAnnotationsResolverFactory::class.java, KotlinStaticAnnotationsResolverFactory(allSourceKtFiles))
|
||||
|
||||
val filter = BuiltInDefinitionFile.FILTER_OUT_CLASSES_EXISTING_AS_JVM_CLASS_FILES
|
||||
|
||||
-3
@@ -20,8 +20,6 @@ import org.jetbrains.kotlin.analysis.api.standalone.base.project.structure.LLFir
|
||||
import org.jetbrains.kotlin.analysis.api.standalone.base.project.structure.StandaloneProjectFactory
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.services.FirSealedClassInheritorsProcessorFactory
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.project.structure.LLFirLibrarySymbolProviderFactory
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProvider
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProviderImpl
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtSourceModule
|
||||
import org.jetbrains.kotlin.analysis.project.structure.builder.KtModuleProviderBuilder
|
||||
import org.jetbrains.kotlin.analysis.project.structure.builder.buildProjectStructureProvider
|
||||
@@ -127,7 +125,6 @@ public class StandaloneAnalysisAPISessionBuilder(
|
||||
registerService(KotlinModificationTrackerFactory::class.java, KotlinStaticModificationTrackerFactory::class.java)
|
||||
registerService(KotlinGlobalModificationService::class.java, KotlinStaticGlobalModificationService::class.java)
|
||||
|
||||
registerService(KtModuleScopeProvider::class.java, KtModuleScopeProviderImpl())
|
||||
registerService(KotlinAnnotationsResolverFactory::class.java, KotlinStaticAnnotationsResolverFactory(sourceKtFiles))
|
||||
registerService(KotlinResolutionScopeProvider::class.java, KotlinByModulesResolutionScopeProvider::class.java)
|
||||
val declarationProviderFactory = KotlinStaticDeclarationProviderFactory(
|
||||
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.project.structure
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
|
||||
public abstract class KtModuleScopeProvider {
|
||||
/**
|
||||
* Get a scope of binaries on which current source module depends.
|
||||
* Should be equivalent to
|
||||
*
|
||||
* ```
|
||||
* GlobalSearchScope.union(
|
||||
* sourceModule.allDependenciesOfType<KtBinaryModule>()
|
||||
* .map { it.contentScope }
|
||||
* )
|
||||
* ```
|
||||
* For the IDE there can be more optimal implementations.
|
||||
*
|
||||
* See [KtModuleScopeProviderImpl] a correct but non-optimal implementation.
|
||||
*/
|
||||
public abstract fun getModuleLibrariesScope(sourceModule: KtSourceModule): GlobalSearchScope
|
||||
}
|
||||
|
||||
public class KtModuleScopeProviderImpl : KtModuleScopeProvider() {
|
||||
override fun getModuleLibrariesScope(sourceModule: KtSourceModule): GlobalSearchScope {
|
||||
val scopes = sourceModule.allDirectDependenciesOfType<KtBinaryModule>()
|
||||
.map { it.contentScope }
|
||||
.toList()
|
||||
if (scopes.isEmpty()) return GlobalSearchScope.EMPTY_SCOPE
|
||||
return GlobalSearchScope.union(scopes)
|
||||
}
|
||||
}
|
||||
|
||||
public val Project.moduleScopeProvider: KtModuleScopeProvider
|
||||
get() = this.getService(KtModuleScopeProvider::class.java)
|
||||
Reference in New Issue
Block a user