I'm currently trying to get server-triggered changes for the mks plugin (using perforce as a template).
For this, i start a long-running thread listening for changes from the server, and following what's done in the perforce i've started it in the AbstractVcs.activate method.

The way this works is by running a command line utility that first lists the current state, and then sends updates whenever the state changes.

I'm using this pattern for checked out project amonst others, and then check if the projects (sent by the server are of any interest to currently opened IDEA project by using the Project.getProjectScope().contains API for this.

It seems to work ok, in the majority of cases ...

My problem is it seems that during the initial update (which is done very soon after the Activate method was called on the vcs), this API seem to return false for files actually belonging to the project.

Is this expected ?

This triggers another question, AFAIK VCS implementations are instanciated once for each open project right (thus the constructor) ? What's the lifecycle regarding the activate/deactivate/projectOpened/projectClosed callbacks ?
In other words, when should i start my background thread in order to be sure the IDEA project is fully loaded when the first batch of changes arrives from the server ?

Please sign in to leave a comment.