You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of return types are captured as per my experiments from chapi.
I tried to do a experiment using tree sitter using this logic
def __get_return_type(self, tree) -> Optional[str]:
# Instead of manually navigating cursor, we can do a DFS using the tree's children.
root = tree.root_node
stack = [root]
while stack:
node = stack.pop()
if node.type == "function_definition":
# Check children for a 'type' node
for child in node.children:
if child.type == "type":
return child.text.decode('utf8').strip(": ")
# Push children into stack to continue traversal
for child in reversed(node.children):
stack.append(child)
return None
This works. do not know if issue is with Antlr or Chapi.
None of return types are captured as per my experiments from chapi.
I tried to do a experiment using tree sitter using this logic
This works. do not know if issue is with Antlr or Chapi.
Also if there is less time as of now we could complement this with tree sitter in https://github.com/unoplat/unoplat-code-confluence post this fix archguard/archguard#159. Thankyou
The text was updated successfully, but these errors were encountered: