idea-plugin / arrow.meta.ide.dsl.application / ApplicationSyntax
interface ApplicationSyntax
multi-purpose algebra to interact with the Ide lifecycle through hijacking and replacing existing services or adding lifecycle related extensions that run at their respective phase. Services can be distributed across the ide in three different kinds at application-level, project-level or module-level. The intellij platform distributes an isolated instance depending on the level - isolated in terms of other instances -, that means an application-level service has solely one instance, whereas module-level services have an instance for each module. Though it is possible to register module-level services with Meta it is not advised to do so, due to high memory consumption.
availableServices | accumulates all available services for loaded Pluginsopen val ApplicationSyntax .availableServices: List <ServiceDescriptor> |
addAppLifecycleListener | registers an activity, which is executed eagerly in the background on startup.open fun MetaIde .addAppLifecycleListener(listener: AppLifecycleListener): ExtensionPhase registers an AppLifecycleListener. open fun MetaIde .addAppLifecycleListener(appClosing: () -> Unit = Noop.effect0, projectOpenFailed: () -> Unit = Noop.effect0, appFrameCreated: (cliArgs: MutableList < String >) -> Unit = Noop.effect1, welcomeScreenDisplayed: () -> Unit = Noop.effect0, projectFrameClosed: () -> Unit = Noop.effect0, appStarting: (cliProject: Project?) -> Unit = Noop.effect1, appWillBeClosed: (restarted: Boolean ) -> Unit = Noop.effect1): ExtensionPhase |
addAppService | registers an application-level service and the instance. The IntelliJ Platform ensures that only one instance of instance per application is instantiated. even though the service can be retrieved multiple times with ServiceManager.getService or com.intellij.openapi.project.Project.getService for project-level services. It is impeccable that there is only one instance implementation for a given service to fulfill coherence in the ide. The ide will throw an exception, if that premise is not met.open fun <A : Any > MetaIde .addAppService(service: Class <A>, instance: (A?) -> A?): ExtensionPhase |
addBackgroundPostStartupActivity | registers an StartupActivity.Background, which is isomorphic to StartupActivity only with a 5 second delay executing StartupActivity.runActivity. See https://github.com/JetBrains/intellij-community/blob/master/platform/service-container/overview.md#startup-activityopen fun MetaIde .addBackgroundPostStartupActivity(activity: Background): ExtensionPhase |
addModuleListener | registers an ModuleListeneropen fun MetaIde .addModuleListener(moduleAdded: (project: Project, module: Module) -> Unit , moduleRemoved: (project: Project, module: Module) -> Unit , beforeModuleRemoved: (project: Project, module: Module) -> Unit , modulesRenamed: (project: Project, modules: List <Module>, oldNames: (Module) -> String ) -> Unit ): ExtensionPhase |
addPMListener | open fun MetaIde .addPMListener(closing: (Project) -> Unit = Noop.effect1, closed: (Project) -> Unit = Noop.effect1, closingBeforeSave: (Project) -> Unit = Noop.effect1, opened: (Project) -> Unit = Noop.effect1): ExtensionPhase |
addPostStartupActivity | open fun MetaIde .addPostStartupActivity(activity: StartupActivity): ExtensionPhase |
addProjectService | registers a project service instance once all project components are initialized. Contrary to addAppService this extension only works for existing services that have been declared in the plugin.xml , due to it’s current implementation in the Meta internals.open fun <A : Any > MetaIde .addProjectService(service: Class <A>, instance: (Project, A?) -> A?): ExtensionPhase |
appLifecycleListener | open fun ApplicationSyntax .appLifecycleListener(appClosing: () -> Unit = Noop.effect0, projectOpenFailed: () -> Unit = Noop.effect0, appFrameCreated: (cliArgs: MutableList < String >) -> Unit = Noop.effect1, welcomeScreenDisplayed: () -> Unit = Noop.effect0, projectFrameClosed: () -> Unit = Noop.effect0, appStarting: (cliProject: Project?) -> Unit = Noop.effect1, appWillBeClosed: (restarted: Boolean ) -> Unit = Noop.effect1): AppLifecycleListener |
ctx | open fun PsiElement.ctx(): CompilerContext? open fun Project.ctx(): CompilerContext? |
moduleListener | open fun ApplicationSyntax .moduleListener(moduleAdded: (project: Project, module: Module) -> Unit , moduleRemoved: (project: Project, module: Module) -> Unit , beforeModuleRemoved: (project: Project, module: Module) -> Unit , modulesRenamed: (project: Project, modules: List <Module>, oldNames: (Module) -> String ) -> Unit ): ModuleListener |
overrideService | overrides a Service interface from with to, when override == true. from and to need to have a type relationship, either through subtyping or other means like type-proofs . The application will raise an error at runtime if the latter is not valid or when override == false and there is already a service instance associated with from.open fun MetaIde .overrideService(from: Class <*>, to: Class <*>, override: Boolean = true): ExtensionPhase |
PMListener | open fun ApplicationSyntax .PMListener(closing: (Project) -> Unit = Noop.effect1, closed: (Project) -> Unit = Noop.effect1, closingBeforeSave: (Project) -> Unit = Noop.effect1, opened: (Project) -> Unit = Noop.effect1): ProjectManagerListener |
preloadingActivity | open fun ApplicationSyntax .preloadingActivity(preload: (ProgressIndicator) -> Unit ): PreloadingActivity |
registerMetaPlugin | convenience extension to register the CliPlugins from an IdeMetaPlugin Pluginopen fun MetaIde .registerMetaPlugin(conf: CompilerConfiguration = CompilerConfiguration()): ExtensionPhase |
replaceAppService | replaces an application service with instance. In this example this Annotator needs a different instance for MyService than what is currently provided - see our example in addAppService.open fun <A : Any > MetaIde .replaceAppService(service: Class <A>, instance: (A?) -> A): ExtensionPhase |
stopServicePreloading | open fun MetaIde .stopServicePreloading(): ExtensionPhase |
Do you like Arrow?
✖