Unable to keep the VirtualFile in sync from File fetched via Device File Explorer
We are trying to build a DataStore plugin for Android studio, which can also be then extended to any other IntelliJ platform, the basic use case if we fetch .pb file which has all the data stored via DataStore android library using protocol buffers.
as soon as we click on the file, it gets downloaded via Device File Explorer, it opens up in the plugin but, now on android device, if some of the data gets changed in the *.pb file, I was not able to figure out a way to hook a callback to get the file updates, as the Download VirtualFile and the file visible in Device File Explorer are different, and thus the
VirtualFileManager.VFS_CHANGES
to the original file would not be catched via
BulkFileListener
Is there a way to put a hook directly on File visible in Device File Explorer visible in Android Studio.
Upload id: 2023_02_27_24n6LsLf43RdULy9bFF9si (file: Screenshot 2023-02-27 at 3.44.01 PM.png)
请先登录再写评论。
AFAIU the best solution would be to implement a dedicated VirtualFileSystem that can cover monitoring/updating/notications coming from Device File Explorer https://plugins.jetbrains.com/docs/intellij/virtual-file-system.html