in Sources/MockoloFramework/Parsers/SwiftSyntaxExtensions.swift [500:531]
func model(inInit: Bool, declType: DeclType) -> ParamModel {
var label = ""
var name = ""
// Get label and name of args
let first = self.firstName.text
if let second = self.secondName?.text {
label = first
name = second
} else {
if first == "_" {
label = first
name = first + "arg"
} else {
name = first
}
}
// Variadic args are not detected in the parser so need to manually look up
var type = self.type.description
if self.description.contains(type + "...") {
type.append("...")
}
return ParamModel(label: label,
name: name,
typeName: type,
isGeneric: false,
inInit: inInit,
needVarDecl: declType == .protocolType,
offset: self.offset,
length: self.length)
}