[IDEA 7] VirtualFileListener before* methods invoked to late

Hi,

for my vcs provider I have to rely on the fact the beforePropertyChange() and beforeFileMovement() methods are invoked before the actual file system operation takes place. This worked fine with IDEA 6, with IDEA 7 they are invoked to late. If I set a breakpoint at the beginning of either method and look on the disk the filename is already changed or the file is already moved.

This is blocking us from switching to IDEA 7. Is there any other way to listen for file system operations as a workaround until this bug is solved?

-Tim

3 comments

Hello Tim,

for my vcs provider I have to rely on the fact the
beforePropertyChange() and beforeFileMovement() methods are invoked
before the actual file system operation takes place. This worked fine
with IDEA 6, with IDEA 7 they are invoked to late. If I set a
breakpoint at the beginning of either method and look on the disk the
filename is already changed or the file is already moved.

This is blocking us from switching to IDEA 7. Is there any other way
to listen for file system operations as a workaround until this bug is
solved?


This behavior is by design and is not going to be fixed: the events are fired
before the new data is written to the virtual file system caches.

In order to intercept the file operations as they are performed, you need
to use LocalFileOperationsHandler. You can find an example of its use in
the Subversion plugin sources.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks for the reply. I was under the impression the behaviour was different in idea 6.

-Tim

0

Hello Tim,

Thanks for the reply. I was under the impression the behaviour was
different in idea 6.


The behavior for VirtualFileListener events was indeed different, but the
difference is caused by the architectural changes done in IDEA 7. The LocalFileOperationsHandler
works in the same way for both IDEA 6 and 7.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.