mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-22 15:05:26 +00:00
Added check to see if parameter was a local object, if so parse it
This commit is contained in:
@@ -456,10 +456,13 @@ func appendAction(fset *token.FileSet, mm methodMap, decl ast.Decl, pkgImportPat
|
|||||||
revel.RevelLog.Warnf("Didn't understand argument '%s' of action %s. Ignoring.", name, getFuncName(funcDecl))
|
revel.RevelLog.Warnf("Didn't understand argument '%s' of action %s. Ignoring.", name, getFuncName(funcDecl))
|
||||||
return // We didn't understand one of the args. Ignore this action.
|
return // We didn't understand one of the args. Ignore this action.
|
||||||
}
|
}
|
||||||
if typeExpr.PkgName != "" {
|
// Local object
|
||||||
|
if typeExpr.PkgName == pkgName {
|
||||||
|
importPath = pkgImportPath
|
||||||
|
} else if typeExpr.PkgName != "" {
|
||||||
var ok bool
|
var ok bool
|
||||||
if importPath, ok = imports[typeExpr.PkgName]; !ok {
|
if importPath, ok = imports[typeExpr.PkgName]; !ok {
|
||||||
revel.RevelLog.Errorf("Failed to find import for arg of type:", typeExpr.TypeName(""))
|
revel.RevelLog.Errorf("Failed to find import for arg of type: %s , %s",typeExpr.PkgName, typeExpr.TypeName(""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
method.Args = append(method.Args, &MethodArg{
|
method.Args = append(method.Args, &MethodArg{
|
||||||
|
|||||||
Reference in New Issue
Block a user