Showing Excluded Folder in Project Pane

Hi,

Is it possible for a plugin to modify the behavior of the project pane so that excluded folders are displayed? I'm not entirely sure whether it would be advisable to do this in the first place - after all, it changes the user's UI expectations - but it could be made to be configurable.

Thanks!

Sebastien

5 comments

what would they be excluded from them ?

0

They would still be excluded from parsing and compilation. Actually, that raises an important point. I'm guessing that IDEA doesn't needlessly keep those folders synchronized?

0

I believe any folder that is not marked as source root or test source root is not compiled nor parsed either right ?

Did you try not excluding those folders (but not setting them as source/test root either) ?

0

Hello Sebastien,

Is it possible for a plugin to modify the behavior of the project pane
so that excluded folders are displayed? I'm not entirely sure whether
it would be advisable to do this in the first place - after all, it
changes the user's UI expectations - but it could be made to be
configurable.


In principle, you can use the TreeStructureProvider display to modify the
Project View structure in any way. However, I don't know how well this would
work in practice. In particular, if you want to show classes and not files
for the contents of the excluded folders (as the project view does for regular
folders), you'll need to provide some way of parsing the classes because
IntelliJ IDEA doesn't build the PSI for the contents of excluded folders.
Another problem that you'll encounter is correctly updating the project view
when the contents of the excluded folders changes.

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


0

Hi Dmitry,

Thanks a lot for the detailed reply. The reason I was asking is because I've been working on a simple plugin that allows to add/remove folders to the source, test source and excluded paths directly from the project pane.

While the removal works well for source and test folders, it obviously can't for excluded folders since they no longer appear in the project structure. I wondered if it would be possible to display the folder as excluded but not display any of underlying structure. It would then become possible for a user to easily "unexclude" a folder from the project pane. One project I am involved with has dozens of paths, and there are a few that are frequently toggled include/exclude, so I would personally find it useful. :)

As Thibaut and yourself have pointed out, excluded folders aren't kept synchronized so displaying them in their entirety would likely bring confusion. But if I can hide the children, then it could add a bit of value.

I'll give it a try using your suggestions. Thanks!

0

Please sign in to leave a comment.