Skip to content
Snippets Groups Projects
Commit 96e31c2a authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Started merging the JS and QML editor plug-ins.

parent 898e84ce
Branches qp-3.3
Tags qp-v3.3.1 qp-v3.3.2
No related merge requests found
Showing
with 41 additions and 100 deletions
...@@ -25,14 +25,13 @@ SUBDIRS = plugin_coreplugin \ ...@@ -25,14 +25,13 @@ SUBDIRS = plugin_coreplugin \
# plugin_helloworld \ # sample plugin # plugin_helloworld \ # sample plugin
plugin_help \ plugin_help \
# plugin_regexp \ # don't know what to do with this # plugin_regexp \ # don't know what to do with this
plugin_qtscripteditor \
plugin_cpaster \ plugin_cpaster \
plugin_cmakeprojectmanager \ plugin_cmakeprojectmanager \
plugin_fakevim \ plugin_fakevim \
plugin_designer \ plugin_designer \
plugin_resourceeditor \ plugin_resourceeditor \
plugin_genericprojectmanager \ plugin_genericprojectmanager \
plugin_qmleditor \ plugin_qmljseditor \
plugin_qmlprojectmanager \ plugin_qmlprojectmanager \
plugin_mercurial \ plugin_mercurial \
debugger/dumper.pro debugger/dumper.pro
...@@ -154,10 +153,6 @@ plugin_resourceeditor.depends = plugin_coreplugin ...@@ -154,10 +153,6 @@ plugin_resourceeditor.depends = plugin_coreplugin
plugin_regexp.subdir = regexp plugin_regexp.subdir = regexp
plugin_regexp.depends = plugin_coreplugin 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.subdir = cpaster
plugin_cpaster.depends = plugin_texteditor plugin_cpaster.depends = plugin_texteditor
plugin_cpaster.depends += plugin_coreplugin plugin_cpaster.depends += plugin_coreplugin
...@@ -175,15 +170,15 @@ plugin_genericprojectmanager.depends += plugin_projectexplorer ...@@ -175,15 +170,15 @@ plugin_genericprojectmanager.depends += plugin_projectexplorer
plugin_genericprojectmanager.depends += plugin_cpptools plugin_genericprojectmanager.depends += plugin_cpptools
plugin_genericprojectmanager.depends += plugin_cppeditor plugin_genericprojectmanager.depends += plugin_cppeditor
plugin_qmleditor.subdir = qmleditor plugin_qmljseditor.subdir = qmljseditor
plugin_qmleditor.depends = plugin_texteditor plugin_qmljseditor.depends = plugin_texteditor
plugin_qmleditor.depends += plugin_coreplugin plugin_qmljseditor.depends += plugin_coreplugin
plugin_qmlprojectmanager.subdir = qmlprojectmanager plugin_qmlprojectmanager.subdir = qmlprojectmanager
plugin_qmlprojectmanager.depends = plugin_texteditor plugin_qmlprojectmanager.depends = plugin_texteditor
plugin_qmlprojectmanager.depends += plugin_projectexplorer plugin_qmlprojectmanager.depends += plugin_projectexplorer
plugin_qmlprojectmanager.depends += plugin_help plugin_qmlprojectmanager.depends += plugin_help
plugin_qmlprojectmanager.depends += plugin_qmleditor plugin_qmlprojectmanager.depends += plugin_qmljseditor
plugin_qmldesigner.subdir = qmldesigner plugin_qmldesigner.subdir = qmldesigner
plugin_qmldesigner.depends = plugin_coreplugin plugin_qmldesigner.depends = plugin_coreplugin
......
...@@ -14,7 +14,6 @@ SOURCES += \ ...@@ -14,7 +14,6 @@ SOURCES += \
$$PWD/firstdefinitionfinder.cpp \ $$PWD/firstdefinitionfinder.cpp \
$$PWD/moveobjectbeforeobjectvisitor.cpp $$PWD/moveobjectbeforeobjectvisitor.cpp
HEADERS += \ HEADERS += \
$$PWD/qmleditor_global.h \
$$PWD/qmlrewriter.h \ $$PWD/qmlrewriter.h \
$$PWD/qmlrefactoring.h \ $$PWD/qmlrefactoring.h \
$$PWD/changeobjecttypevisitor.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"?> <?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <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"> <mime-type type="application/javascript">
<alias type="application/x-javascript"/> <alias type="application/x-javascript"/>
<alias type="text/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> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright> <copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license> <license>
...@@ -10,7 +10,7 @@ GNU Lesser General Public License Usage ...@@ -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. 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> </license>
<description>Editor for QML.</description> <description>Editor for QML and JavaScript.</description>
<url>http://qt.nokia.com</url> <url>http://qt.nokia.com</url>
<dependencyList> <dependencyList>
<dependency name="Core" version="1.3.80"/> <dependency name="Core" version="1.3.80"/>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
**************************************************************************/ **************************************************************************/
#include "qmlcodecompletion.h" #include "qmlcodecompletion.h"
#include "qmleditor.h" #include "qmljseditor.h"
#include "qmlmodelmanagerinterface.h" #include "qmlmodelmanagerinterface.h"
#include "qmlexpressionundercursor.h" #include "qmlexpressionundercursor.h"
#include "qmllookupcontext.h" #include "qmllookupcontext.h"
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#include <QtDebug> #include <QtDebug>
using namespace QmlEditor; using namespace QmlJSEditor;
using namespace QmlEditor::Internal; using namespace QmlJSEditor::Internal;
QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent) QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent)
: TextEditor::ICompletionCollector(parent), : TextEditor::ICompletionCollector(parent),
...@@ -65,7 +65,7 @@ void QmlCodeCompletion::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity) ...@@ -65,7 +65,7 @@ void QmlCodeCompletion::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
bool QmlCodeCompletion::supportsEditor(TextEditor::ITextEditable *editor) bool QmlCodeCompletion::supportsEditor(TextEditor::ITextEditable *editor)
{ {
if (qobject_cast<QmlTextEditor *>(editor->widget())) if (qobject_cast<QmlJSTextEditor *>(editor->widget()))
return true; return true;
return false; return false;
...@@ -78,7 +78,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) ...@@ -78,7 +78,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
{ {
m_editor = editor; m_editor = editor;
QmlTextEditor *edit = qobject_cast<QmlTextEditor *>(m_editor->widget()); QmlJSTextEditor *edit = qobject_cast<QmlJSTextEditor *>(m_editor->widget());
if (! edit) if (! edit)
return -1; return -1;
......
...@@ -37,7 +37,7 @@ namespace TextEditor { ...@@ -37,7 +37,7 @@ namespace TextEditor {
class ITextEditable; class ITextEditable;
} }
namespace QmlEditor { namespace QmlJSEditor {
class QmlModelManagerInterface; class QmlModelManagerInterface;
...@@ -73,6 +73,6 @@ private: ...@@ -73,6 +73,6 @@ private:
} // end of namespace Internal } // end of namespace Internal
} // end of namespace QmlEditor } // end of namespace QmlJSEditor
#endif // QMLCODECOMPLETION_H #endif // QMLCODECOMPLETION_H
...@@ -42,7 +42,7 @@ using namespace Qml; ...@@ -42,7 +42,7 @@ using namespace Qml;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
namespace QmlEditor { namespace QmlJSEditor {
namespace Internal { namespace Internal {
class PositionCalculator: protected Visitor class PositionCalculator: protected Visitor
{ {
...@@ -204,8 +204,8 @@ namespace QmlEditor { ...@@ -204,8 +204,8 @@ namespace QmlEditor {
} }
} }
using namespace QmlEditor; using namespace QmlJSEditor;
using namespace QmlEditor::Internal; using namespace QmlJSEditor::Internal;
QmlExpressionUnderCursor::QmlExpressionUnderCursor() QmlExpressionUnderCursor::QmlExpressionUnderCursor()
: _expressionNode(0), : _expressionNode(0),
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#ifndef QMLEXPRESSIONUNDERCURSOR_H #ifndef QMLEXPRESSIONUNDERCURSOR_H
#define QMLEXPRESSIONUNDERCURSOR_H #define QMLEXPRESSIONUNDERCURSOR_H
#include <qmljs/parser/qmljsastfwd_p.h> #include <qmljs/parser/qmljsastfwd_p.h>
#include <qmljs/qmldocument.h> #include <qmljs/qmldocument.h>
#include <qmljs/qmlsymbol.h> #include <qmljs/qmlsymbol.h>
...@@ -44,7 +43,7 @@ namespace QmlJS { ...@@ -44,7 +43,7 @@ namespace QmlJS {
class NodePool; class NodePool;
} }
namespace QmlEditor { namespace QmlJSEditor {
namespace Internal { namespace Internal {
class QmlExpressionUnderCursor class QmlExpressionUnderCursor
...@@ -84,6 +83,6 @@ private: ...@@ -84,6 +83,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlJSEditor
#endif // QMLEXPRESSIONUNDERCURSOR_H #endif // QMLEXPRESSIONUNDERCURSOR_H
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
** **
**************************************************************************/ **************************************************************************/
#include "qmleditorconstants.h" #include "qmljseditorconstants.h"
#include "qmlfilewizard.h" #include "qmlfilewizard.h"
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
using namespace QmlEditor; using namespace QmlJSEditor;
QmlFileWizard::QmlFileWizard(const BaseFileWizardParameters &parameters, QmlFileWizard::QmlFileWizard(const BaseFileWizardParameters &parameters,
QObject *parent): QObject *parent):
...@@ -46,11 +46,11 @@ Core::GeneratedFiles QmlFileWizard::generateFilesFromPath(const QString &path, ...@@ -46,11 +46,11 @@ Core::GeneratedFiles QmlFileWizard::generateFilesFromPath(const QString &path,
QString * /*errorMessage*/) const 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)); const QString fileName = Core::BaseFileWizard::buildFileName(path, name, preferredSuffix(mimeType));
Core::GeneratedFile file(fileName); Core::GeneratedFile file(fileName);
file.setEditorId(QLatin1String(Constants::C_QMLEDITOR_ID)); file.setEditorId(QLatin1String(Constants::C_QMLJSEDITOR_ID));
file.setContents(fileContents(fileName)); file.setContents(fileContents(fileName));
return Core::GeneratedFiles() << file; return Core::GeneratedFiles() << file;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <coreplugin/basefilewizard.h> #include <coreplugin/basefilewizard.h>
namespace QmlEditor { namespace QmlJSEditor {
class QmlFileWizard: public Core::StandardFileWizard class QmlFileWizard: public Core::StandardFileWizard
{ {
...@@ -53,6 +53,6 @@ protected: ...@@ -53,6 +53,6 @@ protected:
QString *errorMessage) const; QString *errorMessage) const;
}; };
} // namespace QmlEditor } // namespace QmlJSEditor
#endif // QMLFILEWIZARD_H #endif // QMLFILEWIZARD_H
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
using namespace QmlEditor; using namespace QmlJSEditor;
using namespace QmlEditor::Internal; using namespace QmlJSEditor::Internal;
QmlHighlighter::QmlHighlighter(QTextDocument *parent) : QmlHighlighter::QmlHighlighter(QTextDocument *parent) :
SharedTools::QScriptHighlighter(true, parent) SharedTools::QScriptHighlighter(true, parent)
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <qscripthighlighter/qscripthighlighter.h> #include <qscripthighlighter/qscripthighlighter.h>
#include <texteditor/basetexteditor.h> #include <texteditor/basetexteditor.h>
namespace QmlEditor { namespace QmlJSEditor {
namespace Internal { namespace Internal {
// Highlighter for Scripts that stores // Highlighter for Scripts that stores
...@@ -59,6 +59,6 @@ private: ...@@ -59,6 +59,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlJSEditor
#endif // QMLSYNTAXHIGHLIGHTER_H #endif // QMLSYNTAXHIGHLIGHTER_H
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "qmleditor.h" #include "qmljseditor.h"
#include "qmlexpressionundercursor.h" #include "qmlexpressionundercursor.h"
#include "qmlhoverhandler.h" #include "qmlhoverhandler.h"
#include "qmllookupcontext.h" #include "qmllookupcontext.h"
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
using namespace Core; using namespace Core;
using namespace Qml; using namespace Qml;
using namespace QmlEditor; using namespace QmlJSEditor;
using namespace QmlEditor::Internal; using namespace QmlJSEditor::Internal;
QmlHoverHandler::QmlHoverHandler(QObject *parent) QmlHoverHandler::QmlHoverHandler(QObject *parent)
: QObject(parent) : QObject(parent)
...@@ -84,7 +84,7 @@ QmlHoverHandler::QmlHoverHandler(QObject *parent) ...@@ -84,7 +84,7 @@ QmlHoverHandler::QmlHoverHandler(QObject *parent)
void QmlHoverHandler::editorOpened(IEditor *editor) void QmlHoverHandler::editorOpened(IEditor *editor)
{ {
QmlEditorEditable *qmlEditor = qobject_cast<QmlEditorEditable *>(editor); QmlJSEditorEditable *qmlEditor = qobject_cast<QmlJSEditorEditable *>(editor);
if (!qmlEditor) if (!qmlEditor)
return; return;
...@@ -146,7 +146,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in ...@@ -146,7 +146,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
if (!m_modelManager) if (!m_modelManager)
return; return;
QmlTextEditor *scriptEditor = qobject_cast<QmlTextEditor *>(editor->widget()); QmlJSTextEditor *scriptEditor = qobject_cast<QmlJSTextEditor *>(editor->widget());
if (!scriptEditor) if (!scriptEditor)
return; return;
......
...@@ -47,7 +47,7 @@ namespace TextEditor { ...@@ -47,7 +47,7 @@ namespace TextEditor {
class ITextEditor; class ITextEditor;
} }
namespace QmlEditor { namespace QmlJSEditor {
namespace Internal { namespace Internal {
class QmlHoverHandler : public QObject class QmlHoverHandler : public QObject
...@@ -76,6 +76,6 @@ private: ...@@ -76,6 +76,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlJSEditor
#endif // QMLHOVERHANDLER_H #endif // QMLHOVERHANDLER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment