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

Basic C++ namespace support #247

Merged
merged 3 commits into from
Sep 4, 2024
Merged

Basic C++ namespace support #247

merged 3 commits into from
Sep 4, 2024

Conversation

jnikula
Copy link
Owner

@jnikula jnikula commented Aug 31, 2024

This incorporates @stephanlachnit's work from #211 and adds some tests on top.

Let's be honest, there are still some gaps here. For example, variables within a namespace don't get the namespace prefix in documentation. However, I'm making the argument this is a net positive improvement over the status quo, regardless of those gaps. This is progress. This can be built upon.

The tests added merely check against the current output, not what might be the desired output. I don't even have enough recent experience on modern C++ to say what the desired prefixing would be.

Anyway, unless @stephanlachnit and @BrunoMSantos are vehemently opposed, I'm going to merge this as-is.

Let's just move things forward.

stephanlachnit and others added 3 commits August 31, 2024 14:27
Recurse into namespaces in _parse_undocumented_block(), and use
cursor.semantic_parent recursively to figure out namespace prefix.

Signed-off-by: Stephan Lachnit <[email protected]>
This combines some test input from Stephan Lachnit and myself.

Some of the results are likely not what's desired. Not everything
appears to get the namespace prefix, for example variables.

It's not clear that everything that appears to be missing a namespace
prefix should get a prefix either; for example class/struct/union
members, or enumerators, as they're nested within a parent that does
have the namespace prefix.

More than anything, the test documents the status quo, and provides a
way to make incremental improvements on top.
@jnikula
Copy link
Owner Author

jnikula commented Aug 31, 2024

Also, fixes #209.

@jnikula jnikula merged commit 9bdde44 into master Sep 4, 2024
5 checks passed
@jnikula jnikula deleted the cpp-namespace branch September 4, 2024 17:00
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

Successfully merging this pull request may close these issues.

2 participants