Clear Read-only Status/EditFileProvider Issue

I ran into a bit of an issue with the "Clear Read-only Status" dialog with my Vcs plugin.

I've implemented EditFileProvider correctly (as far as I know) and can successfully clear the read-only status, but I have to click the "Ok" button on the Clear Read-only Status dialog twice to make it disappear.

I've determined that this is because of the time it takes for some verification code I'm using to complete (eg checking if the file is under version control before checking it out). It seems IDEA checks after a certain period of time whether a file's status has changed and keeps the dialog open if nothing has happened. This is a bit inconvenient if an operation takes longer than what IDEA allows.

Is there a way to change this behavior? (eg keep the dialog open until my code notifies IDEA to close the dialog)

Also, on a related issue - where/when is EditFileProvider.getRequestText() called?

Thanks in advance for the help.

1 comment
Comment actions Permalink

I just noticed that if I use the Enter/Return keystroke in the dialog window, everything works as expected. The read-only status clears and the dialog goes away.

Why doesn't it work the same way when I click OK?

In my opinion, this looks like a bug, as the result of clicking OK or pressing Enter in this dialog should have the same effect. But bug or not, is there a workaround that you guys at JetBrains (or anyone else) know of?


Please sign in to leave a comment.