-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option hiddenCategories #1415
Conversation
@Gerrit0 I could already add the declarations as described in #1407 (comment) However, as for the category check I struggle a bit. I would expect some logic as follows:
|
If I understand correctly, there are three processing steps defined for the category plugin:
So would this have to go into onEndResolve (when everything is done) like: private onEndResolve(context: Context) {
const project = context.project;
this.categorize(project);
if (this.hiddenCategories) {
const reflections: Reflection[] = [];
// check if `this.hiddenCategories` contains categories from `project`
// push those reflections on `reflections `
...
// remove reflections belonging to hidden categories from the documentation
reflections.forEach(reflection => project.removeReflection(reflection))
}
} How could I write a test for the new option? |
You have the right idea - however, unfortunately due to the architecture of some of the other plugins (GroupPlugin is one of them), removing reflections after the onBegin method will break things... which I completely forgot about when I said this should be an easy issue. I haven't build a solution for this problem yet - to handle it properly the Adding a test for this is pretty easy at least, I think this option can always be set, so we don't need a new spec file type:
|
@Gerrit0 I understand :-) So ping me once you have implemented the necessary functionality for |
@Gerrit0 just a shot in the dark: |
That could work as well - however that means that the categorization logic would have to happen earlier - instead of in the resolve event.... I'm not completely against that. |
I spent a few hours today trying to get the reflection removed event to work - this is trickier than I anticipated... TypeDoc is really bad about storing data in multiple places, and it is really easy to miss one of them... I think I mostly have it working except for inheritance. ( |
@Gerrit0 sorry that I cannot help you there as I am not familiar with the architecture. Which branch are you working on? |
I never ended up pushing any of the changes for the removal event. There are more architectural difficulties than I realized.
I think I'll need to dedicate a couple solid days to really going through and understanding all of the relations in order to properly handle this. I think the "right" solution is to do removal after resolution, but I also really dislike that solution since it adds a ridiculous amount of property tracking... which would be really easy to mess up. This probably won't happen this year, so unfortunately I think the best bet for this feature is to do filtering in #1177 has some more notes on what "removal" ought to mean. |
@lastthyme @Gerrit0 sorry, but this PR is not yet ready for review. |
@Gerrit0 Hi, any chance to revive this PR? ;-) |
This probably won't happen ever. It massively complicates a ton of logic. If updated to do as described, I'm still open to this. |
Shall I close this PR since I won't be able to work on this? |
It's still possible to do this - it just needs to be done at an earlier state. Removal needs to happen at EVENT_BEGIN_RESOLVE instead of later |
cool :-) |
resolves #1407
This PR is not ready for review yet.