sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

[C++] Resolve nested symbols through type aliases and base classes

Open jbms opened this issue 2 years ago • 7 comments

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.

jbms avatar Mar 25 '22 22:03 jbms

@jakobandersen If you have a chance to look at this as well, that would be awesome!

jbms avatar Jul 29 '22 16:07 jbms

@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?

jbms avatar Jan 19 '24 17:01 jbms

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

AA-Turner avatar Jan 20 '24 10:01 AA-Turner

The idea is good, I'll try to review it as soon as possible.

jakobandersen avatar Jan 21 '24 19:01 jakobandersen

@jakobandersen

The idea is good, I'll try to review it as soon as possible.

Okay, I rebased it.

jbms avatar Jan 22 '24 18:01 jbms

Ping @jakobandersen if you have time to have a look at this.

A

AA-Turner avatar Apr 17 '24 04:04 AA-Turner

I'll try to get to it within the next weekend or two.

jakobandersen avatar Apr 17 '24 09:04 jakobandersen