forked from qt-creator/qt-creator
CppTools: Remove invalid optimization for highlighting
The optimization in question could lead to an empty source and thus to no highlighting. Checking for 'force' and the revisions is at this point not enough since later the semantic info calculcation can be aborted, so that a subsequent recalculation would get an empty document. contents() itself is already optimized (uses caching). Task-number: QTCREATORBUG-11367 Change-Id: If31a8ab0c848e4babd38104961fb9812f077a2be Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Erik Verbruggen
parent
e7904caf0b
commit
291b80cb33
@@ -518,13 +518,8 @@ SemanticInfo::Source CppEditorSupport::currentSource(bool force)
|
||||
int line = 0, column = 0;
|
||||
m_textEditor->convertPosition(m_textEditor->editorWidget()->position(), &line, &column);
|
||||
|
||||
QByteArray code;
|
||||
if (force || m_lastSemanticInfo.revision != editorRevision())
|
||||
code = contents(); // get the source code only when needed.
|
||||
|
||||
const unsigned revision = editorRevision();
|
||||
SemanticInfo::Source source(Snapshot(), fileName(), code, line, column, revision, force);
|
||||
return source;
|
||||
return SemanticInfo::Source(Snapshot(), fileName(), contents(), line, column, editorRevision(),
|
||||
force);
|
||||
}
|
||||
|
||||
void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
|
||||
|
||||
Reference in New Issue
Block a user