Commit ef5aaa03 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Renamed QmlJS::Document::documentRevision().

parent d532180b
......@@ -45,7 +45,7 @@ Document::Document(const QString &fileName)
, _ast(0)
, _bind(0)
, _isQmlDocument(false)
, _documentRevision(0)
, _editorRevision(0)
, _parsedCorrectly(false)
, _fileName(QDir::cleanPath(fileName))
{
......@@ -133,14 +133,14 @@ void Document::setSource(const QString &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
......@@ -364,7 +364,7 @@ Document::Ptr Snapshot::documentFromSource(const QString &code,
Document::Ptr newDoc = Document::create(fileName);
if (Document::Ptr thisDocument = document(fileName)) {
newDoc->_documentRevision = thisDocument->_documentRevision;
newDoc->_editorRevision = thisDocument->_editorRevision;
}
newDoc->setSource(code);
......
......@@ -84,8 +84,8 @@ public:
Bind *bind() const;
int documentRevision() const;
void setDocumentRevision(int documentRevision);
int editorRevision() const;
void setEditorRevision(int revision);
QString fileName() const;
QString path() const;
......@@ -101,7 +101,7 @@ private:
AST::Node *_ast;
Bind *_bind;
bool _isQmlDocument;
int _documentRevision;
int _editorRevision;
bool _parsedCorrectly;
QList<QmlJS::DiagnosticMessage> _diagnosticMessages;
QString _fileName;
......
......@@ -558,7 +558,7 @@ AST::Node *SemanticInfo::nodeUnderCursor(int pos) const
int SemanticInfo::revision() const
{
if (document)
return document->documentRevision();
return document->editorRevision();
return 0;
}
......@@ -767,7 +767,7 @@ static void appendExtraSelectionsForMessages(
void QmlJSTextEditor::onDocumentUpdated(QmlJS::Document::Ptr doc)
{
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.
// trigger a semantic rehighlight anyway, after a time
m_semanticRehighlightTimer->start();
......@@ -1468,7 +1468,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
if (! doc) {
snapshot = source.snapshot;
doc = snapshot.documentFromSource(source.code, source.fileName);
doc->setDocumentRevision(source.revision);
doc->setEditorRevision(source.revision);
doc->parse();
}
......
......@@ -384,7 +384,7 @@ void ModelManager::parse(QFutureInterface<void> &future,
}
Document::Ptr doc = Document::create(fileName);
doc->setDocumentRevision(documentRevision);
doc->setEditorRevision(documentRevision);
doc->setSource(contents);
doc->parse();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment