Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code_review_graph/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,13 @@ def _get_name(self, node, language: str, kind: str) -> Optional[str]:
result = self._get_name(child, language, kind)
if result:
return result
# Go methods: tree-sitter-go uses field_identifier for the name
# (e.g. func (s *T) MethodName(...) { }). Must run before the generic
# loop, which would match the result type's type_identifier (e.g. int64).
if language == "go" and node.type == "method_declaration":
for child in node.children:
if child.type == "field_identifier":
return child.text.decode("utf-8", errors="replace")
# Most languages use a 'name' child
for child in node.children:
if child.type in (
Expand Down