From: Vladimír Vondruš Date: Sat, 12 Jan 2019 15:21:11 +0000 (+0100) Subject: doxygen: adapt to function declaration location updates in Doxygen master. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=6d1771afa674a18252c9b28eca39121cafab00b3;p=blog.git doxygen: adapt to function declaration location updates in Doxygen --- diff --git a/doc/doxygen.rst b/doc/doxygen.rst index 78e950cb..085ea2d2 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -708,8 +708,9 @@ all :cpp:`#include`-related information: .. note-warning:: Doxygen patches Current stable Doxygen release (1.8.15) doesn't correctly provide location - information for function and variable declarations. A fix is submitted in - :gh:`doxygen/doxygen#6722`, which is not integrated yet. + information for function and variable declarations. A fix is present since + :gh:`doxygen/doxygen@7f40e488e27bcea4bb15045df05479dc5fbd9d6d` (formerly + :gh:`doxygen/doxygen#6722`). `Code highlighting`_ -------------------- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index ba290a3f..733c212e 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -477,7 +477,8 @@ def parse_id_and_include(state: State, element: ET.Element) -> Tuple[str, str, s # or a module include = None if state.current_kind in ['namespace', 'group']: - file = element.find('location').attrib['file'] + location_attribs = element.find('location').attrib + file = location_attribs['declfile'] if 'declfile' in location_attribs else location_attribs['file'] include = make_include(state, file) # If the include for current namespace is not yet set (empty string) @@ -2437,7 +2438,8 @@ def parse_xml(state: State, xml: str): # namespaces without any members too. state.current_kind = compound.kind if compound.kind in ['struct', 'class', 'union'] or (compound.kind == 'namespace' and compounddef.find('innerclass') is None and compounddef.find('innernamespace') is None and compounddef.find('sectiondef') is None): - file = compounddef.find('location').attrib['file'] + location_attribs = compounddef.find('location').attrib + file = location_attribs['declfile'] if 'declfile' in location_attribs else location_attribs['file'] compound.include = make_include(state, file) # Save include for current compound. Every enum/var/function/... parser