Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module indexes for documentation #18958

Open
v-p-b opened this issue Mar 9, 2025 · 1 comment
Open

Module indexes for documentation #18958

v-p-b opened this issue Mar 9, 2025 · 1 comment
Assignees

Comments

@v-p-b
Copy link

v-p-b commented Mar 9, 2025

I think it would be great if standard library documentation included lists of modules present in a namespace. For example, the documentation of the C++ ControlFlowGraph module is available here:

https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/controlflow/ControlFlowGraph.qll/module.ControlFlowGraph.html

This is easily discoverable if someone knows what to search for, but I couldn't find a good way to find out what other modules are there in the semmle.code.cpp.controlflow namespace (the https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/controlflow/ URL is 404). Having such a list in the documentation would be useful to find the best fit for the control-flow problem at hand in this case. For example when browsing the source code and reading the comments of each .qll file in the appropriate directory one can discover the BasicBlocks module stating:

"Provides a library for reasoning about control flow at the granularity of basic blocks. This is usually much more efficient than reasoning directly at the level of ControlFlowNodes."

My suggestion is to generate documentation from these comments too and generate index files in each namespace directory that list all contained modules and namespaces.

I'd be happy to work on a PR but I'll need some guidance about how API documentation for the standard library is generated (I could only find this guide that doesn't seem to cover the standard library API).

@hvitved
Copy link
Contributor

hvitved commented Mar 10, 2025

Seems like a valid ask to me, but one would have to be careful, since namespaces can in principle be infinite. For example, in

module A {
  import B as B1
}

module B {
  import A as A1
}

there is an infinite number of namespaces A::B1::A1::B1::A1::....

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

No branches or pull requests

3 participants