diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 909ae011fe7..b27bfcf7af2 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -871,7 +871,7 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) if (! resolvedTypes.isEmpty()) { if (m_completionOperator == T_LPAREN && - completeConstructorOrFunction(resolvedTypes, context, endOfExpression)) { + completeConstructorOrFunction(resolvedTypes, context, endOfExpression, false)) { return m_startPosition; } else if ((m_completionOperator == T_DOT || m_completionOperator == T_ARROW) && @@ -910,7 +910,7 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) // If it's a class, add completions for the constructors foreach (const TypeOfExpression::Result &result, results) { if (result.first->isClassType()) { - if (completeConstructorOrFunction(results, context, endOfExpression)) + if (completeConstructorOrFunction(results, context, endOfExpression, true)) return m_startPosition; break; } @@ -924,7 +924,7 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) bool CppCodeCompletion::completeConstructorOrFunction(const QList &results, const LookupContext &context, - int endOfExpression) + int endOfExpression, bool toolTipOnly) { QList functions; @@ -1013,15 +1013,17 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList(m_editor->widget()); @@ -1043,16 +1045,16 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QListtranslationUnit()->getPosition(sc->owner()->endOffset(), &endLine, &endColumn); - if (startLine <= line && line <= endLine) + if (startLine <= line && line <= endLine) { if ((startLine != line || startColumn <= column) && (endLine != line || column <= endColumn)) break; + } sc = sc->enclosingScope(); } - if (sc && (sc->isClassScope() || sc->isNamespaceScope())) - { + if (sc && (sc->isClassScope() || sc->isNamespaceScope())) { // It may still be a function call. If the whole line parses as a function // declaration, we should be certain that it isn't. bool autocompleteSignature = false; @@ -1091,7 +1093,9 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList &, const CPlusPlus::LookupContext &, - int endOfExpression); + int endOfExpression, bool toolTipOnly); bool completeMember(const QList &, const CPlusPlus::LookupContext &context);