def handle_signature(self, sig, signode):
print("looking for: " + sig)
cache = _APP_CACHES.get(self.env.app, {})
key = CursorKind.FUNCTION_DECL, (sig, )
if key in cache:
print("KEY FOunD!")
node, comment, start, end, _ = cache[key]
result_type = node.type.get_result()
signode += addnodes.desc_type(result_type.spelling, result_type.spelling + ' ')
signode += addnodes.desc_name(node.spelling, node.spelling)
paramlist = addnodes.desc_parameterlist()
for argument in node.get_arguments():
parameter = addnodes.desc_parameter()
parameter += addnodes.desc_type(argument.type.spelling, argument.type.spelling + ' ')
parameter += nodes.Text(argument.spelling, argument.spelling)
paramlist += parameter
signode += paramlist
self.content = ViewList()
comment = ''.join(comment)
for lineno, line in enumerate(comment.splitlines(), start[0]):
self.content.append(line, '<unknown>', lineno)
return sig
评论列表
文章目录