sphinx
sphinx copied to clipboard
[C++] Resolve nested symbols through type aliases and base classes
Feature or Bugfix
- Feature
Purpose
Previously, symbol resolution always stopped at type aliases and also did not consider base classes. For example, with the following document:
.. cpp:class:: Class
.. cpp::type:: NestedType = int
.. cpp:type:: Alias = Class
:cpp:expr:`Alias::NestedType`
Alias::NestedType
was not able to be resolved. With this change, it
is correctly resolved to Class::NestedType
.
Additionally, symbols are also resolved through base classes in a similar way:
.. cpp:class:: Base
.. cpp::type:: NestedType = int
.. cpp:class:: Class : Base
:cpp:expr:`Class::NestedType`
With this change, Class::NestedType
will be correctly resolved to
Base::NestedType
.
@jakobandersen If you have a chance to look at this as well, that would be awesome!
@AA-Turner @jakobandersen Since there seems to be renewed activity on the C++ domain, if I rebase this to HEAD would you have time to look at it soon?
I've hesitated to review this previously as I have limited C++ experience, and I believe Jakob has limited time to review nowadays.
That being said, I'm happy to review an updated PR, and will trust it on the basis of the tests passing.
A
The idea is good, I'll try to review it as soon as possible.
@jakobandersen
The idea is good, I'll try to review it as soon as possible.
Okay, I rebased it.
Ping @jakobandersen if you have time to have a look at this.
A
I'll try to get to it within the next weekend or two.