Skip to content

Documentation on cpp_index_common_prefix should state how to handle nested namespaces #8911

Closed

Description

@ninkibah

The documentation for cpp_index_common_prefix
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-cpp_paren_attributes
does not explain how to specify child namespaces.

It took me some time to figure out that I needed to specify the child namespace before the parent.

Suggested wording change to the documentation:

A list of prefixes that will be ignored when sorting C++ objects in the global index. For example ['awesome_lib::'].
Child namespaces must be listed before parent namespaces, otherwise the child will not be recognized.

For example: ['awesome_lib::internal::', 'awesome_lib::']

Activity

  1. added 2 commits that reference this issue on Feb 19, 2021
    3f453bf
    95a872e
  2. jakobandersen commented on Feb 19, 2021

    @jakobandersen
    Contributor

    Thanks for reporting, that's a good point. I consider this a bug in the implementation rather than in the documentation. I have posted #8912 which should make it remove the longest of the given prefixes instead of simply the first one that matches.

  3. ninkibah commented on Feb 19, 2021

    @ninkibah
    Author

    Wow, I didn't expect such a fast response, and I only added the issue so that other users would know the workaround. But removing the longest prefix sounds reasonable. One final point: I suppose there are some edge cases where it's useful to not match the "::", so you can match against partial namespace names. But I can't think why you would want that. so, would you want to internally append "::" to a prefix if it didn't end in "::"?

  4. jakobandersen commented on Feb 19, 2021

    @jakobandersen
    Contributor

    At this point I can't think of a use-case where the prefix doesn't end in :: either. Though, I would rather leave it as is, so it at least is possible if someone finds it useful.

  5. added a commit that references this issue on Mar 11, 2021
    3134085
  6. locked as resolved and limited conversation to collaborators on Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions