Ignore outdated semantic info.

This commit is contained in:
Roberto Raggi
2009-07-10 12:09:26 +02:00
parent fd4dbd7446
commit 8f6956e6ec
2 changed files with 16 additions and 1 deletions

View File

@@ -1256,6 +1256,11 @@ Symbol *CPPEditor::findDefinition(Symbol *symbol)
return 0;
}
SemanticInfo CPPEditor::semanticInfo() const
{
return m_lastSemanticInfo;
}
bool CPPEditor::isElectricCharacter(const QChar &ch) const
{
if (ch == QLatin1Char('{') ||
@@ -1616,6 +1621,14 @@ void CPPEditor::semanticRehighlight()
void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
{
if (semanticInfo.revision != document()->revision()) {
// got outdated semantic info
semanticRehighlight();
return;
}
m_lastSemanticInfo = semanticInfo;
int line = 0, column = 0;
convertPosition(position(), &line, &column);