summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Lykke Andersen <Jakob@caput.dk>2020-10-03 15:20:41 +0200
committerJakob Lykke Andersen <Jakob@caput.dk>2020-10-03 15:20:41 +0200
commit6f5d45ffff68c2c1892f1a29af0ea1bd5e4e4796 (patch)
tree513ee74938e8b1b95c8978b3623d6ba5a9269349
parent94ce18205dd5a3d068cda4fd7902ff5a8f230e98 (diff)
downloadsphinx-git-6f5d45ffff68c2c1892f1a29af0ea1bd5e4e4796.tar.gz
C++, improve warning and debug messages
-rw-r--r--sphinx/domains/cpp.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index 7b10f8166..e5a6201e5 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -4107,7 +4107,7 @@ class Symbol:
Symbol.debug_print("self:")
print(self.to_string(Symbol.debug_indent + 1), end="")
Symbol.debug_print("nestedName: ", nestedName)
- Symbol.debug_print("templateDecls: ", templateDecls)
+ Symbol.debug_print("templateDecls: ", ",".join(str(t) for t in templateDecls))
Symbol.debug_print("strictTemplateParamArgLists:", strictTemplateParamArgLists)
Symbol.debug_print("ancestorLookupType:", ancestorLookupType)
Symbol.debug_print("templateShorthand: ", templateShorthand)
@@ -4231,7 +4231,7 @@ class Symbol:
Symbol.debug_indent += 1
Symbol.debug_print("_add_symbols:")
Symbol.debug_indent += 1
- Symbol.debug_print("tdecls:", templateDecls)
+ Symbol.debug_print("tdecls:", ",".join(str(t) for t in templateDecls))
Symbol.debug_print("nn: ", nestedName)
Symbol.debug_print("decl: ", declaration)
Symbol.debug_print("doc: ", docname)
@@ -4370,7 +4370,11 @@ class Symbol:
# if there is an empty symbol, fill that one
if len(noDecl) == 0:
if Symbol.debug_lookup:
- Symbol.debug_print("no match, no empty, candSybmol is not None?:", candSymbol is not None) # NOQA
+ Symbol.debug_print("no match, no empty")
+ if candSymbol is not None:
+ Symbol.debug_print("result is already created candSymbol")
+ else:
+ Symbol.debug_print("result is makeCandSymbol()")
Symbol.debug_indent -= 2
if candSymbol is not None:
return candSymbol
@@ -6814,10 +6818,12 @@ class CPPObject(ObjectDescription):
parentSymbol = env.temp_data['cpp:parent_symbol']
parentDecl = parentSymbol.declaration
if parentDecl is not None and parentDecl.objectType == 'function':
- logger.warning("C++ declarations inside functions are not supported." +
- " Parent function is " +
- str(parentSymbol.get_full_nested_name()),
- location=self.get_source_info())
+ msg = "C++ declarations inside functions are not supported." \
+ " Parent function: {}\nDirective name: {}\nDirective arg: {}"
+ logger.warning(msg.format(
+ str(parentSymbol.get_full_nested_name()),
+ self.name, self.arguments[0]
+ ), location=self.get_source_info())
name = _make_phony_error_name()
symbol = parentSymbol.add_name(name)
env.temp_data['cpp:last_symbol'] = symbol