How to refresh / invalidate the cache of decompiled files ?

I'm using the extension point ContentBasedClassFileProcessor. The method String obtainFileText(Project project, VirtualFile virtualFile) returns the mirror source as expected. However when toggling some options on our decompiler that changes the output, the extension point is not called again even when reopening the file to decompile.

I tried a few things here and there to refresh the content of the files our extension has decompiled only, though I couldn't achieve that goal. Do you have pointers on how to do that.


Thanks in adavance.


Happy Easter.

Brice

2 comments
Comment actions Permalink

Please try this:
FileDocumentManager documentManager = FileDocumentManager.getInstance();
((VirtualFileListener)documentManager).contentsChanged(new VirtualFileEvent(null, virtualFile, virtualFile.getName(), virtualFile.getParent()));

0
Comment actions Permalink

Perfect.

For the record, this code is triggered on a UI event. To make this task asynchronous I put this code in a Runnable submitted to the IntelliJ executor : LaterInvocator.invokeLater

Thanks again.

Brice

0

Please sign in to leave a comment.