forked from qt-creator/qt-creator
Revert "Introduced our own document revision."
This reverts commit 6b510cb487.
This commit is contained in:
@@ -538,8 +538,6 @@ CPPEditor::CPPEditor(QWidget *parent)
|
||||
{
|
||||
qRegisterMetaType<SemanticInfo>("SemanticInfo");
|
||||
|
||||
m_revision = 0;
|
||||
|
||||
m_semanticHighlighter = new SemanticHighlighter(this);
|
||||
m_semanticHighlighter->start();
|
||||
|
||||
@@ -902,8 +900,6 @@ void CPPEditor::onContentsChanged(int position, int charsRemoved, int charsAdded
|
||||
Q_UNUSED(position)
|
||||
Q_UNUSED(charsAdded)
|
||||
|
||||
++m_revision;
|
||||
|
||||
if (m_currentRenameSelection == -1)
|
||||
return;
|
||||
|
||||
@@ -1311,11 +1307,6 @@ Symbol *CPPEditor::findDefinition(Symbol *symbol)
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned CPPEditor::revision() const
|
||||
{
|
||||
return m_revision;
|
||||
}
|
||||
|
||||
SemanticInfo CPPEditor::semanticInfo() const
|
||||
{
|
||||
return m_lastSemanticInfo;
|
||||
@@ -1780,7 +1771,7 @@ void CPPEditor::semanticRehighlight()
|
||||
|
||||
void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
{
|
||||
if (semanticInfo.revision != m_revision) {
|
||||
if (semanticInfo.revision != document()->revision()) {
|
||||
// got outdated semantic info
|
||||
semanticRehighlight();
|
||||
return;
|
||||
@@ -1824,10 +1815,10 @@ SemanticHighlighter::Source CPPEditor::currentSource()
|
||||
const QString fileName = file()->fileName();
|
||||
|
||||
QString code;
|
||||
if (m_lastSemanticInfo.revision != m_revision)
|
||||
if (m_lastSemanticInfo.revision != document()->revision())
|
||||
code = toPlainText(); // get the source code only when needed.
|
||||
|
||||
const int revision = m_revision;
|
||||
const int revision = document()->revision();
|
||||
const SemanticHighlighter::Source source(snapshot, fileName, code,
|
||||
line, column, revision);
|
||||
return source;
|
||||
|
||||
Reference in New Issue
Block a user