mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C++, fix missing scope info on some declarations.
See sphinx-doc/sphinx#2607
This commit is contained in:
parent
ecd2ca10d5
commit
49957210d5
@ -3800,6 +3800,15 @@ class CPPObject(ObjectDescription):
|
||||
self.describe_signature(signode, ast)
|
||||
return ast
|
||||
|
||||
def before_content(self):
|
||||
lastSymbol = self.env.ref_context['cpp:last_symbol']
|
||||
assert lastSymbol
|
||||
self.oldParentSymbol = self.env.ref_context['cpp:parent_symbol']
|
||||
self.env.ref_context['cpp:parent_symbol'] = lastSymbol
|
||||
|
||||
def after_content(self):
|
||||
self.env.ref_context['cpp:parent_symbol'] = self.oldParentSymbol
|
||||
|
||||
|
||||
class CPPTypeObject(CPPObject):
|
||||
def get_index_text(self, name):
|
||||
@ -3838,15 +3847,6 @@ class CPPClassObject(CPPObject):
|
||||
def get_index_text(self, name):
|
||||
return _('%s (C++ class)') % name
|
||||
|
||||
def before_content(self):
|
||||
lastSymbol = self.env.ref_context['cpp:last_symbol']
|
||||
assert lastSymbol
|
||||
self.oldParentSymbol = self.env.ref_context['cpp:parent_symbol']
|
||||
self.env.ref_context['cpp:parent_symbol'] = lastSymbol
|
||||
|
||||
def after_content(self):
|
||||
self.env.ref_context['cpp:parent_symbol'] = self.oldParentSymbol
|
||||
|
||||
def parse_definition(self, parser):
|
||||
return parser.parse_declaration("class")
|
||||
|
||||
@ -3858,15 +3858,6 @@ class CPPEnumObject(CPPObject):
|
||||
def get_index_text(self, name):
|
||||
return _('%s (C++ enum)') % name
|
||||
|
||||
def before_content(self):
|
||||
lastSymbol = self.env.ref_context['cpp:last_symbol']
|
||||
assert lastSymbol
|
||||
self.oldParentSymbol = self.env.ref_context['cpp:parent_symbol']
|
||||
self.env.ref_context['cpp:parent_symbol'] = lastSymbol
|
||||
|
||||
def after_content(self):
|
||||
self.env.ref_context['cpp:parent_symbol'] = self.oldParentSymbol
|
||||
|
||||
def parse_definition(self, parser):
|
||||
ast = parser.parse_declaration("enum")
|
||||
# self.objtype is set by ObjectDescription in run()
|
||||
|
Loading…
Reference in New Issue
Block a user