1313from docutils .parsers .rst import Parser
1414from docutils .parsers .rst .directives import flag , unchanged
1515from docutils .statemachine import StringList
16- from sphinx .ext .autodoc import mock
17- from sphinx .util .docutils import SphinxDirective , new_document
1816from sphinx .domains import Domain , Index , IndexEntry
1917from sphinx .errors import ExtensionError
2018from sphinx .ext .autodoc import mock
@@ -895,8 +893,10 @@ class ArgParseDomain(Domain):
895893 # option is set to True.
896894 temporary_index_files : list [Path ] = []
897895
898- def get_full_qualified_name (self , node : Element ) -> str :
899- return str (node .arguments [0 ])
896+ def get_full_qualified_name (self , node : Element ) -> str | None :
897+ # The use of this method is not clear - the content is made to
898+ # resemble :meth:`PythonDomain.get_full_qualified_name` instead
899+ return node .get ('reftarget' , None )
900900
901901 def get_objects (self ) -> Iterable [_ObjectDescriptionTuple ]:
902902 yield from self .data ['commands' ]
@@ -910,7 +910,7 @@ def resolve_xref(
910910 target : str ,
911911 node : pending_xref ,
912912 contnode : Element ,
913- ) -> Element | None :
913+ ) -> nodes . reference | None :
914914 anchor_id = target_to_anchor_id (target )
915915 match = [
916916 (docname , anchor )
@@ -1016,8 +1016,12 @@ def setup(app: Sphinx):
10161016
10171017 app .add_config_value ('sphinxarg_build_commands_by_group_index' , False , 'html' , bool )
10181018 app .add_config_value ('sphinxarg_commands_by_group_index_in_toctree' , False , 'html' , bool )
1019- app .add_config_value ('sphinxarg_commands_by_group_index_file_suffix' , CommandsByGroupIndex .name , 'html' , str )
1020- app .add_config_value ('sphinxarg_commands_by_group_index_title' , CommandsByGroupIndex .localname , 'html' , str )
1019+ app .add_config_value (
1020+ 'sphinxarg_commands_by_group_index_file_suffix' , CommandsByGroupIndex .name , 'html' , str
1021+ )
1022+ app .add_config_value (
1023+ 'sphinxarg_commands_by_group_index_title' , CommandsByGroupIndex .localname , 'html' , str
1024+ )
10211025
10221026 app .connect ('builder-inited' , configure_ext )
10231027 app .connect ('build-finished' , _delete_temporary_files )
0 commit comments