org.jetbrains.jet.cli.jvm.compiler
Class CliLightClassGenerationSupport
java.lang.Object
org.jetbrains.jet.asJava.LightClassGenerationSupport
org.jetbrains.jet.cli.jvm.compiler.CliLightClassGenerationSupport
public class CliLightClassGenerationSupport
- extends LightClassGenerationSupport
This class solves the problem of interdependency between analyzing Kotlin code and generating JetLightClasses
Consider the following example:
KClass.kt refers to JClass.java and vice versa
To analyze KClass.kt we need to load descriptors from JClass.java, and to do that we need a JetLightClass instance for KClass,
which can only be constructed when the structure of KClass is known.
To mitigate this, CliLightClassGenerationSupport hold a trace that is shared between the analyzer and JetLightClasses
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CliLightClassGenerationSupport
public CliLightClassGenerationSupport()
getInstanceForCli
public static CliLightClassGenerationSupport getInstanceForCli(@NotNull
com.intellij.openapi.project.Project project)
getTrace
@NotNull
public BindingTrace getTrace()
getModule
@NotNull
public ModuleDescriptorImpl getModule()
setModule
@TestOnly
public void setModule(@NotNull
ModuleDescriptorImpl module)
newBindingTrace
@TestOnly
public void newBindingTrace()
getContextForPackage
@NotNull
public LightClassConstructionContext getContextForPackage(@NotNull
java.util.Collection<JetFile> files)
- Specified by:
getContextForPackage
in class LightClassGenerationSupport
getContextForClassOrObject
@NotNull
public LightClassConstructionContext getContextForClassOrObject(@NotNull
JetClassOrObject classOrObject)
- Specified by:
getContextForClassOrObject
in class LightClassGenerationSupport
findClassOrObjectDeclarations
@NotNull
public java.util.Collection<JetClassOrObject> findClassOrObjectDeclarations(@NotNull
FqName fqName,
@NotNull
com.intellij.psi.search.GlobalSearchScope searchScope)
- Specified by:
findClassOrObjectDeclarations
in class LightClassGenerationSupport
findFilesForPackage
@NotNull
public java.util.Collection<JetFile> findFilesForPackage(@NotNull
FqName fqName,
@NotNull
com.intellij.psi.search.GlobalSearchScope searchScope)
- Specified by:
findFilesForPackage
in class LightClassGenerationSupport
findClassOrObjectDeclarationsInPackage
@NotNull
public java.util.Collection<JetClassOrObject> findClassOrObjectDeclarationsInPackage(@NotNull
FqName packageFqName,
@NotNull
com.intellij.psi.search.GlobalSearchScope searchScope)
- Specified by:
findClassOrObjectDeclarationsInPackage
in class LightClassGenerationSupport
packageExists
public boolean packageExists(@NotNull
FqName fqName,
@NotNull
com.intellij.psi.search.GlobalSearchScope scope)
- Specified by:
packageExists
in class LightClassGenerationSupport
getSubPackages
@NotNull
public java.util.Collection<FqName> getSubPackages(@NotNull
FqName fqn,
@NotNull
com.intellij.psi.search.GlobalSearchScope scope)
- Specified by:
getSubPackages
in class LightClassGenerationSupport
getPsiClass
@Nullable
public com.intellij.psi.PsiClass getPsiClass(@NotNull
JetClassOrObject classOrObject)
- Specified by:
getPsiClass
in class LightClassGenerationSupport