forked from qt-creator/qt-creator
Ignore outdated semantic info.
This commit is contained in:
@@ -1256,6 +1256,11 @@ Symbol *CPPEditor::findDefinition(Symbol *symbol)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SemanticInfo CPPEditor::semanticInfo() const
|
||||||
|
{
|
||||||
|
return m_lastSemanticInfo;
|
||||||
|
}
|
||||||
|
|
||||||
bool CPPEditor::isElectricCharacter(const QChar &ch) const
|
bool CPPEditor::isElectricCharacter(const QChar &ch) const
|
||||||
{
|
{
|
||||||
if (ch == QLatin1Char('{') ||
|
if (ch == QLatin1Char('{') ||
|
||||||
@@ -1616,6 +1621,14 @@ void CPPEditor::semanticRehighlight()
|
|||||||
|
|
||||||
void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
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;
|
int line = 0, column = 0;
|
||||||
convertPosition(position(), &line, &column);
|
convertPosition(position(), &line, &column);
|
||||||
|
|
||||||
|
|||||||
@@ -181,11 +181,12 @@ public:
|
|||||||
|
|
||||||
CPPEditor(QWidget *parent);
|
CPPEditor(QWidget *parent);
|
||||||
~CPPEditor();
|
~CPPEditor();
|
||||||
|
|
||||||
void unCommentSelection();
|
void unCommentSelection();
|
||||||
|
|
||||||
void indentInsertedText(const QTextCursor &tc);
|
void indentInsertedText(const QTextCursor &tc);
|
||||||
|
|
||||||
|
SemanticInfo semanticInfo() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
virtual void setFontSettings(const TextEditor::FontSettings &);
|
virtual void setFontSettings(const TextEditor::FontSettings &);
|
||||||
virtual void setDisplaySettings(const TextEditor::DisplaySettings &);
|
virtual void setDisplaySettings(const TextEditor::DisplaySettings &);
|
||||||
@@ -302,6 +303,7 @@ private:
|
|||||||
bool m_inRename;
|
bool m_inRename;
|
||||||
|
|
||||||
SemanticHighlighter *m_semanticHighlighter;
|
SemanticHighlighter *m_semanticHighlighter;
|
||||||
|
SemanticInfo m_lastSemanticInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user