[AA] KtModule#project shouldn't be null
^KT-55336
This commit is contained in:
committed by
Space Team
parent
f0642d6c9a
commit
5c9aa88617
+4
-2
@@ -24,7 +24,8 @@ internal class KtModuleProviderImpl(
|
||||
) : ProjectStructureProvider() {
|
||||
private val ktNotUnderContentRootModuleWithoutPsiFile by lazy {
|
||||
KtNotUnderContentRootModuleImpl(
|
||||
moduleDescription = "Standalone-not-under-content-root-module-without-psi-file"
|
||||
moduleDescription = "Standalone-not-under-content-root-module-without-psi-file",
|
||||
project = project,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -44,7 +45,8 @@ internal class KtModuleProviderImpl(
|
||||
?: return notUnderContentRootModuleCache.getOrPut(containingFileAsPsiFile) {
|
||||
KtNotUnderContentRootModuleImpl(
|
||||
moduleDescription = "Standalone-not-under-content-root-module-for-$containingFileAsPsiFile",
|
||||
psiFile = containingFileAsPsiFile
|
||||
psiFile = containingFileAsPsiFile,
|
||||
project = project,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.analysis.project.structure.impl
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModule
|
||||
@@ -20,9 +21,10 @@ internal class KtNotUnderContentRootModuleImpl(
|
||||
override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,
|
||||
psiFile: 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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user