forked from qt-creator/qt-creator
QmlJSEditor: Rename QmlJSEditorEditable into QmlJSEditor
Change-Id: I710817ffd7bdf87aa6c0fed0f1f3cd4ea842fd01 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -66,11 +66,13 @@
|
|||||||
#include <QTextDocumentFragment>
|
#include <QTextDocumentFragment>
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
using namespace Internal;
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
enum CompletionOrder {
|
enum CompletionOrder {
|
||||||
@@ -335,7 +337,11 @@ bool isLiteral(AST::Node *ast)
|
|||||||
|
|
||||||
} // Anonymous
|
} // Anonymous
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(CompleteFunctionCall)
|
} // namesapce QmlJSEditor
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QmlJSEditor::CompleteFunctionCall)
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
// -----------------------
|
// -----------------------
|
||||||
// QmlJSAssistProposalItem
|
// QmlJSAssistProposalItem
|
||||||
@@ -1028,3 +1034,5 @@ bool QmlJSAssistProposalModel::keepPerfectMatch(TextEditor::AssistReason reason)
|
|||||||
{
|
{
|
||||||
return reason == ExplicitlyInvoked;
|
return reason == ExplicitlyInvoked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -47,10 +47,12 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class Operation: public QmlJSQuickFixOperation
|
class Operation: public QmlJSQuickFixOperation
|
||||||
@@ -153,3 +155,5 @@ void ComponentFromObjectDef::match(const QmlJSQuickFixInterface &interface, Quic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} //namespace QmlJSEditor
|
||||||
|
@@ -95,10 +95,11 @@ enum {
|
|||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class FindIdDeclarations: protected Visitor
|
class FindIdDeclarations: protected Visitor
|
||||||
@@ -577,7 +578,7 @@ QModelIndex QmlJSTextEditorWidget::outlineModelIndex()
|
|||||||
return m_outlineModelIndex;
|
return m_outlineModelIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IEditor *QmlJSEditorEditable::duplicate(QWidget *parent)
|
Core::IEditor *QmlJSEditor::duplicate(QWidget *parent)
|
||||||
{
|
{
|
||||||
QmlJSTextEditorWidget *newEditor = new QmlJSTextEditorWidget(parent);
|
QmlJSTextEditorWidget *newEditor = new QmlJSTextEditorWidget(parent);
|
||||||
newEditor->duplicateFrom(editorWidget());
|
newEditor->duplicateFrom(editorWidget());
|
||||||
@@ -585,12 +586,12 @@ Core::IEditor *QmlJSEditorEditable::duplicate(QWidget *parent)
|
|||||||
return newEditor->editor();
|
return newEditor->editor();
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id QmlJSEditorEditable::id() const
|
Core::Id QmlJSEditor::id() const
|
||||||
{
|
{
|
||||||
return Core::Id(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
return Core::Id(Constants::C_QMLJSEDITOR_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlJSEditorEditable::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
bool QmlJSEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||||
{
|
{
|
||||||
bool b = TextEditor::BaseTextEditor::open(errorString, fileName, realFileName);
|
bool b = TextEditor::BaseTextEditor::open(errorString, fileName, realFileName);
|
||||||
editorWidget()->setMimeType(Core::ICore::mimeDatabase()->findByFile(QFileInfo(fileName)).type());
|
editorWidget()->setMimeType(Core::ICore::mimeDatabase()->findByFile(QFileInfo(fileName)).type());
|
||||||
@@ -748,9 +749,13 @@ void QmlJSTextEditorWidget::updateOutlineIndexNow()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
|
||||||
class QtQuickToolbarMarker {};
|
class QtQuickToolbarMarker {};
|
||||||
Q_DECLARE_METATYPE(QtQuickToolbarMarker)
|
Q_DECLARE_METATYPE(QtQuickToolbarMarker)
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
static QList<TextEditor::RefactorMarker> removeMarkersOfType(const QList<TextEditor::RefactorMarker> &markers)
|
static QList<TextEditor::RefactorMarker> removeMarkersOfType(const QList<TextEditor::RefactorMarker> &markers)
|
||||||
{
|
{
|
||||||
@@ -1025,12 +1030,12 @@ bool QmlJSTextEditorWidget::isClosingBrace(const QList<Token> &tokens) const
|
|||||||
|
|
||||||
TextEditor::BaseTextEditor *QmlJSTextEditorWidget::createEditor()
|
TextEditor::BaseTextEditor *QmlJSTextEditorWidget::createEditor()
|
||||||
{
|
{
|
||||||
QmlJSEditorEditable *editable = new QmlJSEditorEditable(this);
|
QmlJSEditor *editable = new QmlJSEditor(this);
|
||||||
createToolBar(editable);
|
createToolBar(editable);
|
||||||
return editable;
|
return editable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSTextEditorWidget::createToolBar(QmlJSEditorEditable *editor)
|
void QmlJSTextEditorWidget::createToolBar(QmlJSEditor *editor)
|
||||||
{
|
{
|
||||||
m_outlineCombo = new QComboBox;
|
m_outlineCombo = new QComboBox;
|
||||||
m_outlineCombo->setMinimumContentsLength(22);
|
m_outlineCombo->setMinimumContentsLength(22);
|
||||||
@@ -1209,13 +1214,13 @@ void QmlJSTextEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
|
|
||||||
refactoringMenu->setEnabled(!refactoringMenu->isEmpty());
|
refactoringMenu->setEnabled(!refactoringMenu->isEmpty());
|
||||||
|
|
||||||
if (Core::ActionContainer *mcontext = Core::ActionManager::actionContainer(QmlJSEditor::Constants::M_CONTEXT)) {
|
if (Core::ActionContainer *mcontext = Core::ActionManager::actionContainer(Constants::M_CONTEXT)) {
|
||||||
QMenu *contextMenu = mcontext->menu();
|
QMenu *contextMenu = mcontext->menu();
|
||||||
foreach (QAction *action, contextMenu->actions()) {
|
foreach (QAction *action, contextMenu->actions()) {
|
||||||
menu->addAction(action);
|
menu->addAction(action);
|
||||||
if (action->objectName() == QLatin1String(QmlJSEditor::Constants::M_REFACTORING_MENU_INSERTION_POINT))
|
if (action->objectName() == QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT))
|
||||||
menu->addMenu(refactoringMenu);
|
menu->addMenu(refactoringMenu);
|
||||||
if (action->objectName() == QLatin1String(QmlJSEditor::Constants::SHOW_QT_QUICK_HELPER)) {
|
if (action->objectName() == QLatin1String(Constants::SHOW_QT_QUICK_HELPER)) {
|
||||||
bool enabled = m_contextPane->isAvailable(editor(), semanticInfo().document, m_semanticInfo.declaringMemberNoProperties(position()));
|
bool enabled = m_contextPane->isAvailable(editor(), semanticInfo().document, m_semanticInfo.declaringMemberNoProperties(position()));
|
||||||
action->setEnabled(enabled);
|
action->setEnabled(enabled);
|
||||||
}
|
}
|
||||||
@@ -1448,3 +1453,5 @@ QString QmlJSTextEditorWidget::foldReplacementText(const QTextBlock &block) cons
|
|||||||
|
|
||||||
return TextEditor::BaseTextEditorWidget::foldReplacementText(block);
|
return TextEditor::BaseTextEditorWidget::foldReplacementText(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -65,7 +65,7 @@ namespace AST {
|
|||||||
The top-level namespace of the QmlJSEditor plug-in.
|
The top-level namespace of the QmlJSEditor plug-in.
|
||||||
*/
|
*/
|
||||||
namespace QmlJSEditor {
|
namespace QmlJSEditor {
|
||||||
class QmlJSEditorEditable;
|
class QmlJSEditor;
|
||||||
class FindReferences;
|
class FindReferences;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -160,7 +160,7 @@ protected:
|
|||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
void scrollContentsBy(int dx, int dy);
|
void scrollContentsBy(int dx, int dy);
|
||||||
TextEditor::BaseTextEditor *createEditor();
|
TextEditor::BaseTextEditor *createEditor();
|
||||||
void createToolBar(QmlJSEditorEditable *editable);
|
void createToolBar(QmlJSEditor *editable);
|
||||||
TextEditor::BaseTextEditorWidget::Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true);
|
TextEditor::BaseTextEditorWidget::Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true);
|
||||||
QString foldReplacementText(const QTextBlock &block) const;
|
QString foldReplacementText(const QTextBlock &block) const;
|
||||||
|
|
||||||
|
@@ -43,15 +43,15 @@
|
|||||||
|
|
||||||
namespace QmlJSEditor {
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
QmlJSEditorEditable::QmlJSEditorEditable(QmlJSTextEditorWidget *editor)
|
QmlJSEditor::QmlJSEditor(QmlJSTextEditorWidget *editor)
|
||||||
: BaseTextEditor(editor)
|
: BaseTextEditor(editor)
|
||||||
{
|
{
|
||||||
m_context.add(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
m_context.add(Constants::C_QMLJSEDITOR_ID);
|
||||||
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
|
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
m_context.add(ProjectExplorer::Constants::LANG_QMLJS);
|
m_context.add(ProjectExplorer::Constants::LANG_QMLJS);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlJSEditorEditable::isDesignModePreferred() const
|
bool QmlJSEditor::isDesignModePreferred() const
|
||||||
{
|
{
|
||||||
// stay in design mode if we are there
|
// stay in design mode if we are there
|
||||||
Core::IMode *mode = Core::ModeManager::currentMode();
|
Core::IMode *mode = Core::ModeManager::currentMode();
|
||||||
@@ -60,14 +60,14 @@ bool QmlJSEditorEditable::isDesignModePreferred() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSEditorEditable::setTextCodec(QTextCodec *codec, TextCodecReason reason)
|
void QmlJSEditor::setTextCodec(QTextCodec *codec, TextCodecReason reason)
|
||||||
{
|
{
|
||||||
if (reason != TextCodecOtherReason) // qml is defined to be utf8
|
if (reason != TextCodecOtherReason) // qml is defined to be utf8
|
||||||
return;
|
return;
|
||||||
editorWidget()->setTextCodec(codec);
|
editorWidget()->setTextCodec(codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Utils::CommentDefinition *QmlJSEditorEditable::commentDefinition() const
|
const Utils::CommentDefinition *QmlJSEditor::commentDefinition() const
|
||||||
{
|
{
|
||||||
return &m_commentDefinition;
|
return &m_commentDefinition;
|
||||||
}
|
}
|
||||||
|
@@ -37,12 +37,12 @@
|
|||||||
namespace QmlJSEditor {
|
namespace QmlJSEditor {
|
||||||
class QmlJSTextEditorWidget;
|
class QmlJSTextEditorWidget;
|
||||||
|
|
||||||
class QMLJSEDITOR_EXPORT QmlJSEditorEditable : public TextEditor::BaseTextEditor
|
class QMLJSEDITOR_EXPORT QmlJSEditor : public TextEditor::BaseTextEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QmlJSEditorEditable(QmlJSTextEditorWidget *);
|
explicit QmlJSEditor(QmlJSTextEditorWidget *);
|
||||||
|
|
||||||
bool duplicateSupported() const { return true; }
|
bool duplicateSupported() const { return true; }
|
||||||
Core::IEditor *duplicate(QWidget *parent);
|
Core::IEditor *duplicate(QWidget *parent);
|
||||||
|
@@ -49,9 +49,8 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
using namespace QmlJSEditor;
|
namespace QmlJSEditor {
|
||||||
using namespace QmlJSEditor::Internal;
|
namespace Internal {
|
||||||
using namespace QmlJSEditor::Constants;
|
|
||||||
|
|
||||||
QmlJSEditorFactory::QmlJSEditorFactory(QObject *parent)
|
QmlJSEditorFactory::QmlJSEditorFactory(QObject *parent)
|
||||||
: Core::IEditorFactory(parent)
|
: Core::IEditorFactory(parent)
|
||||||
@@ -68,17 +67,17 @@ QmlJSEditorFactory::QmlJSEditorFactory(QObject *parent)
|
|||||||
|
|
||||||
Core::Id QmlJSEditorFactory::id() const
|
Core::Id QmlJSEditorFactory::id() const
|
||||||
{
|
{
|
||||||
return Core::Id(C_QMLJSEDITOR_ID);
|
return Core::Id(Constants::C_QMLJSEDITOR_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlJSEditorFactory::displayName() const
|
QString QmlJSEditorFactory::displayName() const
|
||||||
{
|
{
|
||||||
return qApp->translate("OpenWith::Editors", C_QMLJSEDITOR_DISPLAY_NAME);
|
return qApp->translate("OpenWith::Editors", Constants::C_QMLJSEDITOR_DISPLAY_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
|
Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
|
||||||
{
|
{
|
||||||
QmlJSEditor::QmlJSTextEditorWidget *rc = new QmlJSEditor::QmlJSTextEditorWidget(parent);
|
QmlJSTextEditorWidget *rc = new QmlJSTextEditorWidget(parent);
|
||||||
QmlJSEditorPlugin::instance()->initializeEditor(rc);
|
QmlJSEditorPlugin::instance()->initializeEditor(rc);
|
||||||
return rc->editor();
|
return rc->editor();
|
||||||
}
|
}
|
||||||
@@ -87,3 +86,6 @@ QStringList QmlJSEditorFactory::mimeTypes() const
|
|||||||
{
|
{
|
||||||
return m_mimeTypes;
|
return m_mimeTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -77,8 +77,6 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJSEditor::Constants;
|
using namespace QmlJSEditor::Constants;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -86,6 +84,9 @@ enum {
|
|||||||
QUICKFIX_INTERVAL = 20
|
QUICKFIX_INTERVAL = 20
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
void registerQuickFixes(ExtensionSystem::IPlugin *plugIn);
|
void registerQuickFixes(ExtensionSystem::IPlugin *plugIn);
|
||||||
|
|
||||||
QmlJSEditorPlugin *QmlJSEditorPlugin::m_instance = 0;
|
QmlJSEditorPlugin *QmlJSEditorPlugin::m_instance = 0;
|
||||||
@@ -130,7 +131,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
|||||||
connect(m_modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
|
connect(m_modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
|
||||||
m_qmlTaskManager, SLOT(documentsRemoved(QStringList)));
|
m_qmlTaskManager, SLOT(documentsRemoved(QStringList)));
|
||||||
|
|
||||||
Core::Context context(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
Core::Context context(Constants::C_QMLJSEDITOR_ID);
|
||||||
|
|
||||||
m_editor = new QmlJSEditorFactory(this);
|
m_editor = new QmlJSEditorFactory(this);
|
||||||
addObject(m_editor);
|
addObject(m_editor);
|
||||||
@@ -160,14 +161,14 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
|||||||
jsWizardParameters.setId(QLatin1String("Z.Js"));
|
jsWizardParameters.setId(QLatin1String("Z.Js"));
|
||||||
addAutoReleasedObject(new JsFileWizard(jsWizardParameters, core));
|
addAutoReleasedObject(new JsFileWizard(jsWizardParameters, core));
|
||||||
|
|
||||||
m_actionHandler = new TextEditor::TextEditorActionHandler(QmlJSEditor::Constants::C_QMLJSEDITOR_ID,
|
m_actionHandler = new TextEditor::TextEditorActionHandler(Constants::C_QMLJSEDITOR_ID,
|
||||||
TextEditor::TextEditorActionHandler::Format
|
TextEditor::TextEditorActionHandler::Format
|
||||||
| TextEditor::TextEditorActionHandler::UnCommentSelection
|
| TextEditor::TextEditorActionHandler::UnCommentSelection
|
||||||
| TextEditor::TextEditorActionHandler::UnCollapseAll
|
| TextEditor::TextEditorActionHandler::UnCollapseAll
|
||||||
| TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor);
|
| TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor);
|
||||||
m_actionHandler->initializeActions();
|
m_actionHandler->initializeActions();
|
||||||
|
|
||||||
Core::ActionContainer *contextMenu = Core::ActionManager::createMenu(QmlJSEditor::Constants::M_CONTEXT);
|
Core::ActionContainer *contextMenu = Core::ActionManager::createMenu(Constants::M_CONTEXT);
|
||||||
Core::ActionContainer *qmlToolsMenu = Core::ActionManager::actionContainer(Core::Id(QmlJSTools::Constants::M_TOOLS_QMLJS));
|
Core::ActionContainer *qmlToolsMenu = Core::ActionManager::actionContainer(Core::Id(QmlJSTools::Constants::M_TOOLS_QMLJS));
|
||||||
|
|
||||||
Core::Context globalContext(Core::Constants::C_GLOBAL);
|
Core::Context globalContext(Core::Constants::C_GLOBAL);
|
||||||
@@ -259,7 +260,7 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlJSEditorPlugin::aboutToShutdown()
|
|||||||
return IPlugin::aboutToShutdown();
|
return IPlugin::aboutToShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *editor)
|
void QmlJSEditorPlugin::initializeEditor(QmlJSTextEditorWidget *editor)
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_instance);
|
QTC_CHECK(m_instance);
|
||||||
|
|
||||||
@@ -358,4 +359,6 @@ void QmlJSEditorPlugin::checkCurrentEditorSemanticInfoUpToDate()
|
|||||||
m_reformatFileAction->setEnabled(semanticInfoUpToDate);
|
m_reformatFileAction->setEnabled(semanticInfoUpToDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(QmlJSEditorPlugin)
|
} // namespace QmlJSEditor
|
||||||
|
|
||||||
|
Q_EXPORT_PLUGIN(QmlJSEditor::Internal::QmlJSEditorPlugin)
|
||||||
|
@@ -92,7 +92,7 @@ public:
|
|||||||
|
|
||||||
QmlJSQuickFixAssistProvider *quickFixAssistProvider() const;
|
QmlJSQuickFixAssistProvider *quickFixAssistProvider() const;
|
||||||
|
|
||||||
void initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *editor);
|
void initializeEditor(QmlJSTextEditorWidget *editor);
|
||||||
|
|
||||||
Utils::JsonSchemaManager *jsonManager() const;
|
Utils::JsonSchemaManager *jsonManager() const;
|
||||||
|
|
||||||
|
@@ -56,8 +56,9 @@
|
|||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
namespace QmlJSEditor {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -97,7 +98,7 @@ HoverHandler::HoverHandler(QObject *parent) : BaseHoverHandler(parent), m_modelM
|
|||||||
|
|
||||||
bool HoverHandler::acceptEditor(IEditor *editor)
|
bool HoverHandler::acceptEditor(IEditor *editor)
|
||||||
{
|
{
|
||||||
QmlJSEditorEditable *qmlEditor = qobject_cast<QmlJSEditorEditable *>(editor);
|
QmlJSEditor *qmlEditor = qobject_cast<QmlJSEditor *>(editor);
|
||||||
if (qmlEditor)
|
if (qmlEditor)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -189,7 +190,7 @@ void HoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos)
|
|||||||
if (!m_modelManager)
|
if (!m_modelManager)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QmlJSEditor::QmlJSTextEditorWidget *qmlEditor = qobject_cast<QmlJSEditor::QmlJSTextEditorWidget *>(editor->widget());
|
QmlJSTextEditorWidget *qmlEditor = qobject_cast<QmlJSTextEditorWidget *>(editor->widget());
|
||||||
if (!qmlEditor)
|
if (!qmlEditor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -256,7 +257,7 @@ void HoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos)
|
|||||||
setQmlHelpItem(scopeChain, qmlDocument, node);
|
setQmlHelpItem(scopeChain, qmlDocument, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HoverHandler::matchDiagnosticMessage(QmlJSEditor::QmlJSTextEditorWidget *qmlEditor, int pos)
|
bool HoverHandler::matchDiagnosticMessage(QmlJSTextEditorWidget *qmlEditor, int pos)
|
||||||
{
|
{
|
||||||
foreach (const QTextEdit::ExtraSelection &sel,
|
foreach (const QTextEdit::ExtraSelection &sel,
|
||||||
qmlEditor->extraSelections(TextEditor::BaseTextEditorWidget::CodeWarningsSelection)) {
|
qmlEditor->extraSelections(TextEditor::BaseTextEditorWidget::CodeWarningsSelection)) {
|
||||||
@@ -521,3 +522,7 @@ bool HoverHandler::setQmlHelpItem(const ScopeChain &scopeChain,
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ private:
|
|||||||
virtual void identifyMatch(TextEditor::ITextEditor *editor, int pos);
|
virtual void identifyMatch(TextEditor::ITextEditor *editor, int pos);
|
||||||
virtual void operateTooltip(TextEditor::ITextEditor *editor, const QPoint &point);
|
virtual void operateTooltip(TextEditor::ITextEditor *editor, const QPoint &point);
|
||||||
|
|
||||||
bool matchDiagnosticMessage(QmlJSEditor::QmlJSTextEditorWidget *qmlEditor, int pos);
|
bool matchDiagnosticMessage(QmlJSTextEditorWidget *qmlEditor, int pos);
|
||||||
bool matchColorItem(const QmlJS::ScopeChain &lookupContext,
|
bool matchColorItem(const QmlJS::ScopeChain &lookupContext,
|
||||||
const QmlJS::Document::Ptr &qmlDocument,
|
const QmlJS::Document::Ptr &qmlDocument,
|
||||||
const QList<QmlJS::AST::Node *> &astPath,
|
const QList<QmlJS::AST::Node *> &astPath,
|
||||||
|
@@ -244,7 +244,7 @@ bool QmlJSOutlineWidget::syncCursor()
|
|||||||
|
|
||||||
bool QmlJSOutlineWidgetFactory::supportsEditor(Core::IEditor *editor) const
|
bool QmlJSOutlineWidgetFactory::supportsEditor(Core::IEditor *editor) const
|
||||||
{
|
{
|
||||||
if (qobject_cast<QmlJSEditorEditable*>(editor))
|
if (qobject_cast<QmlJSEditor*>(editor))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -253,7 +253,7 @@ TextEditor::IOutlineWidget *QmlJSOutlineWidgetFactory::createWidget(Core::IEdito
|
|||||||
{
|
{
|
||||||
QmlJSOutlineWidget *widget = new QmlJSOutlineWidget;
|
QmlJSOutlineWidget *widget = new QmlJSOutlineWidget;
|
||||||
|
|
||||||
QmlJSEditorEditable *qmlJSEditable = qobject_cast<QmlJSEditorEditable*>(editor);
|
QmlJSEditor *qmlJSEditable = qobject_cast<QmlJSEditor*>(editor);
|
||||||
QmlJSTextEditorWidget *qmlJSEditor = qobject_cast<QmlJSTextEditorWidget*>(qmlJSEditable->widget());
|
QmlJSTextEditorWidget *qmlJSEditor = qobject_cast<QmlJSTextEditorWidget*>(qmlJSEditable->widget());
|
||||||
Q_ASSERT(qmlJSEditor);
|
Q_ASSERT(qmlJSEditor);
|
||||||
|
|
||||||
|
@@ -42,11 +42,13 @@
|
|||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
using TextEditor::RefactoringChanges;
|
using TextEditor::RefactoringChanges;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
QmlJSQuickFixOperation::QmlJSQuickFixOperation(const QmlJSQuickFixInterface &interface,
|
QmlJSQuickFixOperation::QmlJSQuickFixOperation(const QmlJSQuickFixInterface &interface,
|
||||||
int priority)
|
int priority)
|
||||||
: QuickFixOperation(priority)
|
: QuickFixOperation(priority)
|
||||||
@@ -79,3 +81,5 @@ void QmlJSQuickFixFactory::matchingOperations(const QuickFixInterface &interface
|
|||||||
{
|
{
|
||||||
match(interface.staticCast<const QmlJSQuickFixAssistInterface>(), result);
|
match(interface.staticCast<const QmlJSQuickFixAssistInterface>(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -35,11 +35,13 @@
|
|||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace Internal;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
// -----------------------
|
// -----------------------
|
||||||
// QuickFixAssistInterface
|
// QuickFixAssistInterface
|
||||||
// -----------------------
|
// -----------------------
|
||||||
@@ -107,7 +109,9 @@ IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor() const
|
|||||||
QList<QuickFixFactory *> QmlJSQuickFixAssistProvider::quickFixFactories() const
|
QList<QuickFixFactory *> QmlJSQuickFixAssistProvider::quickFixFactories() const
|
||||||
{
|
{
|
||||||
QList<TextEditor::QuickFixFactory *> results;
|
QList<TextEditor::QuickFixFactory *> results;
|
||||||
foreach (QmlJSQuickFixFactory *f, ExtensionSystem::PluginManager::getObjects<QmlJSEditor::QmlJSQuickFixFactory>())
|
foreach (QmlJSQuickFixFactory *f, ExtensionSystem::PluginManager::getObjects<QmlJSQuickFixFactory>())
|
||||||
results.append(f);
|
results.append(f);
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -42,11 +42,13 @@
|
|||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
using TextEditor::RefactoringChanges;
|
using TextEditor::RefactoringChanges;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -179,3 +181,5 @@ void registerQuickFixes(ExtensionSystem::IPlugin *plugIn)
|
|||||||
plugIn->addAutoReleasedObject(new WrapInLoader);
|
plugIn->addAutoReleasedObject(new WrapInLoader);
|
||||||
plugIn->addAutoReleasedObject(new AddAnalysisMessageSuppressionComment);
|
plugIn->addAutoReleasedObject(new AddAnalysisMessageSuppressionComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -51,11 +51,13 @@
|
|||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
#include <QRunnable>
|
#include <QRunnable>
|
||||||
|
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -624,3 +626,5 @@ int SemanticHighlighter::startRevision() const
|
|||||||
{
|
{
|
||||||
return m_startRevision;
|
return m_startRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
@@ -44,10 +44,12 @@
|
|||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
using namespace QmlJS::AST;
|
using namespace QmlJS::AST;
|
||||||
using namespace QmlJSEditor;
|
|
||||||
using namespace QmlJSEditor::Internal;
|
|
||||||
using namespace QmlJSTools;
|
using namespace QmlJSTools;
|
||||||
|
|
||||||
|
namespace QmlJSEditor {
|
||||||
|
|
||||||
|
using namespace Internal;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class FindIds : protected Visitor
|
class FindIds : protected Visitor
|
||||||
@@ -191,3 +193,5 @@ void WrapInLoader::match(const QmlJSQuickFixInterface &interface, QuickFixOperat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlJSEditor
|
||||||
|
Reference in New Issue
Block a user