Execute code before project load?

I'd like to modify a project before its sources are parsed and cached. My
purpose in doing this is that because all files are parsed on startup, opening a
project takes 5-10 minutes with our source tree. Many folders can be added to
Exclude roots, however, and I'd like to do this before they're ever parsed.
However, it looks like projectOpened isn't called until after files are parsed,
and I don't know how else to get a hold of a Project instance to modify it. Is
there a way to do this?

Thanks

4 comments

Keith Lea wrote:

I'd like to modify a project before its sources are parsed and cached.
My purpose in doing this is that because all files are parsed on
startup, opening a project takes 5-10 minutes with our source tree. Many
folders can be added to Exclude roots, however, and I'd like to do this
before they're ever parsed. However, it looks like projectOpened isn't
called until after files are parsed, and I don't know how else to get a
hold of a Project instance to modify it. Is there a way to do this?


I could imagine that it might be possible if you're opening the project yourself via API
and do the work between ProjectManagerEx.loadProject() and ProjectManagerEx.openProject()

Just a guess though and probably kinda inconvenient to use.

Sascha

0

Hello Keith,

projectOpened isn't called until after files are parsed

That's not true. All the files are parsed in StartupManager.runStartupActivities,
which is after project is opened.
Alternatively, you may want adding preStartupActivity via same manager.

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I'd like to modify a project before its sources are parsed and cached.
My purpose in doing this is that because all files are parsed on
startup, opening a project takes 5-10 minutes with our source tree.
Many folders can be added to Exclude roots, however, and I'd like to
do this before they're ever parsed. However, it looks like
projectOpened isn't called until after files are parsed, and I don't
know how else to get a hold of a Project instance to modify it. Is
there a way to do this?

Thanks



0

I feel sorry to take your time for a problem that isn't a problem. It turns out
due to IDEA-5840 my breakpoint in projectOpened wasn't being hit because the
code wasn't loaded at all. I appreciate your help, I know you guys have a lot to do.

Maxim Shafirov (JetBrains) wrote:

Hello Keith,

>> projectOpened isn't called until after files are parsed


That's not true. All the files are parsed in
StartupManager.runStartupActivities, which is after project is opened.
Alternatively, you may want adding preStartupActivity via same manager.

------------------
Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> I'd like to modify a project before its sources are parsed and cached.
>> My purpose in doing this is that because all files are parsed on
>> startup, opening a project takes 5-10 minutes with our source tree.
>> Many folders can be added to Exclude roots, however, and I'd like to
>> do this before they're ever parsed. However, it looks like
>> projectOpened isn't called until after files are parsed, and I don't
>> know how else to get a hold of a Project instance to modify it. Is
>> there a way to do this?
>>
>> Thanks
>>


0

Have you guys ever thought about a restricted shared source program like Sun's?
In many cases, undocumented API or some API bug or shortcoming, is showstopper
for some feature of my project, and the delay of waiting for a fix and the next
dot release, or getting information for a workaround through this newsgroup, is
so long that I give up on the feature. I feel that I already know parts of IDEA
codebase enough, through plugin work, that having the source available would be
worth my time. Additionally I would definitely be willing to submit patches for
things within the scope of my problems, if they were required and simple enough.

Maxim Shafirov (JetBrains) wrote:

Hello Keith,

>> projectOpened isn't called until after files are parsed


That's not true. All the files are parsed in
StartupManager.runStartupActivities, which is after project is opened.
Alternatively, you may want adding preStartupActivity via same manager.

------------------
Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> I'd like to modify a project before its sources are parsed and cached.
>> My purpose in doing this is that because all files are parsed on
>> startup, opening a project takes 5-10 minutes with our source tree.
>> Many folders can be added to Exclude roots, however, and I'd like to
>> do this before they're ever parsed. However, it looks like
>> projectOpened isn't called until after files are parsed, and I don't
>> know how else to get a hold of a Project instance to modify it. Is
>> there a way to do this?
>>
>> Thanks
>>


0

Please sign in to leave a comment.