haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Allow `@:inheritDoc var field` to search for documentation in implemented interfaces

Open RblSb opened this issue 5 months ago • 3 comments

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

RblSb avatar Jun 10 '25 05:06 RblSb

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

kLabz avatar Jun 10 '25 08:06 kLabz

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 avatar Jun 11 '25 07:06 RblSb

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)

kLabz avatar Jun 11 '25 08:06 kLabz

@kLabz this should be ok

RblSb avatar Jul 31 '25 08:07 RblSb

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

kLabz avatar Jul 31 '25 08:07 kLabz

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).

RblSb avatar Jul 31 '25 15:07 RblSb