MCPcopy Create free account
hub / github.com/bufbuild/protocompile / generateSourceCodeInfoForService

Function generateSourceCodeInfoForService

sourceinfo/source_code_info.go:590–603  ·  view source on GitHub ↗
(opts OptionIndex, sci *sourceCodeInfo, n *ast.ServiceNode, path []int32)

Source from the content-addressed store, hash-verified

588}
589
590func generateSourceCodeInfoForService(opts OptionIndex, sci *sourceCodeInfo, n *ast.ServiceNode, path []int32) {
591 sci.newBlockLocWithComments(n, n.OpenBrace, path)
592 sci.newLoc(n.Name, append(path, internal.ServiceNameTag))
593 var optIndex, rpcIndex int32
594 for _, child := range n.Decls {
595 switch child := child.(type) {
596 case *ast.OptionNode:
597 generateSourceCodeInfoForOption(opts, sci, child, false, &optIndex, append(path, internal.ServiceOptionsTag))
598 case *ast.RPCNode:
599 generateSourceCodeInfoForMethod(opts, sci, child, append(path, internal.ServiceMethodsTag, rpcIndex))
600 rpcIndex++
601 }
602 }
603}
604
605func generateSourceCodeInfoForMethod(opts OptionIndex, sci *sourceCodeInfo, n *ast.RPCNode, path []int32) {
606 if n.OpenBrace != nil {

Callers 1

Calls 4

newLocMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…