Updating File Status from External Commands

I have a Custom VCS plugin which updates files using a 3rd party API. This API can update any number of files externally.

What is the correct method of informing the editor that these files have changes? I have come across some cases where the file structure is updated, but not the files being displayed in the editor.

Thanks!

Steve

2 comments
Comment actions Permalink

Hello Steven,

I have a Custom VCS plugin which updates files using a 3rd party API.
This API can update any number of files externally.

What is the correct method of informing the editor that these files
have changes? I have come across some cases where the file structure
is updated, but not the files being displayed in the editor.


VirtualFile.refresh() ensures that the file contents/attributes are synchronized.
VcsDirtyScopeManager.getInstance().markFileAsDirty() allows to refresh the
VCS status of a file (unchanged/added/modified etc.)

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


0
Comment actions Permalink

Hello Steven,

VirtualFile.refresh() ensures that the file
contents/attributes are synchronized.
VcsDirtyScopeManager.getInstance().markFileAsDirty()
allows to refresh the
VCS status of a file (unchanged/added/modified etc.)


Perfect! Thanks!

0

Please sign in to leave a comment.