ldoc icon indicating copy to clipboard operation
ldoc copied to clipboard

@type changes behavior when used in @submodule

Open BiterUnion opened this issue 3 years ago • 5 comments
trafficstars

My setup: I have a project where I provide several modules consisting of multiple classes. Each class is implemented in its own file and documented using @type. For each module, I have put a @module tag in one of module's lua files (the first one parsed by LDoc) and @submodule tags in module's other files.

The issue: The @type tags seem to work differently, when used in a @submodule instead of a @module: In a @module, the @types are listed as "Class ExampleClass" in the generated docs. In a @submodule, the @types are listed as "ExampleClass Functions" and the description provided to @type is missing. I would expect that the @type tag works the same in both cases.

I could not find any information in the docs or existing issues that this might be intended behavior.

BiterUnion avatar Sep 10 '22 08:09 BiterUnion

This sounds like a bug; given your description I would expect the two cases to behave the same as well. I'm going to be on very low availability for at least a month, but I'll try to check in and at least facilitate a PR if anybody jumps in with contributions. Even short of a PR fixing this an MWE demonstrating the problem in a way I or another developer could reproduce easily would save time tracking down the problem.

alerque avatar Sep 10 '22 09:09 alerque

Thanks for your quick response. I have created a MWE, similar to the tests in the repo. Would you like me to create a PR for adding the test or should I send you the files?

BiterUnion avatar Sep 10 '22 10:09 BiterUnion

If the MWE is setup like the existing tests a PR for it would be fantastic!

alerque avatar Sep 10 '22 10:09 alerque

I just created the PR. Let me know if anything is missing or should be changed, this is my first public PR ;)

BiterUnion avatar Sep 10 '22 10:09 BiterUnion

Thanks. The PR looks good!

I think there is some sort of trigger missing or we need to tweak the expectations for the test — the goal even before fixing the bug here is to have CI start failing to produce the expected result on account of the bug. But having the MWE to work from is a great start.

alerque avatar Sep 10 '22 20:09 alerque