forked from qt-creator/qt-creator
Renamed QmlJS::Document::documentRevision().
This commit is contained in:
@@ -45,7 +45,7 @@ Document::Document(const QString &fileName)
|
|||||||
, _ast(0)
|
, _ast(0)
|
||||||
, _bind(0)
|
, _bind(0)
|
||||||
, _isQmlDocument(false)
|
, _isQmlDocument(false)
|
||||||
, _documentRevision(0)
|
, _editorRevision(0)
|
||||||
, _parsedCorrectly(false)
|
, _parsedCorrectly(false)
|
||||||
, _fileName(QDir::cleanPath(fileName))
|
, _fileName(QDir::cleanPath(fileName))
|
||||||
{
|
{
|
||||||
@@ -133,14 +133,14 @@ void Document::setSource(const QString &source)
|
|||||||
_source = source;
|
_source = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Document::documentRevision() const
|
int Document::editorRevision() const
|
||||||
{
|
{
|
||||||
return _documentRevision;
|
return _editorRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::setDocumentRevision(int revision)
|
void Document::setEditorRevision(int revision)
|
||||||
{
|
{
|
||||||
_documentRevision = revision;
|
_editorRevision = revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Document::fileName() const
|
QString Document::fileName() const
|
||||||
@@ -364,7 +364,7 @@ Document::Ptr Snapshot::documentFromSource(const QString &code,
|
|||||||
Document::Ptr newDoc = Document::create(fileName);
|
Document::Ptr newDoc = Document::create(fileName);
|
||||||
|
|
||||||
if (Document::Ptr thisDocument = document(fileName)) {
|
if (Document::Ptr thisDocument = document(fileName)) {
|
||||||
newDoc->_documentRevision = thisDocument->_documentRevision;
|
newDoc->_editorRevision = thisDocument->_editorRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
newDoc->setSource(code);
|
newDoc->setSource(code);
|
||||||
|
@@ -84,8 +84,8 @@ public:
|
|||||||
|
|
||||||
Bind *bind() const;
|
Bind *bind() const;
|
||||||
|
|
||||||
int documentRevision() const;
|
int editorRevision() const;
|
||||||
void setDocumentRevision(int documentRevision);
|
void setEditorRevision(int revision);
|
||||||
|
|
||||||
QString fileName() const;
|
QString fileName() const;
|
||||||
QString path() const;
|
QString path() const;
|
||||||
@@ -101,7 +101,7 @@ private:
|
|||||||
AST::Node *_ast;
|
AST::Node *_ast;
|
||||||
Bind *_bind;
|
Bind *_bind;
|
||||||
bool _isQmlDocument;
|
bool _isQmlDocument;
|
||||||
int _documentRevision;
|
int _editorRevision;
|
||||||
bool _parsedCorrectly;
|
bool _parsedCorrectly;
|
||||||
QList<QmlJS::DiagnosticMessage> _diagnosticMessages;
|
QList<QmlJS::DiagnosticMessage> _diagnosticMessages;
|
||||||
QString _fileName;
|
QString _fileName;
|
||||||
|
@@ -558,7 +558,7 @@ AST::Node *SemanticInfo::nodeUnderCursor(int pos) const
|
|||||||
int SemanticInfo::revision() const
|
int SemanticInfo::revision() const
|
||||||
{
|
{
|
||||||
if (document)
|
if (document)
|
||||||
return document->documentRevision();
|
return document->editorRevision();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -767,7 +767,7 @@ static void appendExtraSelectionsForMessages(
|
|||||||
void QmlJSTextEditor::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
void QmlJSTextEditor::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
||||||
{
|
{
|
||||||
if (file()->fileName() != doc->fileName()
|
if (file()->fileName() != doc->fileName()
|
||||||
|| doc->documentRevision() != document()->revision()) {
|
|| doc->editorRevision() != document()->revision()) {
|
||||||
// didn't get the currently open, or an up to date document.
|
// didn't get the currently open, or an up to date document.
|
||||||
// trigger a semantic rehighlight anyway, after a time
|
// trigger a semantic rehighlight anyway, after a time
|
||||||
m_semanticRehighlightTimer->start();
|
m_semanticRehighlightTimer->start();
|
||||||
@@ -1468,7 +1468,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
|
|||||||
if (! doc) {
|
if (! doc) {
|
||||||
snapshot = source.snapshot;
|
snapshot = source.snapshot;
|
||||||
doc = snapshot.documentFromSource(source.code, source.fileName);
|
doc = snapshot.documentFromSource(source.code, source.fileName);
|
||||||
doc->setDocumentRevision(source.revision);
|
doc->setEditorRevision(source.revision);
|
||||||
doc->parse();
|
doc->parse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -384,7 +384,7 @@ void ModelManager::parse(QFutureInterface<void> &future,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Document::Ptr doc = Document::create(fileName);
|
Document::Ptr doc = Document::create(fileName);
|
||||||
doc->setDocumentRevision(documentRevision);
|
doc->setEditorRevision(documentRevision);
|
||||||
doc->setSource(contents);
|
doc->setSource(contents);
|
||||||
doc->parse();
|
doc->parse();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user