code: func VisitWithTypeInfo(ttypeInfo typeInfo.TypeInfoI, visitorOpts *VisitorOptions) *VisitorOptions {
  	return &VisitorOptions{
  		Enter: func(p VisitFuncParams) (string, interface{}) {
  			if node, ok := p.Node.(ast.Node); ok {
  				ttypeInfo.Enter(node)
  				fn := GetVisitFn(visitorOpts, node.GetKind(), false)
  				if fn != nil {
  					action, result := fn(p)
  					if action == ActionUpdate {
  						ttypeInfo.Leave(node)
  						if isNode(result) {
  							if result, ok := result.(ast.Node); ok {
  								ttypeInfo.Enter(result)
  							}
  						}
  					}
  					return action, result
  				}
  			}
  			return ActionNoChange, nil
  		},
  		Leave: func(p VisitFuncParams) (string, interface{}) {
  			action := ActionNoChange
  			var result interface{}
  			if node, ok := p.Node.(ast.Node); ok {
  				fn := GetVisitFn(visitorOpts, node.GetKind(), true)
  				if fn != nil {
  					action, result = fn(p)
  				}
  				ttypeInfo.Leave(node)
  			}
  			return action, result
  		},
  	}
  }
docs: // VisitWithTypeInfo Creates a new visitor instance which maintains a provided TypeInfo instance
  // along with visiting visitor.