- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DelegateCompilerAdvisor,DiskCompilerAdvisor,InMemoryCompilerAdvisor
Advises the compiler to be incremental, helps in-memory analysis,
and behaves as the bridge between the library compiler and its caller.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearLibraryOutput(@NotNull LibraryOwner owner) voidclearModuleOutput(@NotNull LibrarySource source) default voidclose()default @NotNull org.aya.syntax.GenericAyaParsercreateParser(@NotNull org.aya.util.reporter.Reporter reporter) Used for injecting parser from IJ plugin to support on-the-fly analysis.@Nullable org.aya.resolve.ResolveInfodoLoadCompiledCore(@NotNull org.aya.util.reporter.Reporter reporter, @NotNull LibraryOwner owner, @NotNull org.aya.syntax.ref.ModulePath mod, @Nullable Path sourcePath, @Nullable Path corePath, @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) Try to load the compiled core.voiddoSaveCompiledCore(@NotNull LibrarySource file, @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.def.TyckDef> defs) static @NotNull CompilerAdvisorinMemory()booleanisSourceModified(@NotNull LibrarySource source) default @Nullable org.aya.resolve.ResolveInfoloadCompiledCore(@NotNull org.aya.util.reporter.Reporter reporter, @NotNull LibraryOwner owner, @NotNull org.aya.syntax.ref.ModulePath mod, @Nullable Path sourcePath, @Nullable Path corePath, @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) default voidnotifyIncrementalJob(@NotNull kala.collection.immutable.ImmutableSeq<LibrarySource> modified, @NotNull kala.collection.immutable.ImmutableSeq<kala.collection.immutable.ImmutableSeq<LibrarySource>> affected) Called when all modified sources are detectedstatic @NotNull CompilerAdvisoronDisk()voidprepareLibraryOutput(@NotNull LibraryOwner owner) default voidsaveCompiledCore(@NotNull LibrarySource file, @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.def.TyckDef> defs) voidupdateLastModified(@NotNull LibrarySource source)
-
Method Details
-
onDisk
-
inMemory
-
isSourceModified
-
updateLastModified
-
prepareLibraryOutput
- Throws:
IOException
-
clearLibraryOutput
- Throws:
IOException
-
clearModuleOutput
- Throws:
IOException
-
createParser
@NotNull default @NotNull org.aya.syntax.GenericAyaParser createParser(@NotNull @NotNull org.aya.util.reporter.Reporter reporter) Used for injecting parser from IJ plugin to support on-the-fly analysis. -
notifyIncrementalJob
default void notifyIncrementalJob(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<LibrarySource> modified, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<kala.collection.immutable.ImmutableSeq<LibrarySource>> affected) Called when all modified sources are detected- Parameters:
modified- User directly modified source files.affected- SCC of modified sources.- API Note:
- the SCC is ordered, but DO NOT RELY on it.
-
doLoadCompiledCore
@Nullable @Nullable org.aya.resolve.ResolveInfo doLoadCompiledCore(@NotNull @NotNull org.aya.util.reporter.Reporter reporter, @NotNull @NotNull LibraryOwner owner, @NotNull @NotNull org.aya.syntax.ref.ModulePath mod, @Nullable @Nullable Path sourcePath, @Nullable @Nullable Path corePath, @NotNull @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) throws IOException, ClassNotFoundException Try to load the compiled core. ForDiskCompilerAdvisor, returns null if the core path does not exist or either source or core path is null. ForInMemoryCompilerAdvisor, returns null if the mod does not store in memory.- Throws:
IOExceptionClassNotFoundException
-
doSaveCompiledCore
void doSaveCompiledCore(@NotNull @NotNull LibrarySource file, @NotNull @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.def.TyckDef> defs) throws IOException - Throws:
IOException
-
loadCompiledCore
@NonExtendable @Nullable default @Nullable org.aya.resolve.ResolveInfo loadCompiledCore(@NotNull @NotNull org.aya.util.reporter.Reporter reporter, @NotNull @NotNull LibraryOwner owner, @NotNull @NotNull org.aya.syntax.ref.ModulePath mod, @Nullable @Nullable Path sourcePath, @Nullable @Nullable Path corePath, @NotNull @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) -
saveCompiledCore
@NonExtendable default void saveCompiledCore(@NotNull @NotNull LibrarySource file, @NotNull @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.def.TyckDef> defs) -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-