mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C++, do not add index entries for decls in concepts
This commit is contained in:
parent
d9006ef5b2
commit
809388d836
3
CHANGES
3
CHANGES
@ -86,7 +86,8 @@ Bugs fixed
|
|||||||
* #3882: Update the order of files for HTMLHelp and QTHelp
|
* #3882: Update the order of files for HTMLHelp and QTHelp
|
||||||
* #3962: sphinx-apidoc does not recognize implicit namespace packages correctly
|
* #3962: sphinx-apidoc does not recognize implicit namespace packages correctly
|
||||||
* #4094: C++, allow empty template argument lists.
|
* #4094: C++, allow empty template argument lists.
|
||||||
* C++: also hyperlink types in the name of declarations with qualified names.
|
* C++, also hyperlink types in the name of declarations with qualified names.
|
||||||
|
* C++, do not add index entries for declarations inside concepts.
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -5474,13 +5474,25 @@ class CPPObject(ObjectDescription):
|
|||||||
'report as bug (id=%s).' % (text_type(ast), newestId))
|
'report as bug (id=%s).' % (text_type(ast), newestId))
|
||||||
|
|
||||||
name = text_type(ast.symbol.get_full_nested_name()).lstrip(':')
|
name = text_type(ast.symbol.get_full_nested_name()).lstrip(':')
|
||||||
strippedName = name
|
# Add index entry, but not if it's a declaration inside a concept
|
||||||
for prefix in self.env.config.cpp_index_common_prefix:
|
isInConcept = False
|
||||||
if name.startswith(prefix):
|
s = ast.symbol.parent
|
||||||
strippedName = strippedName[len(prefix):]
|
while s is not None:
|
||||||
|
decl = s.declaration
|
||||||
|
s = s.parent
|
||||||
|
if decl is None:
|
||||||
|
continue
|
||||||
|
if decl.objectType == 'concept':
|
||||||
|
isInConcept = True
|
||||||
break
|
break
|
||||||
indexText = self.get_index_text(strippedName)
|
if not isInConcept:
|
||||||
self.indexnode['entries'].append(('single', indexText, newestId, '', None))
|
strippedName = name
|
||||||
|
for prefix in self.env.config.cpp_index_common_prefix:
|
||||||
|
if name.startswith(prefix):
|
||||||
|
strippedName = strippedName[len(prefix):]
|
||||||
|
break
|
||||||
|
indexText = self.get_index_text(strippedName)
|
||||||
|
self.indexnode['entries'].append(('single', indexText, newestId, '', None))
|
||||||
|
|
||||||
if newestId not in self.state.document.ids:
|
if newestId not in self.state.document.ids:
|
||||||
# if the name is not unique, the first one will win
|
# if the name is not unique, the first one will win
|
||||||
|
Loading…
Reference in New Issue
Block a user