(opts OptionIndex, sci *sourceCodeInfo, n *ast.RPCNode, path []int32)
| 603 | } |
| 604 | |
| 605 | func generateSourceCodeInfoForMethod(opts OptionIndex, sci *sourceCodeInfo, n *ast.RPCNode, path []int32) { |
| 606 | if n.OpenBrace != nil { |
| 607 | sci.newBlockLocWithComments(n, n.OpenBrace, path) |
| 608 | } else { |
| 609 | sci.newLocWithComments(n, path) |
| 610 | } |
| 611 | sci.newLoc(n.Name, append(path, internal.MethodNameTag)) |
| 612 | if n.Input.Stream != nil { |
| 613 | sci.newLoc(n.Input.Stream, append(path, internal.MethodInputStreamTag)) |
| 614 | } |
| 615 | sci.newLoc(n.Input.MessageType, append(path, internal.MethodInputTag)) |
| 616 | if n.Output.Stream != nil { |
| 617 | sci.newLoc(n.Output.Stream, append(path, internal.MethodOutputStreamTag)) |
| 618 | } |
| 619 | sci.newLoc(n.Output.MessageType, append(path, internal.MethodOutputTag)) |
| 620 | |
| 621 | optsPath := path |
| 622 | optsPath = append(optsPath, internal.MethodOptionsTag) |
| 623 | var optIndex int32 |
| 624 | for _, decl := range n.Decls { |
| 625 | if opt, ok := decl.(*ast.OptionNode); ok { |
| 626 | generateSourceCodeInfoForOption(opts, sci, opt, false, &optIndex, optsPath) |
| 627 | } |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | type sourceCodeInfo struct { |
| 632 | file *ast.FileNode |
no test coverage detected
searching dependent graphs…