You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation on cpp_index_common_prefix should state how to handle nested namespaces #8911
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::']
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.
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 "::"?
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.
Activity
C++, cpp_index_common_prefix remove longest
C++, cpp_index_common_prefix remove longest
jakobandersen commentedon Feb 19, 2021
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.
ninkibah commentedon Feb 19, 2021
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 "::"?
jakobandersen commentedon Feb 19, 2021
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.Master.patch (#1)