mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Improve cpp intersphinx support
Now types called out in function declarations will be searched for in the intersphinx inventory as well
This commit is contained in:
parent
1d0f667ecd
commit
5ebfd51672
@ -4816,12 +4816,12 @@ class CPPDomain(Domain):
|
|||||||
name = 'cpp'
|
name = 'cpp'
|
||||||
label = 'C++'
|
label = 'C++'
|
||||||
object_types = {
|
object_types = {
|
||||||
'class': ObjType(l_('class'), 'class'),
|
'class': ObjType(l_('class'), 'class', 'typeOrConcept'),
|
||||||
'function': ObjType(l_('function'), 'func'),
|
'function': ObjType(l_('function'), 'func', 'typeOrConcept'),
|
||||||
'member': ObjType(l_('member'), 'member'),
|
'member': ObjType(l_('member'), 'member'),
|
||||||
'type': ObjType(l_('type'), 'type'),
|
'type': ObjType(l_('type'), 'type', 'typeOrConcept'),
|
||||||
'concept': ObjType(l_('concept'), 'concept'),
|
'concept': ObjType(l_('concept'), 'concept', 'typeOrConcept'),
|
||||||
'enum': ObjType(l_('enum'), 'enum'),
|
'enum': ObjType(l_('enum'), 'enum', 'typeOrConcept'),
|
||||||
'enumerator': ObjType(l_('enumerator'), 'enumerator')
|
'enumerator': ObjType(l_('enumerator'), 'enumerator')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,3 +4,5 @@ test-ext-intersphinx-cppdomain
|
|||||||
.. cpp:namespace:: foo
|
.. cpp:namespace:: foo
|
||||||
|
|
||||||
:cpp:class:`Bar`
|
:cpp:class:`Bar`
|
||||||
|
|
||||||
|
.. cpp:function:: std::uint8_t FooBarBaz()
|
||||||
|
@ -232,6 +232,12 @@ def test_missing_reference_cppdomain(tempdir, app, status, warning):
|
|||||||
' href="https://docs.python.org/index.html#cpp_foo_bar"'
|
' href="https://docs.python.org/index.html#cpp_foo_bar"'
|
||||||
' title="(in foo v2.0)"><code class="xref cpp cpp-class docutils literal">'
|
' title="(in foo v2.0)"><code class="xref cpp cpp-class docutils literal">'
|
||||||
'<span class="pre">Bar</span></code></a>' in html)
|
'<span class="pre">Bar</span></code></a>' in html)
|
||||||
|
assert ('<a class="reference external"'
|
||||||
|
' href="https://docs.python.org/index.html#std"'
|
||||||
|
' title="(in foo v2.0)">std</a>' in html)
|
||||||
|
assert ('<a class="reference external"'
|
||||||
|
' href="https://docs.python.org/index.html#std_uint8_t"'
|
||||||
|
' title="(in foo v2.0)">uint8_t</a>' in html)
|
||||||
|
|
||||||
|
|
||||||
def test_missing_reference_jsdomain(tempdir, app, status, warning):
|
def test_missing_reference_jsdomain(tempdir, app, status, warning):
|
||||||
|
@ -34,6 +34,8 @@ module1 py:module 0 foo.html#module-module1 Long Module desc
|
|||||||
module2 py:module 0 foo.html#module-$ -
|
module2 py:module 0 foo.html#module-$ -
|
||||||
module1.func py:function 1 sub/foo.html#$ -
|
module1.func py:function 1 sub/foo.html#$ -
|
||||||
CFunc c:function 2 cfunc.html#CFunc -
|
CFunc c:function 2 cfunc.html#CFunc -
|
||||||
|
std cpp:type 1 index.html#std -
|
||||||
|
std::uint8_t cpp:type 1 index.html#std_uint8_t -
|
||||||
foo::Bar cpp:class 1 index.html#cpp_foo_bar -
|
foo::Bar cpp:class 1 index.html#cpp_foo_bar -
|
||||||
foo::Bar::baz cpp:function 1 index.html#cpp_foo_bar_baz -
|
foo::Bar::baz cpp:function 1 index.html#cpp_foo_bar_baz -
|
||||||
a term std:term -1 glossary.html#term-a-term -
|
a term std:term -1 glossary.html#term-a-term -
|
||||||
|
Loading…
Reference in New Issue
Block a user