- 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.@NotNull org.aya.resolve.ResolveInfodoSaveCompiledCore(@NotNull LibrarySource file, @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.def.TyckDef> defs, @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) Save the well-typed defs as compiled defsstatic @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 @NotNull org.aya.resolve.ResolveInfosaveCompiledCore(@NotNull LibrarySource file, @NotNull org.aya.resolve.ResolveInfo resolveInfo, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.core.def.TyckDef> defs, @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) 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
@NotNull @NotNull org.aya.resolve.ResolveInfo 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, @NotNull @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) throws IOException, ClassNotFoundException Save the well-typed defs as compiled defs- Parameters:
file- the source fileresolveInfo- the resolve info of the moduledefs- the well-typed definitions- Throws:
IOExceptionClassNotFoundException
-
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 @NotNull default @NotNull org.aya.resolve.ResolveInfo 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, @NotNull @NotNull org.aya.resolve.module.ModuleLoader recurseLoader) - Returns:
- possibly the compiled version of the
ResolveInfo - See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-