Commit 3ae971be authored by Roberto Raggi's avatar Roberto Raggi

Don't look at the whole project. We're only interested in the symbols that we...

Don't look at the whole project. We're only interested in the symbols that we can resolve in the current file.
parent bd96ebf7
......@@ -416,8 +416,11 @@ void CPPEditor::updateMethodBoxIndex()
const QString expression = expressionUnderCursor(tc);
//qDebug() << "expression:" << expression;
Snapshot snapshot;
snapshot.insert(thisDocument->fileName(), thisDocument);
TypeOfExpression typeOfExpression;
typeOfExpression.setSnapshot(m_modelManager->snapshot());
typeOfExpression.setSnapshot(snapshot);
const QList<TypeOfExpression::Result> results =
typeOfExpression(expression, thisDocument, symbol, TypeOfExpression::Preprocess);
......@@ -439,6 +442,19 @@ void CPPEditor::updateMethodBoxIndex()
QTextCursor c(document()->findBlockByNumber(symbol->line() - 1));
c.setPosition(c.position() + column);
const QString text = c.block().text();
int i = column;
for (; i < text.length(); ++i) {
const QChar &ch = text.at(i);
if (ch == QLatin1Char('*') || ch == QLatin1Char('&'))
c.movePosition(QTextCursor::NextCharacter);
else
break;
}
c.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
QTextEdit::ExtraSelection sel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment