forked from qt-creator/qt-creator
Don't look at the whole project. We're only interested in the symbols that we can resolve in the current file.
This commit is contained in:
@@ -416,8 +416,11 @@ void CPPEditor::updateMethodBoxIndex()
|
|||||||
const QString expression = expressionUnderCursor(tc);
|
const QString expression = expressionUnderCursor(tc);
|
||||||
//qDebug() << "expression:" << expression;
|
//qDebug() << "expression:" << expression;
|
||||||
|
|
||||||
|
Snapshot snapshot;
|
||||||
|
snapshot.insert(thisDocument->fileName(), thisDocument);
|
||||||
|
|
||||||
TypeOfExpression typeOfExpression;
|
TypeOfExpression typeOfExpression;
|
||||||
typeOfExpression.setSnapshot(m_modelManager->snapshot());
|
typeOfExpression.setSnapshot(snapshot);
|
||||||
|
|
||||||
const QList<TypeOfExpression::Result> results =
|
const QList<TypeOfExpression::Result> results =
|
||||||
typeOfExpression(expression, thisDocument, symbol, TypeOfExpression::Preprocess);
|
typeOfExpression(expression, thisDocument, symbol, TypeOfExpression::Preprocess);
|
||||||
@@ -439,6 +442,19 @@ void CPPEditor::updateMethodBoxIndex()
|
|||||||
|
|
||||||
QTextCursor c(document()->findBlockByNumber(symbol->line() - 1));
|
QTextCursor c(document()->findBlockByNumber(symbol->line() - 1));
|
||||||
c.setPosition(c.position() + column);
|
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);
|
c.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
|
||||||
|
|
||||||
QTextEdit::ExtraSelection sel;
|
QTextEdit::ExtraSelection sel;
|
||||||
|
|||||||
Reference in New Issue
Block a user