[AAPI] Introduce PsiFile in KtNotUnderContentRootModule
Indices are not available in the IDE for files outside content roots, and the newly introduced 'PsiFile' can be used for searching classifiers instead.
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@ internal class KtModuleProviderImpl(
|
||||
?: return notUnderContentRootModuleCache.getOrPut(containingFileAsPsiFile) {
|
||||
KtNotUnderContentRootModuleImpl(
|
||||
moduleDescription = "Standalone-not-under-content-root-module-for-$containingFileAsPsiFile",
|
||||
psiFile = containingFileAsPsiFile,
|
||||
file = containingFileAsPsiFile,
|
||||
project = project,
|
||||
)
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,12 +19,12 @@ internal class KtNotUnderContentRootModuleImpl(
|
||||
override val directRefinementDependencies: List<KtModule> = emptyList(),
|
||||
override val directFriendDependencies: List<KtModule> = emptyList(),
|
||||
override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,
|
||||
psiFile: PsiFile? = null,
|
||||
override val file: PsiFile? = null,
|
||||
override val moduleDescription: String,
|
||||
override val project: Project,
|
||||
) : KtNotUnderContentRootModule, KtModuleWithPlatform {
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices = super.analyzerServices
|
||||
|
||||
override val contentScope: GlobalSearchScope =
|
||||
if (psiFile != null) GlobalSearchScope.fileScope(psiFile) else GlobalSearchScope.EMPTY_SCOPE
|
||||
if (file != null) GlobalSearchScope.fileScope(file) else GlobalSearchScope.EMPTY_SCOPE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user