How can I refresh in Idea's editor a recently modified file?

Hello,
I just wrote a small plugin which makes some modifications on java files. The problem is that this modifications are visible just if I'm restarting Idea or close and reopen the modified file. Is there any way I can refresh the modified java file (or any other text file) on the fly? (The current opened file is the modified file and I want to see the modifications without closing and reopening the file)

Tnank you

0
6 comments

I've got the same problem - the only way I've found of updating it properly is to try to make a modification, hit CTRL-s and then it asks you whether you want to synchronize the file on disk with the file in memory.

0

I tried also the "refresh" method of the VirtualFile class and nothing. Did I miss something?

Thanks

0

Are you sure that the files are part of your project?

It just works for me, each time there are external modifications IDEA
automatically picks them up.

-- dimiter

0

Yes, the files I'm modifying are in fact the source files of the project. The files are modified by an external program : patch.exe which is run with Runtime.exec(). The files are indeed modified beacause the modifications are visible when I'm restarting Idea. Any hint or idea?

0

The file I'm viewing is definitely part of the module's content - oddly, it's the only file that has this problem, as all other file alterations that happen outside IDEA are picked up (e.g. Ant XDoclet tasks).

The process which is altering the file is the database wrapper P6Spy - every time it alters the file, I have to do one of the following:

1) Alter file, hit CTRL-s, ask it to reload the file from disk
2) Lose focus of IDEA, come back in

Closing and reopening the file's tab does not refresh the file - it will show the previous version (I'm assuming it's holding it in memory still).

0

I've just been thinking about this problem, and it suddenly occurred to me that this file is actually being generated when I run my JUnit tests, using IDEA's JUnit runner - so it's actually an IDEA process, rather than an external file alteration.

I changed the location of the log file, just to see what would happen, and the log file doesn't even show up in the browser until IDEA loses focus.

0

Please sign in to leave a comment.