How to refresh cached informations about roots of libraries ...


I have now added root informations for an existing library(Sources, Classes, JavaDocs). The added root is a directory. I add some files in it externally.
Apparently, the modifications of the filesystem are not detected. It is because of a cache, I think. I try to refresh the VirtualFileSystem by :


in a write action, but it seems not enough. The actions in relation of roots directories doesn't use my modification.
Perhaps, the roots informations of libraries are cached : does it exist a way to force the refresh of the libraries' roots cache. (The modifications are used if I remove informations, save it, and re-add it and save it.)

If my question is not clear, I can try to explain it differently. Doesn't hesitate, I'm blocked.

Sophie Bardet

1 comment
Comment actions Permalink

I'm not 100% I get you correctly, but if you want to clean your caches upon changing project roots, you have to monitor those events with ProjectRootListener.
On the other hand, you probably don't need to call VirtualFileSystem.refresh() manually, since synchronization is done by IDEA automatically.



Please sign in to leave a comment.