Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Property setters are not correctly recognized in DocSet #162

Open
felixLam opened this Issue Dec 23, 2011 · 7 comments

Comments

Projects
None yet
2 participants
Contributor

felixLam commented Dec 23, 2011

When defining a regular property, e.g.:

/// My own property
@property BOOL myProperty;

The DocSet only provides tooltips for the property (e.g. myObject.myProperty) and its getter (e.g. [myObject myProperty]), but fails to provide tooltips for [myObject setMyProperty:YES]. Is this a known issue?

Owner

tomaz commented Dec 24, 2011

Hm, this would probably require adding getters and setters to tokens file.

Contributor

felixLam commented Dec 24, 2011

Could you provide me with pointers. Where in the code would this need to happen?

Am 24.12.2011 um 10:13 schrieb tomaz reply@reply.github.com:

Hm, this would probably require adding getters and setters to tokens file.


Reply to this email directly or view it on GitHub:
#162 (comment)

Owner

tomaz commented Dec 24, 2011

Basically what you want to do is to inject additional method for each property setter, besides property name in tokens.xml files. This is handled in GBDocSetOutputGenerator within addTokensXmlModelObjectDataForObject:toData: (pull latest changes, then methods are handled starting line 280).

In there, let default code execute, then add a test for method.isProperty at the end of the and inject set: method if test passes. To inject, you can simply create a new GBMethodData on the fly (just reuse the same comment) and send it to addTokensXmlModelObjectDataForObject:toData: (this would result in recursive call, although should not create infinite loop as the new method would not be property).

There are also other possible routes, but I think this one would be simplest. Hope it makes sense :)

Contributor

felixLam commented Dec 28, 2011

See Pullrequest #164

@tomaz tomaz added a commit that referenced this issue Dec 30, 2011

@tomaz tomaz Refactored property setters generation for doc set. References #162.
I've cleaned up the code a bit, added proper declaration from property and removed getters generation (it clashes with property one).
86b4417
Owner

tomaz commented Dec 30, 2011

Thanks for solution, I've pulled your code, refactored it a bit (not that it wasn't ok, it's just I'm somewhat obsessive about it :) Also took out the getter - it clashes with basic property declaration (although they end with different token id, seems there's no real benefit for adding it!?). Also added property declaration from your TODO note. It seems fine from my short tests - could you give it a go and confirm it works (also check if getter is actually needed or not, so I an add it back in), then I'll close this issue.

Anyway, thanks for your effort, have a go and let me know how it goes ... and as it's that time of the year: happy new year :))

Contributor

felixLam commented Dec 30, 2011

Thanks.

It appears that the setters do not work. I am off to a week of holidays. I will look into this more closely once I get back. Thanks again for your work on this.

Am 30.12.2011 um 11:35 schrieb tomaz:

Thanks for solution, I've pulled your code, refactored it a bit (not that it wasn't ok, it's just I'm somewhat obsessive about it :) Also took out the getter - it clashes with basic property declaration (although they end with different token id, seems there's no real benefit for adding it!?). Also added property declaration from your TODO note. It seems fine from my short tests - could you give it a go and confirm it works (also check if getter is actually needed or not, so I an add it back in), then I'll close this issue.

Anyway, thanks for your effort, have a go and let me know how it goes ... and as it's that time of the year: happy new year :))


Reply to this email directly or view it on GitHub:
#162 (comment)

Owner

tomaz commented Dec 30, 2011

Ok, let me know about your findings. Enjoy the holidays!

Tom

felixLam
mailto:reply@reply.github.com
December 30, 2011 17:34
Thanks.

It appears that the setters do not work. I am off to a week of
holidays. I will look into this more closely once I get back. Thanks
again for your work on this.


Reply to this email directly or view it on GitHub:
#162 (comment)
felixLam
mailto:reply@reply.github.com
December 23, 2011 12:15
When defining a regular property, e.g.:

/// My own property
@property BOOL myProperty;

The DocSet only provides tooltips for the property (e.g.
myObject.myProperty) and its getter (e.g. [myObject myProperty]),
but fails to provide tooltips for [myObject setMyProperty:YES]. Is
this a known issue?


Reply to this email directly or view it on GitHub:
#162

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