mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6432 from tk0miya/missing_location_on_duplicated_warning
Fix py domain: duplicated warning does not point the location of source code
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -16,6 +16,8 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* py domain: duplicated warning does not point the location of source code
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
||||
@@ -337,7 +337,8 @@ class PyObject(ObjectDescription):
|
||||
self.state.document.note_explicit_target(signode)
|
||||
|
||||
domain = cast(PythonDomain, self.env.get_domain('py'))
|
||||
domain.note_object(fullname, self.objtype)
|
||||
domain.note_object(fullname, self.objtype,
|
||||
location=(self.env.docname, self.lineno))
|
||||
|
||||
indextext = self.get_index_text(modname, name_cls)
|
||||
if indextext:
|
||||
@@ -752,7 +753,7 @@ class PyModule(SphinxDirective):
|
||||
self.options.get('synopsis', ''),
|
||||
self.options.get('platform', ''),
|
||||
'deprecated' in self.options)
|
||||
domain.note_object(modname, 'module')
|
||||
domain.note_object(modname, 'module', location=(self.env.docname, self.lineno))
|
||||
|
||||
targetnode = nodes.target('', '', ids=['module-' + modname],
|
||||
ismod=True)
|
||||
|
||||
Reference in New Issue
Block a user