forked from qt-creator/qt-creator
Introduced ranges and versioning of QML/JS documents.
This commit is contained in:
@@ -43,8 +43,9 @@ Document::Document(const QString &fileName)
|
||||
: _engine(0)
|
||||
, _pool(0)
|
||||
, _ast(0)
|
||||
, _fileName(fileName)
|
||||
, _documentRevision(0)
|
||||
, _parsedCorrectly(false)
|
||||
, _fileName(fileName)
|
||||
{
|
||||
const int slashIdx = fileName.lastIndexOf('/');
|
||||
if (slashIdx != -1)
|
||||
@@ -101,6 +102,16 @@ void Document::setSource(const QString &source)
|
||||
_source = source;
|
||||
}
|
||||
|
||||
int Document::documentRevision() const
|
||||
{
|
||||
return _documentRevision;
|
||||
}
|
||||
|
||||
void Document::setDocumentRevision(int revision)
|
||||
{
|
||||
_documentRevision = revision;
|
||||
}
|
||||
|
||||
bool Document::parseQml()
|
||||
{
|
||||
Q_ASSERT(! _engine);
|
||||
|
||||
@@ -72,6 +72,9 @@ public:
|
||||
bool isParsedCorrectly() const
|
||||
{ return _parsedCorrectly; }
|
||||
|
||||
int documentRevision() const;
|
||||
void setDocumentRevision(int documentRevision);
|
||||
|
||||
IdTable ids() const { return _ids; }
|
||||
|
||||
QString fileName() const { return _fileName; }
|
||||
@@ -86,12 +89,13 @@ private:
|
||||
QmlJS::Engine *_engine;
|
||||
QmlJS::NodePool *_pool;
|
||||
QmlJS::AST::Node *_ast;
|
||||
int _documentRevision;
|
||||
bool _parsedCorrectly;
|
||||
QList<QmlJS::DiagnosticMessage> _diagnosticMessages;
|
||||
QString _fileName;
|
||||
QString _path;
|
||||
QString _componentName;
|
||||
QString _source;
|
||||
bool _parsedCorrectly;
|
||||
IdTable _ids;
|
||||
QmlJS::Symbol::List _symbols;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user