ClsWrapperStubPsiFactory can be a singleton
This commit is contained in:
@@ -31,8 +31,12 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class ClsWrapperStubPsiFactory extends StubPsiFactory {
|
||||
public static final Key<LightElementOrigin> ORIGIN = Key.create("ORIGIN");
|
||||
public static final ClsWrapperStubPsiFactory INSTANCE = new ClsWrapperStubPsiFactory();
|
||||
|
||||
private final StubPsiFactory delegate = new ClsStubPsiFactory();
|
||||
|
||||
private ClsWrapperStubPsiFactory() { }
|
||||
|
||||
@Nullable
|
||||
public static LightMemberOriginForDeclaration getMemberOrigin(@NotNull PsiMember member) {
|
||||
if (member instanceof ClsRepositoryPsiElement<?>) {
|
||||
|
||||
@@ -127,7 +127,7 @@ abstract class LightClassDataProvider<T : WithFileStubAndExtraDiagnostics>(
|
||||
|
||||
private fun createJavaFileStub(packageFqName: FqName, files: Collection<KtFile>): PsiJavaFileStub {
|
||||
val javaFileStub = PsiJavaFileStubImpl(packageFqName.asString(), true)
|
||||
javaFileStub.psiFactory = ClsWrapperStubPsiFactory()
|
||||
javaFileStub.psiFactory = ClsWrapperStubPsiFactory.INSTANCE
|
||||
|
||||
val manager = PsiManager.getInstance(project)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user