Plugin for hidable directories

已回答

Hello everyone !

At my job, I'm working on a big project with a lot of modules (> 1000) separated in directories (all in the same root folder). The thing is that, most of the time, I only work on 1% of the modules so I'm constantly scrolling through directories I don't use in the Project View.

I first tried to mark the directories I don't use as Excluded but that as an impact on indexing which is not what I want since then I would have unresolved references, etc.

So the only plan I came up with is to create a plugin to allow users to mark directories as ‘Hidden’ in the same way you would mark them as ‘Excluded’ but the difference would be that hidden directories are not visible in the Project View (this could be toggled on and off like for excluded files) but are still indexed like the rest of the code to allow code completion, etc to work nicely. (It should be a built-in feature of the IDE in my opinion)

Since I never wrote any plugin for Intellij, I struggle to understand where to start and how to make something that works in a similar way to excluded files.

Here you can see what I already did, I just created the actions but they have no behavior whatsoever :

So, first of all, do you think it is possible to create such plugin ? Where would I need to start ?

Thank you very much for any amount of help you can give me!

0

Have you considered using Load/Unload Modules builtin functionality https://www.jetbrains.com/help/idea/unloading-modules.html? Or simply define scopes of your current working set to select in Project View toolwindow? https://www.jetbrains.com/help/idea/settings-scopes.html  

 

Regarding plugin solution, if you “only” want to filter items in Project View, that's quite feasible https://plugins.jetbrains.com/docs/intellij/tree-structure-view.html. Your action will need to store the “hidden” status for modules to be used by your TreeStructureProvider.

1

Hello Yann Cebron, thank you for the quick answer !

Have you considered using Load/Unload Modules builtin functionality https://www.jetbrains.com/help/idea/unloading-modules.html?

I guess my wording wasn't the best. In this case, I have only 3 actual modules but in each of them, there are hundreds of directories I would like to hide.

Or simply define scopes of your current working set to select in Project View toolwindow? https://www.jetbrains.com/help/idea/settings-scopes.html  

This is EXACTLY the kind of feature I was looking for !!! I was able to create a scope with only the folders I'm interested in then it took me quite a bit to understand how I could set the scope in the Project View but now it works perfectly!

0

请先登录再写评论。