func (def *ScannedDef) GenerateCommentScope() string {
	if def.Scope == "" {
		return "main"
	}
	return strings.ReplaceAll(def.Scope, "\n", "")
}
GenerateCommentScope returns the scope as it should be printed in the generated comments.
package dingo
import (
	"encoding/json"
	"reflect"
	"sort"
	"strconv"
	"strings"
)
type Scan struct {
	TypeManager          *TypeManager
	ImportsWithoutParams map[string]string
	Defs                 []*ScannedDef
	ProviderPackage      string
	ProviderName         string
}
type ScannedDef struct {
	Def              *Def
	Name             string
	FormattedName    string
	Scope            string
	ObjectType       reflect.Type
	ObjectTypeString string
	BuildIsFunc      bool
	BuildTypeString  string
	Params           map[string]*ParamInfo
	CloseTypeString  string
	Unshared         bool
}
func (def *ScannedDef) ParamsString() string {
	if def.BuildIsFunc {
		params := make([]string, len(def.Params))
		for i := 0; i < len(def.Params); i++ {
			params[i] = "p" + strconv.Itoa(i)
		}
		return strings.Join(params, ", ")
	}
	params := ""
	for _, param := range def.Params {
		params += param.Name + `: p` + param.Index + ",\n"
	}
	return params
}
func (def *ScannedDef) BuildDependsOnRawDef() bool {
	if def.BuildIsFunc {
		return true
	}
	for _, param := range def.Params {
		if param.ServiceName == "" && !param.UndefinedStructParam {
			return true
		}
	}
	return false
}