forked from qt-creator/qt-creator
Add QmlJS semantic checker.
* Add SemanticHighlighter to QmlJSTextEditor to update the semantic info in a background thread. * Add QmlJS::Check to run semantic checks on qml and js documents. * Add a check for incorrect property names. * Fix hoverhandler to show tool tips from extra selections over help tooltips.
This commit is contained in:
@@ -216,6 +216,19 @@ void Snapshot::insert(const Document::Ptr &document)
|
||||
_documents.insert(document->fileName(), document);
|
||||
}
|
||||
|
||||
Document::Ptr Snapshot::documentFromSource(const QString &code,
|
||||
const QString &fileName) const
|
||||
{
|
||||
Document::Ptr newDoc = Document::create(fileName);
|
||||
|
||||
if (Document::Ptr thisDocument = document(fileName)) {
|
||||
newDoc->_documentRevision = thisDocument->_documentRevision;
|
||||
}
|
||||
|
||||
newDoc->setSource(code);
|
||||
return newDoc;
|
||||
}
|
||||
|
||||
QList<Document::Ptr> Snapshot::importedDocuments(const Document::Ptr &doc, const QString &importPath) const
|
||||
{
|
||||
// ### TODO: maybe we should add all imported documents in the parse Document::parse() method, regardless of whether they're in the path or not.
|
||||
|
Reference in New Issue
Block a user