Commit 96e31c2a authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Started merging the JS and QML editor plug-ins.

parent 898e84ce
......@@ -25,14 +25,13 @@ SUBDIRS = plugin_coreplugin \
# plugin_helloworld \ # sample plugin
plugin_help \
# plugin_regexp \ # don't know what to do with this
plugin_qtscripteditor \
plugin_cpaster \
plugin_cmakeprojectmanager \
plugin_fakevim \
plugin_designer \
plugin_resourceeditor \
plugin_genericprojectmanager \
plugin_qmleditor \
plugin_qmljseditor \
plugin_qmlprojectmanager \
plugin_mercurial \
debugger/dumper.pro
......@@ -154,10 +153,6 @@ plugin_resourceeditor.depends = plugin_coreplugin
plugin_regexp.subdir = regexp
plugin_regexp.depends = plugin_coreplugin
plugin_qtscripteditor.subdir = qtscripteditor
plugin_qtscripteditor.depends = plugin_texteditor
plugin_qtscripteditor.depends += plugin_coreplugin
plugin_cpaster.subdir = cpaster
plugin_cpaster.depends = plugin_texteditor
plugin_cpaster.depends += plugin_coreplugin
......@@ -175,15 +170,15 @@ plugin_genericprojectmanager.depends += plugin_projectexplorer
plugin_genericprojectmanager.depends += plugin_cpptools
plugin_genericprojectmanager.depends += plugin_cppeditor
plugin_qmleditor.subdir = qmleditor
plugin_qmleditor.depends = plugin_texteditor
plugin_qmleditor.depends += plugin_coreplugin
plugin_qmljseditor.subdir = qmljseditor
plugin_qmljseditor.depends = plugin_texteditor
plugin_qmljseditor.depends += plugin_coreplugin
plugin_qmlprojectmanager.subdir = qmlprojectmanager
plugin_qmlprojectmanager.depends = plugin_texteditor
plugin_qmlprojectmanager.depends += plugin_projectexplorer
plugin_qmlprojectmanager.depends += plugin_help
plugin_qmlprojectmanager.depends += plugin_qmleditor
plugin_qmlprojectmanager.depends += plugin_qmljseditor
plugin_qmldesigner.subdir = qmldesigner
plugin_qmldesigner.depends = plugin_coreplugin
......
......@@ -14,7 +14,6 @@ SOURCES += \
$$PWD/firstdefinitionfinder.cpp \
$$PWD/moveobjectbeforeobjectvisitor.cpp
HEADERS += \
$$PWD/qmleditor_global.h \
$$PWD/qmlrewriter.h \
$$PWD/qmlrefactoring.h \
$$PWD/changeobjecttypevisitor.h \
......
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-qml">
<sub-class-of type="text/plain"/>
<comment>QML file</comment>
<glob pattern="*.qml"/>
</mime-type>
</mime-info>
include(qmleditor_dependencies.pri)
LIBS *= -l$$qtLibraryTarget(QmlEditor)
<RCC>
<qresource prefix="/qmleditor" >
<file>QmlEditor.mimetypes.xml</file>
</qresource>
</RCC>
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLEDITOR_GLOBAL_H
#define QMLEDITOR_GLOBAL_H
#include <QtGlobal>
#if defined(QMLEDITOR_LIBRARY)
# define QMLEDITOR_EXPORT Q_DECL_EXPORT
#else
# define QMLEDITOR_EXPORT Q_DECL_IMPORT
#endif
#endif // QMLEDITOR_GLOBAL_H
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-qml">
<sub-class-of type="text/plain"/>
<comment>QML file</comment>
<glob pattern="*.qml"/>
</mime-type>
<mime-type type="application/javascript">
<alias type="application/x-javascript"/>
<alias type="text/javascript"/>
......
<plugin name="QmlEditor" version="1.3.80" compatVersion="1.3.80">
<plugin name="QmlJSEditor" version="1.3.80" compatVersion="1.3.80">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
......@@ -10,7 +10,7 @@ GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
</license>
<description>Editor for QML.</description>
<description>Editor for QML and JavaScript.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.3.80"/>
......
......@@ -28,7 +28,7 @@
**************************************************************************/
#include "qmlcodecompletion.h"
#include "qmleditor.h"
#include "qmljseditor.h"
#include "qmlmodelmanagerinterface.h"
#include "qmlexpressionundercursor.h"
#include "qmllookupcontext.h"
......@@ -39,8 +39,8 @@
#include <QtDebug>
using namespace QmlEditor;
using namespace QmlEditor::Internal;
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent)
: TextEditor::ICompletionCollector(parent),
......@@ -65,7 +65,7 @@ void QmlCodeCompletion::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
bool QmlCodeCompletion::supportsEditor(TextEditor::ITextEditable *editor)
{
if (qobject_cast<QmlTextEditor *>(editor->widget()))
if (qobject_cast<QmlJSTextEditor *>(editor->widget()))
return true;
return false;
......@@ -78,7 +78,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
{
m_editor = editor;
QmlTextEditor *edit = qobject_cast<QmlTextEditor *>(m_editor->widget());
QmlJSTextEditor *edit = qobject_cast<QmlJSTextEditor *>(m_editor->widget());
if (! edit)
return -1;
......
......@@ -37,7 +37,7 @@ namespace TextEditor {
class ITextEditable;
}
namespace QmlEditor {
namespace QmlJSEditor {
class QmlModelManagerInterface;
......@@ -73,6 +73,6 @@ private:
} // end of namespace Internal
} // end of namespace QmlEditor
} // end of namespace QmlJSEditor
#endif // QMLCODECOMPLETION_H
......@@ -42,7 +42,7 @@ using namespace Qml;
using namespace QmlJS;
using namespace QmlJS::AST;
namespace QmlEditor {
namespace QmlJSEditor {
namespace Internal {
class PositionCalculator: protected Visitor
{
......@@ -204,8 +204,8 @@ namespace QmlEditor {
}
}
using namespace QmlEditor;
using namespace QmlEditor::Internal;
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
QmlExpressionUnderCursor::QmlExpressionUnderCursor()
: _expressionNode(0),
......
......@@ -30,7 +30,6 @@
#ifndef QMLEXPRESSIONUNDERCURSOR_H
#define QMLEXPRESSIONUNDERCURSOR_H
#include <qmljs/parser/qmljsastfwd_p.h>
#include <qmljs/qmldocument.h>
#include <qmljs/qmlsymbol.h>
......@@ -44,7 +43,7 @@ namespace QmlJS {
class NodePool;
}
namespace QmlEditor {
namespace QmlJSEditor {
namespace Internal {
class QmlExpressionUnderCursor
......@@ -84,6 +83,6 @@ private:
};
} // namespace Internal
} // namespace QmlEditor
} // namespace QmlJSEditor
#endif // QMLEXPRESSIONUNDERCURSOR_H
......@@ -27,13 +27,13 @@
**
**************************************************************************/
#include "qmleditorconstants.h"
#include "qmljseditorconstants.h"
#include "qmlfilewizard.h"
#include <QtCore/QFileInfo>
#include <QtCore/QTextStream>
using namespace QmlEditor;
using namespace QmlJSEditor;
QmlFileWizard::QmlFileWizard(const BaseFileWizardParameters &parameters,
QObject *parent):
......@@ -46,11 +46,11 @@ Core::GeneratedFiles QmlFileWizard::generateFilesFromPath(const QString &path,
QString * /*errorMessage*/) const
{
const QString mimeType = QLatin1String(Constants::QMLEDITOR_MIMETYPE);
const QString mimeType = QLatin1String(Constants::QMLJSEDITOR_MIMETYPE);
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, preferredSuffix(mimeType));
Core::GeneratedFile file(fileName);
file.setEditorId(QLatin1String(Constants::C_QMLEDITOR_ID));
file.setEditorId(QLatin1String(Constants::C_QMLJSEDITOR_ID));
file.setContents(fileContents(fileName));
return Core::GeneratedFiles() << file;
......
......@@ -32,7 +32,7 @@
#include <coreplugin/basefilewizard.h>
namespace QmlEditor {
namespace QmlJSEditor {
class QmlFileWizard: public Core::StandardFileWizard
{
......@@ -53,6 +53,6 @@ protected:
QString *errorMessage) const;
};
} // namespace QmlEditor
} // namespace QmlJSEditor
#endif // QMLFILEWIZARD_H
......@@ -31,8 +31,8 @@
#include <utils/qtcassert.h>
using namespace QmlEditor;
using namespace QmlEditor::Internal;
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
QmlHighlighter::QmlHighlighter(QTextDocument *parent) :
SharedTools::QScriptHighlighter(true, parent)
......
......@@ -33,7 +33,7 @@
#include <qscripthighlighter/qscripthighlighter.h>
#include <texteditor/basetexteditor.h>
namespace QmlEditor {
namespace QmlJSEditor {
namespace Internal {
// Highlighter for Scripts that stores
......@@ -59,6 +59,6 @@ private:
};
} // namespace Internal
} // namespace QmlEditor
} // namespace QmlJSEditor
#endif // QMLSYNTAXHIGHLIGHTER_H
......@@ -27,7 +27,7 @@
**
**************************************************************************/
#include "qmleditor.h"
#include "qmljseditor.h"
#include "qmlexpressionundercursor.h"
#include "qmlhoverhandler.h"
#include "qmllookupcontext.h"
......@@ -53,8 +53,8 @@
using namespace Core;
using namespace Qml;
using namespace QmlEditor;
using namespace QmlEditor::Internal;
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
QmlHoverHandler::QmlHoverHandler(QObject *parent)
: QObject(parent)
......@@ -84,7 +84,7 @@ QmlHoverHandler::QmlHoverHandler(QObject *parent)
void QmlHoverHandler::editorOpened(IEditor *editor)
{
QmlEditorEditable *qmlEditor = qobject_cast<QmlEditorEditable *>(editor);
QmlJSEditorEditable *qmlEditor = qobject_cast<QmlJSEditorEditable *>(editor);
if (!qmlEditor)
return;
......@@ -146,7 +146,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
if (!m_modelManager)
return;
QmlTextEditor *scriptEditor = qobject_cast<QmlTextEditor *>(editor->widget());
QmlJSTextEditor *scriptEditor = qobject_cast<QmlJSTextEditor *>(editor->widget());
if (!scriptEditor)
return;
......
......@@ -47,7 +47,7 @@ namespace TextEditor {
class ITextEditor;
}
namespace QmlEditor {
namespace QmlJSEditor {
namespace Internal {
class QmlHoverHandler : public QObject
......@@ -76,6 +76,6 @@ private:
};
} // namespace Internal
} // namespace QmlEditor
} // namespace QmlJSEditor
#endif // QMLHOVERHANDLER_H
Supports Markdown
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