summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodecompletion.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-09-29 12:46:42 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2009-09-29 12:47:03 +0200
commit6b4db9e674a3a29a0ba2536cc9f87bf2ced3be4c (patch)
tree6560000fcdcbf46b79b165f45681685d1c057614 /src/plugins/cpptools/cppcodecompletion.cpp
parent0ed9043c343e537c9606fc298e8fddbfbe849899 (diff)
downloadqt-creator-6b4db9e674a3a29a0ba2536cc9f87bf2ced3be4c.tar.gz
Handle ctor-initializers in the LookupContext.
Diffstat (limited to 'src/plugins/cpptools/cppcodecompletion.cpp')
-rw-r--r--src/plugins/cpptools/cppcodecompletion.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp
index 63a4d4c6cc..bc1d1d4ad7 100644
--- a/src/plugins/cpptools/cppcodecompletion.cpp
+++ b/src/plugins/cpptools/cppcodecompletion.cpp
@@ -817,11 +817,10 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
const Snapshot snapshot = m_manager->snapshot();
if (Document::Ptr thisDocument = snapshot.value(fileName)) {
- Symbol *symbol = thisDocument->findSymbolAt(line, column);
-
+ Symbol *lastVisibleSymbol = thisDocument->findSymbolAt(line, column);
typeOfExpression.setSnapshot(m_manager->snapshot());
- QList<TypeOfExpression::Result> resolvedTypes = typeOfExpression(expression, thisDocument, symbol,
+ QList<TypeOfExpression::Result> resolvedTypes = typeOfExpression(expression, thisDocument, lastVisibleSymbol,
TypeOfExpression::Preprocess);
LookupContext context = typeOfExpression.lookupContext();
@@ -847,7 +846,7 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
m_completionOperator == T_SLOT)) {
// Apply signal/slot completion on 'this'
expression = QLatin1String("this");
- resolvedTypes = typeOfExpression(expression, thisDocument, symbol);
+ resolvedTypes = typeOfExpression(expression, thisDocument, lastVisibleSymbol);
context = typeOfExpression.lookupContext();
}
@@ -883,7 +882,7 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
// Resolve the type of this expression
QList<TypeOfExpression::Result> results =
- typeOfExpression(baseExpression, thisDocument, symbol, TypeOfExpression::Preprocess);
+ typeOfExpression(baseExpression, thisDocument, lastVisibleSymbol, TypeOfExpression::Preprocess);
// If it's a class, add completions for the constructors
foreach (const TypeOfExpression::Result &result, results) {