public interface UpdateInBackground
AnAction.update(com.intellij.openapi.actionSystem.AnActionEvent)
, ActionGroup.getChildren(AnActionEvent)
and ActionGroup.canBePerformed(com.intellij.openapi.actionSystem.DataContext)
methods can be invoked on a background thread.
This means that those updating methods shouldn't access Swing component hierarchy directly,
and any further data they access should be thread-safe.
The reason: it's possible that update methods are invoked concurrently from Swing thread and background thread.
When on background thread, application-wide read access is guaranteed, so no synchronization for PSI, VFS and project model is necessary.
Update methods should call ProgressManager.checkCanceled()
often enough to guard against UI freezes.