I'm creating a custom language plugin and I have a need to store additional metadata about each source file (ie. what API version is associated with the file). I've been reading about the Virtual File System (VFS) in IntelliJ here: http://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Virtual+File+System.
It states "Providing a possibility to associate additional persistent data with a file in the VFS."
Is this actually possible? Is there an example of this in the CE of IDEA? I've been looking at subclasses of com.intellij.openapi.vfs.VirtualFile, but I don't see anything.....
Would the best approach be to subclass VirtualFile and override the read/write methods so that the first xxx bytes contain my meta data (API version)?
If I do this, how do I tell IntelliJ to instantiate my subclass of VirtualFile when it reads a file of my FileType?