Skip to content
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

Is it possible to hide variables in @interface declaration of a classes header? #1061

Open
schriftgestalt opened this issue Mar 30, 2019 · 9 comments

Comments

@schriftgestalt
Copy link

I have still some instance variables in the headers in some classes. That should not show up in the doc.

@johnfairh johnfairh added the help label Apr 1, 2019
@johnfairh
Copy link
Collaborator

I think the answer is to give them a doc comment containing :nodoc:. If that doesn't make sense then please post some code showing the problem.

@johnfairh
Copy link
Collaborator

Closing, answered.

@schriftgestalt
Copy link
Author

Sorry for not answering earlier. Adding the :nodoc: does not change anything.

@johnfairh johnfairh reopened this Apr 19, 2019
@johnfairh
Copy link
Collaborator

Oh ok - can you paste some code in please that shows the problem?

@schriftgestalt
Copy link
Author

/**
 This defines the MySomeObject object.
 */
@interface MySomeObject : NSObject {
	NSString *_property;
	NSDictionary *_someDict;
}
/// my Property
@property (strong) NSString *property;
/// my SomeDict
@property (strong) NSDictionary *someDict;

@end

@johnfairh
Copy link
Collaborator

(I haven't been an ObjC programmer for a long time so bear with me...)

If you're talking about the _property and _someDict child items - which I agree look weird - then this works for me:

@interface MySomeObject : NSObject {
    /// :nodoc:
    NSString *_property;
    /// :nodoc:
    NSDictionary *_someDict;
}
...

...giving:
Screenshot 2019-04-19 at 16 46 27

If you're talking about the _property and _someDict that remain in the screenshot in the actual declaration then I don't think we can get rid of those - it's part of what Clang thinks should be in the declaration. My Xcode quick help refuses to work for ObjC but I expect it would show up the same there too.

@schriftgestalt
Copy link
Author

I’m speaking about the part next to the blue bar.

{
    NSString *_property;
    NSDictionary *_someDict;
}

I only what to have

@interface MySomeObject : NSObject

@schriftgestalt
Copy link
Author

I like it to look like this:
56431728-bcaad300-62c2-11e9-946c-ca74f7c74051

@johnfairh
Copy link
Collaborator

Got it! There's no way to get jazzy to do that, you have to edit the html yourself. If ObjC developers agree this is the right thing to do in general we could add it; #829 is also about editing the libclang declaration to be more human-consumable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants