docs [platform]: Declare contracts in autoimport.

1. `settingsFiles` can access IO
2. `register` must be called before `onProjectReloadStart`


Merge-request: IJ-MR-184665
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 6f68286e54cdf552f06e5822ebf940c9fdbbdfd7
This commit is contained in:
Ilya Kazakevich
2025-12-04 16:54:40 +00:00
committed by intellij-monorepo-bot
parent 98a6f230ca
commit fe6342ffc3
2 changed files with 5 additions and 2 deletions
@@ -4,6 +4,7 @@ package com.intellij.openapi.externalSystem.autoimport
import com.intellij.openapi.Disposable
import com.intellij.openapi.externalSystem.autoimport.ExternalSystemSettingsFilesModificationContext.Event
import com.intellij.openapi.externalSystem.autoimport.ExternalSystemSettingsFilesModificationContext.ReloadStatus
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread
import org.jetbrains.annotations.ApiStatus
import kotlin.time.Duration
@@ -13,9 +14,10 @@ interface ExternalSystemProjectAware {
/**
* Collects settings files which will be watched.
* This property can be called from any thread context to reduce UI freezes and CPU usage.
* Result will be cached, so settings files should be equals between reloads.
* These property is read each time after [reloadProject] gets called, new file was added
* or [ExternalSystemProjectListener.onSettingsFilesListChange] event happened.
*/
@get:RequiresBackgroundThread
val settingsFiles: Set<String>
fun subscribe(listener: ExternalSystemProjectListener, parentDisposable: Disposable)
@@ -13,6 +13,7 @@ interface ExternalSystemProjectTracker {
* Starts tracking of project settings that will be defined by [projectAware]
*
* Auto reloads will be activated after first project refresh
* (i.e. after first [ExternalSystemProjectListener.onProjectReloadStart] / [ExternalSystemProjectListener.onProjectReloadFinish])
* @see [ExternalSystemProjectTracker.activate] for details
*/
fun register(projectAware: ExternalSystemProjectAware)