Search code examples
intellij-ideaintellij-plugin

Persisting state for VirtualFiles in IntelliJ IDEA plugin


VFS documentation specifically lists "Providing a possibility to associate additional persistent data with a file in the VFS" as a feature.

However, it doesn't say how to persist the data across IDEA restarts and I didn't manage to find it by exploring the API. I thought that perhaps the data managed by putUserData/getUserData would be automatically persistent for VirtualFiles, but this doesn't seem to be the case.


Solution

  • It looks like you need FileAttribute instead.

    See the usage in LastUnchangedContentTracker for example.