Changed the QML/JS editor to treat .qs/.js files as JavaScript, and invoke the appropriate parser for it.

Reviewed-by: Christian Kamm
This commit is contained in:
Erik Verbruggen
2010-01-18 12:38:36 +01:00
committed by Tim Jenssen
parent 2dfe4f620c
commit 0f8126f62d
9 changed files with 84 additions and 35 deletions

View File

@@ -95,12 +95,12 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
if (qmlDocument.isNull())
return pos;
if (!qmlDocument->program())
if (!qmlDocument->qmlProgram())
qmlDocument = m_modelManager->snapshot().value(qmlDocument->fileName());
// FIXME: this completion strategy is not going to work when the document was never parsed correctly.
if (qmlDocument && qmlDocument->program()) {
QmlJS::AST::UiProgram *program = qmlDocument->program();
if (qmlDocument && qmlDocument->qmlProgram()) {
QmlJS::AST::UiProgram *program = qmlDocument->qmlProgram();
// qDebug() << "*** program:" << program;
if (program) {