Is it possible to get notification that project is fully opened and it can
be used ( Psi elements can be accessed)?

Now, when I have tried to access PsiElements in "projectOpened" (method
implementation from ProjectComponent) I get following exception:

Assertion failed: Access to psi files should be performed only after startup

at com.intellij.openapi.diagnostic.Logger.assertTrue(
at com.intellij.psi.impl.d.a.k.b(
at com.intellij.psi.impl.d.a.k.a(
at com.intellij.psi.impl.d.a.k.a(

The same result I have got with ProjectManagerListener implementation. Seems
that method should be named "projectOpening" instead "projectOpened".

Egidijus Vaisnora

Comment actions Permalink

Check out the JUnitTest Plugin, it prints out a debug message when the project is loaded, so there may be some code of interest there (I'm actually not sure if the source is available or not, though).

(i have no connection with the development of this plugin, though, so I don't really know what I'm talking about)


Comment actions Permalink

The JUnitTestPlugin does not use Psi in projectOpened. It isn't possible.
And yes I agree with you it would be nice to have a 2 phase initialization which intuitively would have been

However the problem here is the non-management of dependencies by IDEA component framework. The current component initialization mechanism doesn't have the information to manage dependencies so that the order in which components are initialized guarantees that on projectOpened() all dependent components are initialized completely.

So you have to revert back to lazy initialization.
If you need an active plugin maybe you could listen to commands, file events...

Anyway I tried to stir up some discussion about it a few month ago to no avail (
So now I filed a formal request : You can vote for it.



Please sign in to leave a comment.