hdoc icon indicating copy to clipboard operation
hdoc copied to clipboard

Methods declared in a macro are not present in the documentation

Open danakj opened this issue 3 years ago • 2 comments

Here's a class f32: https://docs.hdoc.io/g/subspace/r603874E574DC6453.html

It has a ton of static and instance methods declared in macros: https://github.com/chromium/subspace/blob/main/num/float.h#L30-L31

However the documentation omits them all.

The same is true for other classes like this in the project, i32, i8, u8, etc.

danakj avatar Oct 28 '22 14:10 danakj

I originally thought this was an issue with your ignore list, but upon further investigation I suspect that all definitions made as part of a macro are ignored, even if their path isn't in the ignore list. Seems like macros are an unavoidable part of C++, even on the bleeding edge of C++20. Consequently we may have to add support for this.

We will investigate this further and get back to you.

For posterity, my original comment is below.

I think in your case they might be getting caught by the ignore rule that you have here:

https://github.com/chromium/subspace/blob/main/.hdoc.toml#L23

And because of that they're not being indexed.

  • As far as hdoc is concerned all of those types are being defined in the following path: subspace/num/__private/float_macros.h
  • hdoc then goes and checks the ignore path list defined in .hdoc.toml, sees a string with the value __private
  • When hdoc finds your methods it sees that the ignore list string __private is a substring of the path your functions are defined in (subspace/num/__private/float_macros.h), and doesn't index them
  • As a result, all of those methods are omitted from the HTML output

hdoc avatar Oct 29 '22 00:10 hdoc

Thank you :) And FWIW macros actually got new stuff in C++20 too heh. https://www.scs.stanford.edu/~dm/blog/va-opt.html

On Fri, Oct 28, 2022 at 8:10 PM hdoc @.***> wrote:

I originally thought this was an issue with your ignore list, but upon further investigation I suspect that all definitions made as part of a macro are ignored, even if their path isn't in the ignore list. Seems like macros are an unavoidable part of C++, even on the bleeding edge of C++20. Consequently we may have to add support for this.

We will investigate this further and get back to you.

For posterity, my original comment is below.

I think in your case they might be getting caught by the ignore rule that you have here:

https://github.com/chromium/subspace/blob/main/.hdoc.toml#L23

And because of that they're not being indexed.

  • As far as hdoc is concerned all of those types are being defined in the following path: subspace/num/__private/float_macros.h
  • hdoc then goes and checks the ignore path list defined in .hdoc.toml, sees a string with the value __private
  • When hdoc finds your methods it sees that the ignore list string __private is a substring of the path your functions are defined in ( subspace/num/__private/float_macros.h), and doesn't index them
  • As a result, all of those methods are omitted from the HTML output

— Reply to this email directly, view it on GitHub https://github.com/hdoc/hdoc/issues/34#issuecomment-1295654678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTS2LY2NAZFLVVITPRP3LWFRTQFANCNFSM6AAAAAARREHL6U . You are receiving this because you authored the thread.Message ID: @.***>

danakj avatar Oct 29 '22 02:10 danakj