Sphinx 7.1.1__py3-none-any.whl → 7.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Sphinx might be problematic. Click here for more details.

Files changed (313) hide show
  1. sphinx/__init__.py +6 -6
  2. sphinx/__main__.py +3 -1
  3. sphinx/addnodes.py +35 -22
  4. sphinx/application.py +40 -38
  5. sphinx/builders/__init__.py +16 -12
  6. sphinx/builders/_epub_base.py +15 -11
  7. sphinx/builders/changes.py +6 -4
  8. sphinx/builders/dirhtml.py +4 -2
  9. sphinx/builders/dummy.py +6 -4
  10. sphinx/builders/epub3.py +16 -8
  11. sphinx/builders/gettext.py +40 -43
  12. sphinx/builders/html/__init__.py +166 -196
  13. sphinx/builders/html/_assets.py +116 -0
  14. sphinx/builders/html/transforms.py +4 -2
  15. sphinx/builders/latex/__init__.py +12 -7
  16. sphinx/builders/latex/theming.py +5 -2
  17. sphinx/builders/latex/transforms.py +6 -3
  18. sphinx/builders/linkcheck.py +21 -13
  19. sphinx/builders/manpage.py +6 -4
  20. sphinx/builders/singlehtml.py +16 -9
  21. sphinx/builders/texinfo.py +11 -6
  22. sphinx/builders/text.py +8 -3
  23. sphinx/builders/xml.py +9 -4
  24. sphinx/cmd/build.py +27 -14
  25. sphinx/cmd/make_mode.py +13 -4
  26. sphinx/cmd/quickstart.py +13 -4
  27. sphinx/config.py +17 -14
  28. sphinx/deprecation.py +4 -2
  29. sphinx/directives/__init__.py +44 -12
  30. sphinx/directives/code.py +5 -4
  31. sphinx/directives/other.py +92 -44
  32. sphinx/directives/patches.py +1 -1
  33. sphinx/domains/__init__.py +11 -8
  34. sphinx/domains/c.py +67 -57
  35. sphinx/domains/changeset.py +3 -2
  36. sphinx/domains/citation.py +2 -1
  37. sphinx/domains/cpp.py +136 -93
  38. sphinx/domains/index.py +9 -5
  39. sphinx/domains/javascript.py +32 -19
  40. sphinx/domains/math.py +5 -3
  41. sphinx/domains/python.py +69 -57
  42. sphinx/domains/rst.py +20 -11
  43. sphinx/domains/std.py +21 -15
  44. sphinx/environment/__init__.py +97 -65
  45. sphinx/environment/adapters/indexentries.py +13 -10
  46. sphinx/environment/adapters/toctree.py +485 -308
  47. sphinx/environment/collectors/__init__.py +3 -4
  48. sphinx/environment/collectors/asset.py +10 -4
  49. sphinx/environment/collectors/dependencies.py +7 -4
  50. sphinx/environment/collectors/metadata.py +7 -5
  51. sphinx/environment/collectors/title.py +5 -3
  52. sphinx/environment/collectors/toctree.py +13 -8
  53. sphinx/errors.py +1 -1
  54. sphinx/events.py +5 -5
  55. sphinx/ext/apidoc.py +49 -27
  56. sphinx/ext/autodoc/__init__.py +179 -161
  57. sphinx/ext/autodoc/directive.py +10 -6
  58. sphinx/ext/autodoc/importer.py +22 -13
  59. sphinx/ext/autodoc/mock.py +4 -1
  60. sphinx/ext/autodoc/preserve_defaults.py +80 -12
  61. sphinx/ext/autodoc/type_comment.py +14 -10
  62. sphinx/ext/autodoc/typehints.py +7 -3
  63. sphinx/ext/autosectionlabel.py +6 -3
  64. sphinx/ext/autosummary/__init__.py +21 -15
  65. sphinx/ext/autosummary/generate.py +176 -126
  66. sphinx/ext/coverage.py +93 -8
  67. sphinx/ext/doctest.py +28 -17
  68. sphinx/ext/duration.py +19 -17
  69. sphinx/ext/extlinks.py +11 -6
  70. sphinx/ext/githubpages.py +8 -7
  71. sphinx/ext/graphviz.py +61 -17
  72. sphinx/ext/ifconfig.py +7 -4
  73. sphinx/ext/imgconverter.py +4 -2
  74. sphinx/ext/imgmath.py +29 -23
  75. sphinx/ext/inheritance_diagram.py +41 -27
  76. sphinx/ext/intersphinx.py +45 -38
  77. sphinx/ext/linkcode.py +8 -5
  78. sphinx/ext/mathjax.py +13 -9
  79. sphinx/ext/napoleon/__init__.py +3 -3
  80. sphinx/ext/napoleon/docstring.py +40 -31
  81. sphinx/ext/todo.py +10 -7
  82. sphinx/ext/viewcode.py +46 -25
  83. sphinx/extension.py +1 -1
  84. sphinx/highlighting.py +20 -12
  85. sphinx/io.py +5 -4
  86. sphinx/jinja2glue.py +24 -19
  87. sphinx/locale/__init__.py +8 -2
  88. sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
  89. sphinx/locale/ar/LC_MESSAGES/sphinx.po +756 -740
  90. sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
  91. sphinx/locale/bg/LC_MESSAGES/sphinx.po +754 -738
  92. sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
  93. sphinx/locale/bn/LC_MESSAGES/sphinx.po +755 -739
  94. sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
  95. sphinx/locale/ca/LC_MESSAGES/sphinx.po +768 -752
  96. sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
  97. sphinx/locale/cak/LC_MESSAGES/sphinx.po +754 -738
  98. sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
  99. sphinx/locale/cs/LC_MESSAGES/sphinx.po +758 -742
  100. sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
  101. sphinx/locale/cy/LC_MESSAGES/sphinx.po +759 -743
  102. sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
  103. sphinx/locale/da/LC_MESSAGES/sphinx.po +760 -744
  104. sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
  105. sphinx/locale/de/LC_MESSAGES/sphinx.po +759 -743
  106. sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
  107. sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +754 -738
  108. sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
  109. sphinx/locale/el/LC_MESSAGES/sphinx.po +763 -747
  110. sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
  111. sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +754 -738
  112. sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
  113. sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +754 -738
  114. sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
  115. sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +768 -752
  116. sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
  117. sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +754 -738
  118. sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
  119. sphinx/locale/eo/LC_MESSAGES/sphinx.po +754 -738
  120. sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
  121. sphinx/locale/es/LC_MESSAGES/sphinx.po +767 -751
  122. sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
  123. sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +754 -738
  124. sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
  125. sphinx/locale/et/LC_MESSAGES/sphinx.po +762 -746
  126. sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
  127. sphinx/locale/eu/LC_MESSAGES/sphinx.po +755 -739
  128. sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
  129. sphinx/locale/fa/LC_MESSAGES/sphinx.po +766 -750
  130. sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
  131. sphinx/locale/fi/LC_MESSAGES/sphinx.po +754 -738
  132. sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
  133. sphinx/locale/fr/LC_MESSAGES/sphinx.po +768 -752
  134. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
  135. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +754 -738
  136. sphinx/locale/gl/LC_MESSAGES/sphinx.js +60 -0
  137. sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
  138. sphinx/locale/gl/LC_MESSAGES/sphinx.po +3695 -0
  139. sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
  140. sphinx/locale/he/LC_MESSAGES/sphinx.po +755 -739
  141. sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
  142. sphinx/locale/hi/LC_MESSAGES/sphinx.po +763 -747
  143. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
  144. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +754 -738
  145. sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
  146. sphinx/locale/hr/LC_MESSAGES/sphinx.po +760 -744
  147. sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
  148. sphinx/locale/hu/LC_MESSAGES/sphinx.po +759 -743
  149. sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
  150. sphinx/locale/id/LC_MESSAGES/sphinx.po +765 -749
  151. sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
  152. sphinx/locale/is/LC_MESSAGES/sphinx.po +760 -744
  153. sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
  154. sphinx/locale/it/LC_MESSAGES/sphinx.po +760 -744
  155. sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
  156. sphinx/locale/ja/LC_MESSAGES/sphinx.po +767 -751
  157. sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
  158. sphinx/locale/ka/LC_MESSAGES/sphinx.po +759 -743
  159. sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
  160. sphinx/locale/ko/LC_MESSAGES/sphinx.po +767 -751
  161. sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
  162. sphinx/locale/lt/LC_MESSAGES/sphinx.po +755 -739
  163. sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
  164. sphinx/locale/lv/LC_MESSAGES/sphinx.po +755 -739
  165. sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
  166. sphinx/locale/mk/LC_MESSAGES/sphinx.po +754 -738
  167. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
  168. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +755 -739
  169. sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
  170. sphinx/locale/ne/LC_MESSAGES/sphinx.po +755 -739
  171. sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
  172. sphinx/locale/nl/LC_MESSAGES/sphinx.po +760 -744
  173. sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
  174. sphinx/locale/pl/LC_MESSAGES/sphinx.po +762 -745
  175. sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
  176. sphinx/locale/pt/LC_MESSAGES/sphinx.po +754 -738
  177. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
  178. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +768 -752
  179. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
  180. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +755 -739
  181. sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
  182. sphinx/locale/ro/LC_MESSAGES/sphinx.po +759 -743
  183. sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
  184. sphinx/locale/ru/LC_MESSAGES/sphinx.po +760 -744
  185. sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
  186. sphinx/locale/si/LC_MESSAGES/sphinx.po +754 -738
  187. sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
  188. sphinx/locale/sk/LC_MESSAGES/sphinx.po +765 -749
  189. sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
  190. sphinx/locale/sl/LC_MESSAGES/sphinx.po +755 -739
  191. sphinx/locale/sphinx.pot +748 -740
  192. sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
  193. sphinx/locale/sq/LC_MESSAGES/sphinx.po +768 -752
  194. sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
  195. sphinx/locale/sr/LC_MESSAGES/sphinx.po +754 -738
  196. sphinx/locale/sr@latin/LC_MESSAGES/sphinx.mo +0 -0
  197. sphinx/locale/sr@latin/LC_MESSAGES/sphinx.po +754 -738
  198. sphinx/locale/sr_RS/LC_MESSAGES/sphinx.mo +0 -0
  199. sphinx/locale/sr_RS/LC_MESSAGES/sphinx.po +754 -738
  200. sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
  201. sphinx/locale/sv/LC_MESSAGES/sphinx.po +755 -739
  202. sphinx/locale/ta/LC_MESSAGES/sphinx.mo +0 -0
  203. sphinx/locale/ta/LC_MESSAGES/sphinx.po +754 -738
  204. sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
  205. sphinx/locale/te/LC_MESSAGES/sphinx.po +754 -738
  206. sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
  207. sphinx/locale/tr/LC_MESSAGES/sphinx.po +763 -747
  208. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
  209. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +760 -749
  210. sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
  211. sphinx/locale/ur/LC_MESSAGES/sphinx.po +759 -748
  212. sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
  213. sphinx/locale/vi/LC_MESSAGES/sphinx.po +754 -738
  214. sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
  215. sphinx/locale/yue/LC_MESSAGES/sphinx.po +754 -738
  216. sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo +0 -0
  217. sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +768 -752
  218. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
  219. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +754 -738
  220. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
  221. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +767 -751
  222. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
  223. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +754 -738
  224. sphinx/parsers.py +5 -4
  225. sphinx/project.py +52 -34
  226. sphinx/pycode/__init__.py +2 -1
  227. sphinx/pycode/ast.py +7 -13
  228. sphinx/pycode/parser.py +42 -38
  229. sphinx/registry.py +35 -29
  230. sphinx/roles.py +9 -4
  231. sphinx/search/__init__.py +5 -17
  232. sphinx/search/da.py +1 -1
  233. sphinx/search/de.py +1 -1
  234. sphinx/search/en.py +1 -1
  235. sphinx/search/es.py +1 -1
  236. sphinx/search/fi.py +1 -1
  237. sphinx/search/fr.py +1 -1
  238. sphinx/search/hu.py +1 -1
  239. sphinx/search/it.py +1 -1
  240. sphinx/search/ja.py +1 -1
  241. sphinx/search/nl.py +1 -1
  242. sphinx/search/no.py +1 -1
  243. sphinx/search/pt.py +1 -1
  244. sphinx/search/ro.py +1 -1
  245. sphinx/search/ru.py +1 -1
  246. sphinx/search/sv.py +1 -1
  247. sphinx/search/tr.py +1 -1
  248. sphinx/search/zh.py +1 -1
  249. sphinx/testing/fixtures.py +23 -30
  250. sphinx/testing/path.py +9 -0
  251. sphinx/testing/restructuredtext.py +13 -5
  252. sphinx/testing/util.py +20 -63
  253. sphinx/texinputs/sphinxlatexobjects.sty +15 -15
  254. sphinx/themes/agogo/static/agogo.css_t +10 -4
  255. sphinx/themes/basic/layout.html +1 -1
  256. sphinx/themes/basic/static/basic.css_t +4 -0
  257. sphinx/themes/basic/static/documentation_options.js_t +1 -2
  258. sphinx/themes/basic/static/searchtools.js +17 -9
  259. sphinx/themes/basic/static/sphinx_highlight.js +13 -3
  260. sphinx/themes/bizstyle/static/bizstyle.css_t +4 -0
  261. sphinx/themes/classic/theme.conf +1 -1
  262. sphinx/themes/epub/static/epub.css_t +6 -1
  263. sphinx/themes/haiku/theme.conf +1 -1
  264. sphinx/themes/nature/static/nature.css_t +4 -0
  265. sphinx/themes/nonav/static/nonav.css_t +6 -1
  266. sphinx/themes/pyramid/static/pyramid.css_t +4 -0
  267. sphinx/themes/scrolls/static/scrolls.css_t +4 -0
  268. sphinx/themes/scrolls/theme.conf +1 -1
  269. sphinx/themes/sphinxdoc/static/sphinxdoc.css_t +4 -0
  270. sphinx/theming.py +9 -7
  271. sphinx/transforms/__init__.py +79 -3
  272. sphinx/transforms/compact_bullet_list.py +6 -3
  273. sphinx/transforms/i18n.py +26 -10
  274. sphinx/transforms/post_transforms/__init__.py +21 -8
  275. sphinx/transforms/post_transforms/code.py +6 -3
  276. sphinx/transforms/post_transforms/images.py +13 -9
  277. sphinx/util/__init__.py +21 -92
  278. sphinx/util/cfamily.py +7 -4
  279. sphinx/util/display.py +3 -2
  280. sphinx/util/docfields.py +7 -6
  281. sphinx/util/docstrings.py +1 -1
  282. sphinx/util/docutils.py +41 -31
  283. sphinx/util/fileutil.py +9 -6
  284. sphinx/util/i18n.py +21 -18
  285. sphinx/util/images.py +2 -1
  286. sphinx/util/index_entries.py +27 -0
  287. sphinx/util/inspect.py +83 -67
  288. sphinx/util/inventory.py +4 -2
  289. sphinx/util/logging.py +9 -6
  290. sphinx/util/matching.py +5 -2
  291. sphinx/util/math.py +6 -3
  292. sphinx/util/nodes.py +70 -31
  293. sphinx/util/osutil.py +22 -40
  294. sphinx/util/parallel.py +4 -1
  295. sphinx/util/rst.py +7 -3
  296. sphinx/util/tags.py +11 -4
  297. sphinx/util/template.py +17 -14
  298. sphinx/util/typing.py +61 -20
  299. sphinx/versioning.py +6 -4
  300. sphinx/writers/html.py +1 -1
  301. sphinx/writers/html5.py +32 -24
  302. sphinx/writers/latex.py +67 -53
  303. sphinx/writers/manpage.py +9 -5
  304. sphinx/writers/texinfo.py +11 -9
  305. sphinx/writers/text.py +14 -9
  306. sphinx/writers/xml.py +3 -2
  307. {sphinx-7.1.1.dist-info → sphinx-7.2.0.dist-info}/METADATA +7 -5
  308. sphinx-7.2.0.dist-info/RECORD +568 -0
  309. sphinx/testing/comparer.py +0 -97
  310. sphinx-7.1.1.dist-info/RECORD +0 -564
  311. {sphinx-7.1.1.dist-info → sphinx-7.2.0.dist-info}/LICENSE +0 -0
  312. {sphinx-7.1.1.dist-info → sphinx-7.2.0.dist-info}/WHEEL +0 -0
  313. {sphinx-7.1.1.dist-info → sphinx-7.2.0.dist-info}/entry_points.txt +0 -0
sphinx/domains/cpp.py CHANGED
@@ -3,19 +3,14 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import re
6
- from typing import Any, Callable, Generator, Iterator, TypeVar
6
+ from typing import TYPE_CHECKING, Any, Callable, TypeVar
7
7
 
8
8
  from docutils import nodes
9
- from docutils.nodes import Element, Node, TextElement, system_message
10
9
  from docutils.parsers.rst import directives
11
10
 
12
11
  from sphinx import addnodes
13
- from sphinx.addnodes import desc_signature, pending_xref
14
- from sphinx.application import Sphinx
15
- from sphinx.builders import Builder
16
12
  from sphinx.directives import ObjectDescription
17
13
  from sphinx.domains import Domain, ObjType
18
- from sphinx.environment import BuildEnvironment
19
14
  from sphinx.errors import NoUri
20
15
  from sphinx.locale import _, __
21
16
  from sphinx.roles import SphinxRole, XRefRole
@@ -46,7 +41,17 @@ from sphinx.util.cfamily import (
46
41
  from sphinx.util.docfields import Field, GroupedField
47
42
  from sphinx.util.docutils import SphinxDirective
48
43
  from sphinx.util.nodes import make_refnode
49
- from sphinx.util.typing import OptionSpec
44
+
45
+ if TYPE_CHECKING:
46
+ from collections.abc import Generator, Iterator
47
+
48
+ from docutils.nodes import Element, Node, TextElement, system_message
49
+
50
+ from sphinx.addnodes import desc_signature, pending_xref
51
+ from sphinx.application import Sphinx
52
+ from sphinx.builders import Builder
53
+ from sphinx.environment import BuildEnvironment
54
+ from sphinx.util.typing import OptionSpec
50
55
 
51
56
  logger = logging.getLogger(__name__)
52
57
  T = TypeVar('T')
@@ -610,12 +615,15 @@ class ASTIdentifier(ASTBase):
610
615
  assert len(identifier) != 0
611
616
  self.identifier = identifier
612
617
 
618
+ def _stringify(self, transform: StringifyTransform) -> str:
619
+ return transform(self.identifier)
620
+
613
621
  def is_anon(self) -> bool:
614
622
  return self.identifier[0] == '@'
615
623
 
616
624
  def get_id(self, version: int) -> str:
617
625
  if self.is_anon() and version < 3:
618
- raise NoOldIdError()
626
+ raise NoOldIdError
619
627
  if version == 1:
620
628
  if self.identifier == 'size_t':
621
629
  return 's'
@@ -769,15 +777,18 @@ class ASTNestedName(ASTBase):
769
777
  # just print the name part, with template args, not template params
770
778
  if mode == 'noneIsName':
771
779
  if self.rooted:
772
- raise AssertionError("Can this happen?") # TODO
780
+ unreachable = "Can this happen?"
781
+ raise AssertionError(unreachable) # TODO
773
782
  signode += nodes.Text('::')
774
783
  for i in range(len(self.names)):
775
784
  if i != 0:
776
- raise AssertionError("Can this happen?") # TODO
785
+ unreachable = "Can this happen?"
786
+ raise AssertionError(unreachable) # TODO
777
787
  signode += nodes.Text('::blah')
778
788
  n = self.names[i]
779
789
  if self.templates[i]:
780
- raise AssertionError("Can this happen?") # TODO
790
+ unreachable = "Can this happen?"
791
+ raise AssertionError(unreachable) # TODO
781
792
  signode += nodes.Text("template")
782
793
  signode += nodes.Text(" ")
783
794
  n.describe_signature(signode, mode, env, '', symbol)
@@ -1401,7 +1412,7 @@ class ASTNewExpr(ASTExpression):
1401
1412
  if self.isNewTypeId:
1402
1413
  res.append(transform(self.typ))
1403
1414
  else:
1404
- raise AssertionError()
1415
+ raise AssertionError
1405
1416
  if self.initList is not None:
1406
1417
  res.append(transform(self.initList))
1407
1418
  return ''.join(res)
@@ -1428,7 +1439,7 @@ class ASTNewExpr(ASTExpression):
1428
1439
  if self.isNewTypeId:
1429
1440
  self.typ.describe_signature(signode, mode, env, symbol)
1430
1441
  else:
1431
- raise AssertionError()
1442
+ raise AssertionError
1432
1443
  if self.initList is not None:
1433
1444
  self.initList.describe_signature(signode, mode, env, symbol)
1434
1445
 
@@ -1695,12 +1706,12 @@ class ASTOperator(ASTBase):
1695
1706
  return True
1696
1707
 
1697
1708
  def get_id(self, version: int) -> str:
1698
- raise NotImplementedError()
1709
+ raise NotImplementedError
1699
1710
 
1700
1711
  def _describe_identifier(self, signode: TextElement, identnode: TextElement,
1701
1712
  env: BuildEnvironment, symbol: Symbol) -> None:
1702
1713
  """Render the prefix into signode, and the last part into identnode."""
1703
- raise NotImplementedError()
1714
+ raise NotImplementedError
1704
1715
 
1705
1716
  def describe_signature(self, signode: TextElement, mode: str,
1706
1717
  env: BuildEnvironment, prefix: str, templateArgs: str,
@@ -1740,7 +1751,7 @@ class ASTOperatorBuildIn(ASTOperator):
1740
1751
  if version == 1:
1741
1752
  ids = _id_operator_v1
1742
1753
  if self.op not in ids:
1743
- raise NoOldIdError()
1754
+ raise NoOldIdError
1744
1755
  else:
1745
1756
  ids = _id_operator_v2
1746
1757
  if self.op not in ids:
@@ -1768,7 +1779,7 @@ class ASTOperatorLiteral(ASTOperator):
1768
1779
 
1769
1780
  def get_id(self, version: int) -> str:
1770
1781
  if version == 1:
1771
- raise NoOldIdError()
1782
+ raise NoOldIdError
1772
1783
  return 'li' + self.identifier.get_id(version)
1773
1784
 
1774
1785
  def _stringify(self, transform: StringifyTransform) -> str:
@@ -1932,7 +1943,7 @@ class ASTTrailingTypeSpecDecltypeAuto(ASTTrailingTypeSpec):
1932
1943
 
1933
1944
  def get_id(self, version: int) -> str:
1934
1945
  if version == 1:
1935
- raise NoOldIdError()
1946
+ raise NoOldIdError
1936
1947
  return 'Dc'
1937
1948
 
1938
1949
  def describe_signature(self, signode: TextElement, mode: str,
@@ -1952,7 +1963,7 @@ class ASTTrailingTypeSpecDecltype(ASTTrailingTypeSpec):
1952
1963
 
1953
1964
  def get_id(self, version: int) -> str:
1954
1965
  if version == 1:
1955
- raise NoOldIdError()
1966
+ raise NoOldIdError
1956
1967
  return 'DT' + self.expr.get_id(version) + "E"
1957
1968
 
1958
1969
  def describe_signature(self, signode: TextElement, mode: str,
@@ -2900,18 +2911,18 @@ class ASTDeclaratorMemPtr(ASTDeclarator):
2900
2911
 
2901
2912
  def get_modifiers_id(self, version: int) -> str:
2902
2913
  if version == 1:
2903
- raise NoOldIdError()
2914
+ raise NoOldIdError
2904
2915
  return self.next.get_modifiers_id(version)
2905
2916
 
2906
2917
  def get_param_id(self, version: int) -> str: # only the parameters (if any)
2907
2918
  if version == 1:
2908
- raise NoOldIdError()
2919
+ raise NoOldIdError
2909
2920
  return self.next.get_param_id(version)
2910
2921
 
2911
2922
  def get_ptr_suffix_id(self, version: int) -> str:
2912
2923
  if version == 1:
2913
- raise NoOldIdError()
2914
- raise NotImplementedError()
2924
+ raise NoOldIdError
2925
+ raise NotImplementedError
2915
2926
  return self.next.get_ptr_suffix_id(version) + 'Dp'
2916
2927
 
2917
2928
  def get_type_id(self, version: int, returnTypeId: str) -> str:
@@ -2996,7 +3007,7 @@ class ASTDeclaratorParen(ASTDeclarator):
2996
3007
 
2997
3008
  def get_ptr_suffix_id(self, version: int) -> str:
2998
3009
  if version == 1:
2999
- raise NoOldIdError() # TODO: was this implemented before?
3010
+ raise NoOldIdError # TODO: was this implemented before?
3000
3011
  return self.next.get_ptr_suffix_id(version) + \
3001
3012
  self.inner.get_ptr_suffix_id(version)
3002
3013
  return self.inner.get_ptr_suffix_id(version) + \
@@ -3135,7 +3146,7 @@ class ASTType(ASTBase):
3135
3146
  raise AssertionError(objectType)
3136
3147
  else: # only type encoding
3137
3148
  if self.decl.is_function_type():
3138
- raise NoOldIdError()
3149
+ raise NoOldIdError
3139
3150
  res.append(self.declSpecs.get_id(version))
3140
3151
  res.append(self.decl.get_ptr_suffix_id(version))
3141
3152
  res.append(self.decl.get_param_id(version))
@@ -3286,7 +3297,7 @@ class ASTTypeUsing(ASTBase):
3286
3297
  def get_id(self, version: int, objectType: str | None = None,
3287
3298
  symbol: Symbol | None = None) -> str:
3288
3299
  if version == 1:
3289
- raise NoOldIdError()
3300
+ raise NoOldIdError
3290
3301
  return symbol.get_full_nested_name().get_id(version)
3291
3302
 
3292
3303
  def _stringify(self, transform: StringifyTransform) -> str:
@@ -3326,7 +3337,7 @@ class ASTConcept(ASTBase):
3326
3337
  def get_id(self, version: int, objectType: str | None = None,
3327
3338
  symbol: Symbol | None = None) -> str:
3328
3339
  if version == 1:
3329
- raise NoOldIdError()
3340
+ raise NoOldIdError
3330
3341
  return symbol.get_full_nested_name().get_id(version)
3331
3342
 
3332
3343
  def _stringify(self, transform: StringifyTransform) -> str:
@@ -3435,7 +3446,7 @@ class ASTUnion(ASTBase):
3435
3446
 
3436
3447
  def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
3437
3448
  if version == 1:
3438
- raise NoOldIdError()
3449
+ raise NoOldIdError
3439
3450
  return symbol.get_full_nested_name().get_id(version)
3440
3451
 
3441
3452
  def _stringify(self, transform: StringifyTransform) -> str:
@@ -3465,7 +3476,7 @@ class ASTEnum(ASTBase):
3465
3476
 
3466
3477
  def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
3467
3478
  if version == 1:
3468
- raise NoOldIdError()
3479
+ raise NoOldIdError
3469
3480
  return symbol.get_full_nested_name().get_id(version)
3470
3481
 
3471
3482
  def _stringify(self, transform: StringifyTransform) -> str:
@@ -3507,7 +3518,7 @@ class ASTEnumerator(ASTBase):
3507
3518
 
3508
3519
  def get_id(self, version: int, objectType: str, symbol: Symbol) -> str:
3509
3520
  if version == 1:
3510
- raise NoOldIdError()
3521
+ raise NoOldIdError
3511
3522
  return symbol.get_full_nested_name().get_id(version)
3512
3523
 
3513
3524
  def _stringify(self, transform: StringifyTransform) -> str:
@@ -4032,7 +4043,7 @@ class ASTDeclaration(ASTBase):
4032
4043
  def get_id(self, version: int, prefixed: bool = True) -> str:
4033
4044
  if version == 1:
4034
4045
  if self.templatePrefix or self.trailingRequiresClause:
4035
- raise NoOldIdError()
4046
+ raise NoOldIdError
4036
4047
  if self.objectType == 'enumerator' and self.enumeratorScopedSymbol:
4037
4048
  return self.enumeratorScopedSymbol.declaration.get_id(version)
4038
4049
  return self.declaration.get_id(version, self.objectType, self.symbol)
@@ -4061,7 +4072,7 @@ class ASTDeclaration(ASTBase):
4061
4072
 
4062
4073
  if requiresClauseInLast or self.trailingRequiresClause:
4063
4074
  if version < 4:
4064
- raise NoOldIdError()
4075
+ raise NoOldIdError
4065
4076
  res.append('IQ')
4066
4077
  if requiresClauseInLast and self.trailingRequiresClause:
4067
4078
  # make a conjunction of them
@@ -4221,18 +4232,18 @@ class Symbol:
4221
4232
  debug_show_tree = False # overridden by the corresponding config value
4222
4233
 
4223
4234
  def __copy__(self):
4224
- raise AssertionError() # shouldn't happen
4235
+ raise AssertionError # shouldn't happen
4225
4236
 
4226
4237
  def __deepcopy__(self, memo):
4227
4238
  if self.parent:
4228
- raise AssertionError() # shouldn't happen
4239
+ raise AssertionError # shouldn't happen
4229
4240
  # the domain base class makes a copy of the initial data, which is fine
4230
4241
  return Symbol(None, None, None, None, None, None, None)
4231
4242
 
4232
4243
  @staticmethod
4233
4244
  def debug_print(*args: Any) -> None:
4234
- print(Symbol.debug_indent_string * Symbol.debug_indent, end="")
4235
- print(*args)
4245
+ logger.debug(Symbol.debug_indent_string * Symbol.debug_indent, end="")
4246
+ logger.debug(*args)
4236
4247
 
4237
4248
  def _assert_invariants(self) -> None:
4238
4249
  if not self.parent:
@@ -4248,7 +4259,7 @@ class Symbol:
4248
4259
 
4249
4260
  def __setattr__(self, key: str, value: Any) -> None:
4250
4261
  if key == "children":
4251
- raise AssertionError()
4262
+ raise AssertionError
4252
4263
  return super().__setattr__(key, value)
4253
4264
 
4254
4265
  def __init__(self, parent: Symbol | None,
@@ -4441,7 +4452,7 @@ class Symbol:
4441
4452
  Symbol.debug_print("_find_named_symbols:")
4442
4453
  Symbol.debug_indent += 1
4443
4454
  Symbol.debug_print("self:")
4444
- print(self.to_string(Symbol.debug_indent + 1), end="")
4455
+ logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
4445
4456
  Symbol.debug_print("identOrOp: ", identOrOp)
4446
4457
  Symbol.debug_print("templateParams: ", templateParams)
4447
4458
  Symbol.debug_print("templateArgs: ", templateArgs)
@@ -4485,7 +4496,7 @@ class Symbol:
4485
4496
  s = self
4486
4497
  if Symbol.debug_lookup:
4487
4498
  Symbol.debug_print("searching in self:")
4488
- print(s.to_string(Symbol.debug_indent + 1), end="")
4499
+ logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
4489
4500
  while True:
4490
4501
  if matchSelf:
4491
4502
  yield s
@@ -4499,12 +4510,12 @@ class Symbol:
4499
4510
  s = s.siblingAbove
4500
4511
  if Symbol.debug_lookup:
4501
4512
  Symbol.debug_print("searching in sibling:")
4502
- print(s.to_string(Symbol.debug_indent + 1), end="")
4513
+ logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
4503
4514
 
4504
4515
  for s in candidates():
4505
4516
  if Symbol.debug_lookup:
4506
4517
  Symbol.debug_print("candidate:")
4507
- print(s.to_string(Symbol.debug_indent + 1), end="")
4518
+ logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
4508
4519
  if matches(s):
4509
4520
  if Symbol.debug_lookup:
4510
4521
  Symbol.debug_indent += 1
@@ -4534,7 +4545,7 @@ class Symbol:
4534
4545
  Symbol.debug_print("_symbol_lookup:")
4535
4546
  Symbol.debug_indent += 1
4536
4547
  Symbol.debug_print("self:")
4537
- print(self.to_string(Symbol.debug_indent + 1), end="")
4548
+ logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
4538
4549
  Symbol.debug_print("nestedName: ", nestedName)
4539
4550
  Symbol.debug_print("templateDecls: ", ",".join(str(t) for t in templateDecls))
4540
4551
  Symbol.debug_print("strictTemplateParamArgLists:", strictTemplateParamArgLists)
@@ -4581,7 +4592,7 @@ class Symbol:
4581
4592
 
4582
4593
  if Symbol.debug_lookup:
4583
4594
  Symbol.debug_print("starting point:")
4584
- print(parentSymbol.to_string(Symbol.debug_indent + 1), end="")
4595
+ logger.debug(parentSymbol.to_string(Symbol.debug_indent + 1), end="")
4585
4596
 
4586
4597
  # and now the actual lookup
4587
4598
  iTemplateDecl = 0
@@ -4627,7 +4638,7 @@ class Symbol:
4627
4638
 
4628
4639
  if Symbol.debug_lookup:
4629
4640
  Symbol.debug_print("handle last name from:")
4630
- print(parentSymbol.to_string(Symbol.debug_indent + 1), end="")
4641
+ logger.debug(parentSymbol.to_string(Symbol.debug_indent + 1), end="")
4631
4642
 
4632
4643
  # handle the last name
4633
4644
  name = names[-1]
@@ -4646,7 +4657,7 @@ class Symbol:
4646
4657
  recurseInAnon=recurseInAnon, correctPrimaryTemplateArgs=False,
4647
4658
  searchInSiblings=searchInSiblings)
4648
4659
  if Symbol.debug_lookup:
4649
- symbols = list(symbols) # type: ignore
4660
+ symbols = list(symbols) # type: ignore[assignment]
4650
4661
  Symbol.debug_indent -= 2
4651
4662
  return SymbolLookupResult(symbols, parentSymbol,
4652
4663
  identOrOp, templateParams, templateArgs)
@@ -4986,14 +4997,14 @@ class Symbol:
4986
4997
  Symbol.debug_print("matchSelf: ", matchSelf)
4987
4998
  Symbol.debug_print("recurseInAnon: ", recurseInAnon)
4988
4999
  Symbol.debug_print("searchInSiblings:", searchInSiblings)
4989
- print(self.to_string(Symbol.debug_indent + 1), end="")
5000
+ logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
4990
5001
  Symbol.debug_indent -= 2
4991
5002
  current = self
4992
5003
  while current is not None:
4993
5004
  if Symbol.debug_lookup:
4994
5005
  Symbol.debug_indent += 2
4995
5006
  Symbol.debug_print("trying:")
4996
- print(current.to_string(Symbol.debug_indent + 1), end="")
5007
+ logger.debug(current.to_string(Symbol.debug_indent + 1), end="")
4997
5008
  Symbol.debug_indent -= 2
4998
5009
  if matchSelf and current.identOrOp == identOrOp:
4999
5010
  return current
@@ -5036,7 +5047,7 @@ class Symbol:
5036
5047
  Symbol.debug_print("templateParams:", templateParams)
5037
5048
  Symbol.debug_print("id: ", id_)
5038
5049
  if s is not None:
5039
- print(s.to_string(Symbol.debug_indent + 1), end="")
5050
+ logger.debug(s.to_string(Symbol.debug_indent + 1), end="")
5040
5051
  else:
5041
5052
  Symbol.debug_print("not found")
5042
5053
  if s is None:
@@ -5058,7 +5069,7 @@ class Symbol:
5058
5069
  Symbol.debug_print("find_name:")
5059
5070
  Symbol.debug_indent += 1
5060
5071
  Symbol.debug_print("self:")
5061
- print(self.to_string(Symbol.debug_indent + 1), end="")
5072
+ logger.debug(self.to_string(Symbol.debug_indent + 1), end="")
5062
5073
  Symbol.debug_print("nestedName: ", nestedName)
5063
5074
  Symbol.debug_print("templateDecls: ", templateDecls)
5064
5075
  Symbol.debug_print("typ: ", typ)
@@ -5080,7 +5091,7 @@ class Symbol:
5080
5091
  # Is there another case where it would be good?
5081
5092
  if parentSymbol.declaration is not None:
5082
5093
  if parentSymbol.declaration.objectType == 'templateParam':
5083
- raise QualifiedSymbolIsTemplateParam()
5094
+ raise QualifiedSymbolIsTemplateParam
5084
5095
  return None
5085
5096
 
5086
5097
  try:
@@ -6114,7 +6125,8 @@ class DefinitionParser(BaseParser):
6114
6125
  if modifier is not None:
6115
6126
  self.fail(f"Can not have {modifier} without a floating point type.")
6116
6127
  else:
6117
- raise AssertionError(f"Unhandled type {typ}")
6128
+ msg = f'Unhandled type {typ}'
6129
+ raise AssertionError(msg)
6118
6130
 
6119
6131
  canonNames: list[str] = []
6120
6132
  if modifier is not None:
@@ -6640,7 +6652,7 @@ class DefinitionParser(BaseParser):
6640
6652
  elif outer == 'function':
6641
6653
  desc = "If the function has no return type"
6642
6654
  else:
6643
- raise AssertionError()
6655
+ raise AssertionError from exUntyped
6644
6656
  prevErrors.append((exUntyped, desc))
6645
6657
  self.pos = startPos
6646
6658
  try:
@@ -6653,7 +6665,7 @@ class DefinitionParser(BaseParser):
6653
6665
  elif outer == 'function':
6654
6666
  desc = "If the function has a return type"
6655
6667
  else:
6656
- raise AssertionError()
6668
+ raise AssertionError from exUntyped
6657
6669
  prevErrors.append((exTyped, desc))
6658
6670
  # Retain the else branch for easier debugging.
6659
6671
  # TODO: it would be nice to save the previous stacktrace
@@ -6665,7 +6677,7 @@ class DefinitionParser(BaseParser):
6665
6677
  elif outer == 'function':
6666
6678
  header = "Error when parsing function declaration."
6667
6679
  else:
6668
- raise AssertionError()
6680
+ raise AssertionError from exUntyped
6669
6681
  raise self._make_multi_error(prevErrors, header) from exTyped
6670
6682
  else: # NoQA: RET506
6671
6683
  # For testing purposes.
@@ -6727,7 +6739,7 @@ class DefinitionParser(BaseParser):
6727
6739
  return ASTTemplateParamConstrainedTypeWithInit(type, typeInit)
6728
6740
  except DefinitionError as eType:
6729
6741
  if eExpr is None:
6730
- raise eType
6742
+ raise
6731
6743
  errs = []
6732
6744
  errs.append((eExpr, "If default template argument is an expression"))
6733
6745
  errs.append((eType, "If default template argument is a type"))
@@ -6871,7 +6883,7 @@ class DefinitionParser(BaseParser):
6871
6883
  (eType, "If unconstrained type parameter or template type parameter"))
6872
6884
  errs.append(
6873
6885
  (eNonType, "If constrained type parameter or non-type parameter"))
6874
- raise self._make_multi_error(errs, header)
6886
+ raise self._make_multi_error(errs, header) from None
6875
6887
 
6876
6888
  def _parse_template_parameter_list(self) -> ASTTemplateParams:
6877
6889
  # only: '<' parameter-list '>'
@@ -6904,7 +6916,7 @@ class DefinitionParser(BaseParser):
6904
6916
  self.fail('Expected "," or ">".')
6905
6917
  except DefinitionError as e:
6906
6918
  errs.append((e, "If no parameter"))
6907
- print(errs)
6919
+ logger.debug(errs)
6908
6920
  raise self._make_multi_error(errs, header)
6909
6921
 
6910
6922
  def _parse_template_introduction(self) -> ASTTemplateIntroduction:
@@ -7122,7 +7134,7 @@ class DefinitionParser(BaseParser):
7122
7134
  elif objectType == 'enumerator':
7123
7135
  declaration = self._parse_enumerator()
7124
7136
  else:
7125
- raise AssertionError()
7137
+ raise AssertionError
7126
7138
  templatePrefix = self._check_template_consistency(declaration.name,
7127
7139
  templatePrefix,
7128
7140
  fullSpecShorthand=False,
@@ -7139,7 +7151,7 @@ class DefinitionParser(BaseParser):
7139
7151
  templatePrefix = self._check_template_consistency(name, templatePrefix,
7140
7152
  fullSpecShorthand=False)
7141
7153
  res = ASTNamespace(name, templatePrefix)
7142
- res.objectType = 'namespace' # type: ignore
7154
+ res.objectType = 'namespace' # type: ignore[attr-defined]
7143
7155
  return res
7144
7156
 
7145
7157
  def parse_xref_object(self) -> tuple[ASTNamespace | ASTDeclaration, bool]:
@@ -7154,7 +7166,7 @@ class DefinitionParser(BaseParser):
7154
7166
  templatePrefix = self._check_template_consistency(name, templatePrefix,
7155
7167
  fullSpecShorthand=True)
7156
7168
  res1 = ASTNamespace(name, templatePrefix)
7157
- res1.objectType = 'xref' # type: ignore
7169
+ res1.objectType = 'xref' # type: ignore[attr-defined]
7158
7170
  return res1, True
7159
7171
  except DefinitionError as e1:
7160
7172
  try:
@@ -7209,6 +7221,9 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
7209
7221
  ]
7210
7222
 
7211
7223
  option_spec: OptionSpec = {
7224
+ 'no-index-entry': directives.flag,
7225
+ 'no-contents-entry': directives.flag,
7226
+ 'no-typesetting': directives.flag,
7212
7227
  'noindexentry': directives.flag,
7213
7228
  'nocontentsentry': directives.flag,
7214
7229
  'tparam-line-spec': directives.flag,
@@ -7288,7 +7303,7 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
7288
7303
  if decl.objectType == 'concept':
7289
7304
  isInConcept = True
7290
7305
  break
7291
- if not isInConcept and 'noindexentry' not in self.options:
7306
+ if not isInConcept and 'no-index-entry' not in self.options:
7292
7307
  strippedName = name
7293
7308
  for prefix in self.env.config.cpp_index_common_prefix:
7294
7309
  if name.startswith(prefix):
@@ -7315,7 +7330,7 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
7315
7330
 
7316
7331
  @property
7317
7332
  def object_type(self) -> str:
7318
- raise NotImplementedError()
7333
+ raise NotImplementedError
7319
7334
 
7320
7335
  @property
7321
7336
  def display_object_type(self) -> str:
@@ -7428,10 +7443,38 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
7428
7443
  self.oldParentKey: LookupKey = self.env.ref_context['cpp:parent_key']
7429
7444
  self.env.temp_data['cpp:parent_symbol'] = lastSymbol
7430
7445
  self.env.ref_context['cpp:parent_key'] = lastSymbol.get_lookup_key()
7446
+ self.env.temp_data['cpp:domain_name'] = (
7447
+ *self.env.temp_data.get('cpp:domain_name', ()),
7448
+ lastSymbol.identOrOp._stringify(str),
7449
+ )
7431
7450
 
7432
7451
  def after_content(self) -> None:
7433
7452
  self.env.temp_data['cpp:parent_symbol'] = self.oldParentSymbol
7434
7453
  self.env.ref_context['cpp:parent_key'] = self.oldParentKey
7454
+ self.env.temp_data['cpp:domain_name'] = self.env.temp_data['cpp:domain_name'][:-1]
7455
+
7456
+ def _object_hierarchy_parts(self, sig_node: desc_signature) -> tuple[str, ...]:
7457
+ return tuple(s.identOrOp._stringify(str) for s in
7458
+ self.env.temp_data['cpp:last_symbol'].get_full_nested_name().names)
7459
+
7460
+ def _toc_entry_name(self, sig_node: desc_signature) -> str:
7461
+ if not sig_node.get('_toc_parts'):
7462
+ return ''
7463
+
7464
+ config = self.env.app.config
7465
+ objtype = sig_node.parent.get('objtype')
7466
+ if config.add_function_parentheses and objtype in {'function', 'method'}:
7467
+ parens = '()'
7468
+ else:
7469
+ parens = ''
7470
+ *parents, name = sig_node['_toc_parts']
7471
+ if config.toc_object_entries_show_parents == 'domain':
7472
+ return '::'.join((*self.env.temp_data.get('cpp:domain_name', ()), name + parens))
7473
+ if config.toc_object_entries_show_parents == 'hide':
7474
+ return name + parens
7475
+ if config.toc_object_entries_show_parents == 'all':
7476
+ return '::'.join(parents + [name + parens])
7477
+ return ''
7435
7478
 
7436
7479
 
7437
7480
  class CPPTypeObject(CPPObject):
@@ -7632,7 +7675,7 @@ class AliasTransform(SphinxTransform):
7632
7675
  desc['domain'] = 'cpp'
7633
7676
  # 'desctype' is a backwards compatible attribute
7634
7677
  desc['objtype'] = desc['desctype'] = 'alias'
7635
- desc['noindex'] = True
7678
+ desc['no-index'] = True
7636
7679
  childContainer = desc
7637
7680
 
7638
7681
  for sChild in s._children:
@@ -7674,9 +7717,9 @@ class AliasTransform(SphinxTransform):
7674
7717
  rootSymbol: Symbol = self.env.domains['cpp'].data['root_symbol']
7675
7718
  parentSymbol: Symbol = rootSymbol.direct_lookup(parentKey)
7676
7719
  if not parentSymbol:
7677
- print("Target: ", sig)
7678
- print("ParentKey: ", parentKey)
7679
- print(rootSymbol.dump(1))
7720
+ logger.debug("Target: %s", sig)
7721
+ logger.debug("ParentKey: %s", parentKey)
7722
+ logger.debug(rootSymbol.dump(1))
7680
7723
  assert parentSymbol # should be there
7681
7724
 
7682
7725
  symbols: list[Symbol] = []
@@ -7917,19 +7960,19 @@ class CPPDomain(Domain):
7917
7960
 
7918
7961
  def clear_doc(self, docname: str) -> None:
7919
7962
  if Symbol.debug_show_tree:
7920
- print("clear_doc:", docname)
7921
- print("\tbefore:")
7922
- print(self.data['root_symbol'].dump(1))
7923
- print("\tbefore end")
7963
+ logger.debug("clear_doc: %s", docname)
7964
+ logger.debug("\tbefore:")
7965
+ logger.debug(self.data['root_symbol'].dump(1))
7966
+ logger.debug("\tbefore end")
7924
7967
 
7925
7968
  rootSymbol = self.data['root_symbol']
7926
7969
  rootSymbol.clear_doc(docname)
7927
7970
 
7928
7971
  if Symbol.debug_show_tree:
7929
- print("\tafter:")
7930
- print(self.data['root_symbol'].dump(1))
7931
- print("\tafter end")
7932
- print("clear_doc end:", docname)
7972
+ logger.debug("\tafter:")
7973
+ logger.debug(self.data['root_symbol'].dump(1))
7974
+ logger.debug("\tafter end")
7975
+ logger.debug("clear_doc end: %s", docname)
7933
7976
  for name, nDocname in list(self.data['names'].items()):
7934
7977
  if nDocname == docname:
7935
7978
  del self.data['names'][name]
@@ -7937,22 +7980,22 @@ class CPPDomain(Domain):
7937
7980
  def process_doc(self, env: BuildEnvironment, docname: str,
7938
7981
  document: nodes.document) -> None:
7939
7982
  if Symbol.debug_show_tree:
7940
- print("process_doc:", docname)
7941
- print(self.data['root_symbol'].dump(0))
7942
- print("process_doc end:", docname)
7983
+ logger.debug("process_doc: %s", docname)
7984
+ logger.debug(self.data['root_symbol'].dump(0))
7985
+ logger.debug("process_doc end: %s", docname)
7943
7986
 
7944
7987
  def process_field_xref(self, pnode: pending_xref) -> None:
7945
7988
  pnode.attributes.update(self.env.ref_context)
7946
7989
 
7947
7990
  def merge_domaindata(self, docnames: list[str], otherdata: dict) -> None:
7948
7991
  if Symbol.debug_show_tree:
7949
- print("merge_domaindata:")
7950
- print("\tself:")
7951
- print(self.data['root_symbol'].dump(1))
7952
- print("\tself end")
7953
- print("\tother:")
7954
- print(otherdata['root_symbol'].dump(1))
7955
- print("\tother end")
7992
+ logger.debug("merge_domaindata:")
7993
+ logger.debug("\tself:")
7994
+ logger.debug(self.data['root_symbol'].dump(1))
7995
+ logger.debug("\tself end")
7996
+ logger.debug("\tother:")
7997
+ logger.debug(otherdata['root_symbol'].dump(1))
7998
+ logger.debug("\tother end")
7956
7999
 
7957
8000
  self.data['root_symbol'].merge_with(otherdata['root_symbol'],
7958
8001
  docnames, self.env)
@@ -7963,10 +8006,10 @@ class CPPDomain(Domain):
7963
8006
  ourNames[name] = docname
7964
8007
  # no need to warn on duplicates, the symbol merge already does that
7965
8008
  if Symbol.debug_show_tree:
7966
- print("\tresult:")
7967
- print(self.data['root_symbol'].dump(1))
7968
- print("\tresult end")
7969
- print("merge_domaindata end")
8009
+ logger.debug("\tresult:")
8010
+ logger.debug(self.data['root_symbol'].dump(1))
8011
+ logger.debug("\tresult end")
8012
+ logger.debug("merge_domaindata end")
7970
8013
 
7971
8014
  def _resolve_xref_inner(self, env: BuildEnvironment, fromdocname: str, builder: Builder,
7972
8015
  typ: str, target: str, node: pending_xref,
@@ -8001,9 +8044,9 @@ class CPPDomain(Domain):
8001
8044
  if parentKey:
8002
8045
  parentSymbol: Symbol = rootSymbol.direct_lookup(parentKey)
8003
8046
  if not parentSymbol:
8004
- print("Target: ", target)
8005
- print("ParentKey: ", parentKey.data)
8006
- print(rootSymbol.dump(1))
8047
+ logger.debug("Target: %s", target)
8048
+ logger.debug("ParentKey: %s", parentKey.data)
8049
+ logger.debug(rootSymbol.dump(1))
8007
8050
  assert parentSymbol # should be there
8008
8051
  else:
8009
8052
  parentSymbol = rootSymbol
@@ -8056,8 +8099,8 @@ class CPPDomain(Domain):
8056
8099
  objtypes = self.objtypes_for_role(typ)
8057
8100
  if objtypes:
8058
8101
  return declTyp in objtypes
8059
- print(f"Type is {typ}, declaration type is {declTyp}")
8060
- raise AssertionError()
8102
+ logger.debug(f"Type is {typ}, declaration type is {declTyp}") # NoQA: G004
8103
+ raise AssertionError
8061
8104
  if not checkType():
8062
8105
  logger.warning("cpp:%s targets a %s (%s).",
8063
8106
  typ, s.declaration.objectType,