Skip to content

Conversation

@RblSb
Copy link
Member

@RblSb RblSb commented Jun 10, 2025

This PR allows @:inheritDoc (without arguments) to search parent interface field for documentation, if there is no parent class field doc.

@kLabz
Copy link
Contributor

kLabz commented Jun 10, 2025

Isn't that use case pretty niche? A build macro (or addGlobalMetadata) could do that job easily

@RblSb
Copy link
Member Author

RblSb commented Jun 11, 2025

I guess it can work, then there is only @:inheritDoc improvement to also check interfaces field and not only parent class field, should be useful

@RblSb RblSb changed the title Class meta to inherit doc for all class fields Allow @:inheritDoc var field to search for documentation in implemented interfaces Jun 11, 2025
@kLabz
Copy link
Contributor

kLabz commented Jun 11, 2025

I think this makes sense. A test would be nice, or at least a code example of what case it helps with (I could then help with writing the test if needed)

@skial skial mentioned this pull request Jun 25, 2025
1 task
@RblSb
Copy link
Member Author

RblSb commented Jul 31, 2025

@kLabz this should be ok

@kLabz
Copy link
Contributor

kLabz commented Jul 31, 2025

I'm not sure. What are the rules here for deciding what documentation is included or not?

@RblSb
Copy link
Member Author

RblSb commented Jul 31, 2025

class Foo implements IFoo implements IFoo2 extends Parent {
	/** Foo test **/
	@:inheritDoc public override function test():Void {}
}

It concats field documentation from first non-empty parent documentation to function test(), always checking parent class test() first and then all interfaces in declaration order (Parent.test then IFoo.test then IFoo2.test docs).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants