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
12 changes: 9 additions & 3 deletions sourcecode-parser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,17 @@ func extractMethodName(node *sitter.Node, sourceCode []byte) string {
child := node.Child(i)

// Check if the child node is an identifier (method name)
// fmt.Print(child.Type() + " - ")
fmt.Print(child.Content(sourceCode) + "\n")
if child.Type() == "identifier" {
methodName = string(child.Content(sourceCode)) // Convert the byte array to string
break
// parse full method name
methodName = child.Content(sourceCode)
for j := i + 1; j < int(node.ChildCount()); j++ {
child = node.Child(j)
if child.Type() == "identifier" {
methodName += "." + child.Content(sourceCode)
}
}
break;
}

// Recursively call this function if the child is 'method_declaration' or 'method_invocation'
Expand Down