Changeset View
Changeset View
Standalone View
Standalone View
duchain/helper.cpp
Context not available. | |||||
424 | } | 424 | } | ||
---|---|---|---|---|---|
425 | } | 425 | } | ||
426 | 426 | | |||
427 | AbstractType::Ptr parameterTypehint(const ParameterTypeAst* parameterType, EditorIntegrator *editor, DUContext* currentContext) | 427 | template <class T> | ||
428 | AbstractType::Ptr determineTypehint(const T* parameterType, EditorIntegrator *editor, DUContext* currentContext) | ||||
428 | { | 429 | { | ||
429 | Q_ASSERT(parameterType); | 430 | Q_ASSERT(parameterType); | ||
430 | AbstractType::Ptr type; | 431 | AbstractType::Ptr type; | ||
Context not available. | |||||
480 | { | 481 | { | ||
481 | AbstractType::Ptr type; | 482 | AbstractType::Ptr type; | ||
482 | if (node->parameterType) { | 483 | if (node->parameterType) { | ||
483 | type = parameterTypehint(node->parameterType, editor, currentContext); | 484 | type = determineTypehint(node->parameterType, editor, currentContext); | ||
484 | } else if (node->defaultValue) { | 485 | } else if (node->defaultValue) { | ||
485 | ExpressionVisitor v(editor); | 486 | ExpressionVisitor v(editor); | ||
486 | node->defaultValue->ducontext = currentContext; | 487 | node->defaultValue->ducontext = currentContext; | ||
Context not available. | |||||
514 | return type; | 515 | return type; | ||
515 | } | 516 | } | ||
516 | 517 | | |||
518 | AbstractType::Ptr returnType(const ReturnTypeAst* node, AbstractType::Ptr phpDocTypehint, EditorIntegrator* editor, DUContext* currentContext) { | ||||
519 | AbstractType::Ptr type; | ||||
520 | if (node) { | ||||
521 | if (node->voidType != -1) { | ||||
522 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeVoid)); | ||||
523 | } else { | ||||
524 | type = determineTypehint(node, editor, currentContext); | ||||
525 | } | ||||
526 | } | ||||
527 | if (!type) { | ||||
528 | type = phpDocTypehint; | ||||
529 | } | ||||
530 | return type; | ||||
531 | } | ||||
532 | | ||||
517 | } | 533 | } | ||
Context not available. |