public static interface AsyncFileListener.ChangeApplier
Modifier and Type | Method and Description |
---|---|
default void |
afterVfsChange()
This method is called in write action after the VFS events are delivered and applied, and allows
to apply modifications based on the information calculated during
AsyncFileListener.prepareChange(java.util.List<? extends com.intellij.openapi.vfs.newvfs.events.VFileEvent>) . |
default void |
beforeVfsChange()
This method is called in write action before the VFS events are delivered and applied, and allows
to apply modifications based on the information calculated during
AsyncFileListener.prepareChange(java.util.List<? extends com.intellij.openapi.vfs.newvfs.events.VFileEvent>) . |
default void beforeVfsChange()
AsyncFileListener.prepareChange(java.util.List<? extends com.intellij.openapi.vfs.newvfs.events.VFileEvent>)
.
Although it's guaranteed that no write actions happen between AsyncFileListener.prepareChange(java.util.List<? extends com.intellij.openapi.vfs.newvfs.events.VFileEvent>)
and invoking all AsyncFileListener.ChangeApplier
s,
another listener might already have changed something (e.g. send PSI events, increase modification trackers, etc)
by the time this implementation is executed, so be prepared. And if your listener depends on state not synchronized via read-write actions,
it can be changed by this moment as well.default void afterVfsChange()
AsyncFileListener.prepareChange(java.util.List<? extends com.intellij.openapi.vfs.newvfs.events.VFileEvent>)
.
The implementations should be as fast as possible.
If you process events passed into AsyncFileListener.prepareChange(java.util.List<? extends com.intellij.openapi.vfs.newvfs.events.VFileEvent>)
here, remember that an event might be superseded by further events
from the same list. For example, the VFileEvent.getFile()
may be invalid (if it was deleted by that further event),
VFileCreateEvent.getFile()
may return null, property value in
VFilePropertyChangeEvent
may be already outdated, etc.