diff --git a/src/plugins/qmljseditor/qmljscompletionassist.h b/src/plugins/qmljseditor/qmljscompletionassist.h index df697ef5e1d..844e3b42d82 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.h +++ b/src/plugins/qmljseditor/qmljscompletionassist.h @@ -46,6 +46,7 @@ namespace QmlJS { class Value; } namespace QmlJSEditor { class QmlJSCompletionAssistInterface; +class QmlJSCompletionAssistProvider; namespace Internal { @@ -72,19 +73,6 @@ public: }; -class QmlJSCompletionAssistProvider : public TextEditor::CompletionAssistProvider -{ - Q_OBJECT - -public: - TextEditor::IAssistProcessor *createProcessor() const override; - - int activationCharSequenceLength() const override; - bool isActivationCharSequence(const QString &sequence) const override; - bool isContinuationChar(const QChar &c) const override; -}; - - class QmlJSCompletionAssistProcessor : public TextEditor::IAssistProcessor { public: @@ -131,6 +119,20 @@ private: QmlJSTools::SemanticInfo m_semanticInfo; }; + +class QMLJSEDITOR_EXPORT QmlJSCompletionAssistProvider : public TextEditor::CompletionAssistProvider +{ + Q_OBJECT + +public: + TextEditor::IAssistProcessor *createProcessor() const override; + + int activationCharSequenceLength() const override; + bool isActivationCharSequence(const QString &sequence) const override; + bool isContinuationChar(const QChar &c) const override; +}; + + QStringList QMLJSEDITOR_EXPORT qmlJSAutoComplete(QTextDocument *textDocument, int position, const QString &fileName, diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index c08e7bed49b..c8535a6d7d3 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -102,7 +102,6 @@ using namespace QmlJSTools; using namespace TextEditor; namespace QmlJSEditor { -namespace Internal { // // QmlJSEditorWidget @@ -132,7 +131,7 @@ void QmlJSEditorWidget::finalizeInitialization() textDocument()->setCodec(QTextCodec::codecForName("UTF-8")); // qml files are defined to be utf-8 m_modelManager = ModelManagerInterface::instance(); - m_contextPane = QmlJSEditorPlugin::quickToolBar(); + m_contextPane = Internal::QmlJSEditorPlugin::quickToolBar(); m_modelManager->activateScan(); @@ -269,12 +268,11 @@ void QmlJSEditorWidget::updateOutlineIndexNow() m_outlineCombo->setRootModelIndex(QModelIndex()); } } -} // namespace Internal + } // namespace QmlJSEditor namespace QmlJSEditor { -namespace Internal { void QmlJSEditorWidget::updateContextPane() { @@ -507,7 +505,7 @@ void QmlJSEditorWidget::createToolBar() auto itemDelegate = new Utils::AnnotatedItemDelegate(this); itemDelegate->setDelimiter(QLatin1String(" ")); - itemDelegate->setAnnotationRole(QmlOutlineModel::AnnotationRole); + itemDelegate->setAnnotationRole(Internal::QmlOutlineModel::AnnotationRole); treeView->setItemDelegateForColumn(0, itemDelegate); treeView->header()->hide(); @@ -525,7 +523,7 @@ void QmlJSEditorWidget::createToolBar() connect(m_outlineCombo, QOverload::of(&QComboBox::activated), this, &QmlJSEditorWidget::jumpToOutlineElement); - connect(m_qmlJsEditorDocument->outlineModel(), &QmlOutlineModel::updated, + connect(m_qmlJsEditorDocument->outlineModel(), &Internal::QmlOutlineModel::updated, static_cast(m_outlineCombo->view()), &QTreeView::expandAll); connect(this, &QmlJSEditorWidget::cursorPositionChanged, @@ -830,7 +828,7 @@ void QmlJSEditorWidget::contextMenuEvent(QContextMenuEvent *e) AssistInterface *interface = createAssistInterface(QuickFix, ExplicitlyInvoked); if (interface) { QScopedPointer processor( - QmlJSEditorPlugin::quickFixAssistProvider()->createProcessor()); + Internal::QmlJSEditorPlugin::quickFixAssistProvider()->createProcessor()); QScopedPointer proposal(processor->perform(interface)); if (!proposal.isNull()) { GenericProposalModelPtr model = proposal->model().staticCast(); @@ -939,7 +937,7 @@ QModelIndex QmlJSEditorWidget::indexForPosition(unsigned cursorPosition, const Q { QModelIndex lastIndex = rootIndex; - QmlOutlineModel *model = m_qmlJsEditorDocument->outlineModel(); + Internal::QmlOutlineModel *model = m_qmlJsEditorDocument->outlineModel(); const int rowCount = model->rowCount(rootIndex); for (int i = 0; i < rowCount; ++i) { QModelIndex childIndex = model->index(i, 0, rootIndex); @@ -979,7 +977,7 @@ AssistInterface *QmlJSEditorWidget::createAssistInterface( reason, m_qmlJsEditorDocument->semanticInfo()); } else if (assistKind == QuickFix) { - return new QmlJSQuickFixAssistInterface(const_cast(this), reason); + return new Internal::QmlJSQuickFixAssistInterface(const_cast(this), reason); } return nullptr; } @@ -1043,7 +1041,7 @@ QmlJSEditorFactory::QmlJSEditorFactory() setDocumentCreator([]() { return new QmlJSEditorDocument; }); setEditorWidgetCreator([]() { return new QmlJSEditorWidget; }); setEditorCreator([]() { return new QmlJSEditor; }); - setAutoCompleterCreator([]() { return new AutoCompleter; }); + setAutoCompleterCreator([]() { return new Internal::AutoCompleter; }); setCommentDefinition(Utils::CommentDefinition::CppStyle); setParenthesesMatchingEnabled(true); setCodeFoldingSupported(true); @@ -1060,9 +1058,8 @@ QmlJSEditorFactory::QmlJSEditorFactory() void QmlJSEditorFactory::decorateEditor(TextEditorWidget *editor) { editor->textDocument()->setSyntaxHighlighter(new QmlJSHighlighter); - editor->textDocument()->setIndenter(new Indenter(editor->textDocument()->document())); - editor->setAutoCompleter(new AutoCompleter); + editor->textDocument()->setIndenter(new Internal::Indenter(editor->textDocument()->document())); + editor->setAutoCompleter(new Internal::AutoCompleter); } -} // namespace Internal } // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 7b6b6c096b2..6858a0203cb 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -52,9 +52,7 @@ class QmlJSEditorDocument; class QuickToolBar; class FindReferences; -namespace Internal { - -class QmlJSEditorWidget : public TextEditor::TextEditorWidget +class QMLJSEDITOR_EXPORT QmlJSEditorWidget : public TextEditor::TextEditorWidget { Q_OBJECT @@ -131,7 +129,7 @@ private: }; -class QmlJSEditor : public TextEditor::BaseTextEditor +class QMLJSEDITOR_EXPORT QmlJSEditor : public TextEditor::BaseTextEditor { Q_OBJECT @@ -141,7 +139,7 @@ public: bool isDesignModePreferred() const override; }; -class QmlJSEditorFactory : public TextEditor::TextEditorFactory +class QMLJSEDITOR_EXPORT QmlJSEditorFactory : public TextEditor::TextEditorFactory { Q_OBJECT @@ -151,5 +149,4 @@ public: static void decorateEditor(TextEditor::TextEditorWidget *editor); }; -} // namespace Internal } // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmljseditordocument_p.h b/src/plugins/qmljseditor/qmljseditordocument_p.h index 22912263ceb..611c4254fa1 100644 --- a/src/plugins/qmljseditor/qmljseditordocument_p.h +++ b/src/plugins/qmljseditor/qmljseditordocument_p.h @@ -37,11 +37,12 @@ namespace TextEditor { class TextMark; } namespace QmlJSEditor { class QmlJSEditorDocument; +class SemanticHighlighter; namespace Internal { class QmlOutlineModel; -class SemanticHighlighter; + class SemanticInfoUpdater; class QmlJSEditorDocumentPrivate : public QObject @@ -72,7 +73,7 @@ public: SemanticInfoUpdater *m_semanticInfoUpdater; QmlJSTools::SemanticInfo m_semanticInfo; QVector m_diagnosticRanges; - Internal::SemanticHighlighter *m_semanticHighlighter = nullptr; + SemanticHighlighter *m_semanticHighlighter = nullptr; bool m_semanticHighlightingNecessary = false; bool m_outlineModelNeedsUpdate = false; bool m_firstSementicInfo = true; diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index 9cea65e3ef3..cf73d63d7c6 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -59,7 +59,6 @@ using namespace QmlJS; using namespace TextEditor; namespace QmlJSEditor { -namespace Internal { namespace { @@ -517,6 +516,5 @@ bool QmlJSHoverHandler::setQmlHelpItem(const ScopeChain &scopeChain, return false; } -} // namespace Internal } // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmljshoverhandler.h b/src/plugins/qmljseditor/qmljshoverhandler.h index be51f6c53b4..afe35c29714 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.h +++ b/src/plugins/qmljseditor/qmljshoverhandler.h @@ -25,6 +25,7 @@ #pragma once +#include #include #include @@ -44,11 +45,10 @@ class ObjectValue; } namespace QmlJSEditor { -namespace Internal { class QmlJSEditorWidget; -class QmlJSHoverHandler : public TextEditor::BaseHoverHandler +class QMLJSEDITOR_EXPORT QmlJSHoverHandler : public TextEditor::BaseHoverHandler { Q_DECLARE_TR_FUNCTIONS(QmlJSHoverHandler) @@ -86,5 +86,4 @@ private: QColor m_colorTip; }; -} // namespace Internal } // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmljsoutline.h b/src/plugins/qmljseditor/qmljsoutline.h index 1e4b1d20d15..b81e9f39ce0 100644 --- a/src/plugins/qmljseditor/qmljsoutline.h +++ b/src/plugins/qmljseditor/qmljsoutline.h @@ -38,9 +38,11 @@ namespace Core { class IEditor; } namespace QmlJS { class Editor; } namespace QmlJSEditor { -namespace Internal { class QmlJSEditorWidget; + +namespace Internal { + class QmlJSOutlineTreeView; class QmlJSOutlineFilterModel : public QSortFilterProxyModel diff --git a/src/plugins/qmljseditor/qmljsquickfixassist.h b/src/plugins/qmljseditor/qmljsquickfixassist.h index 83d328fc807..21aaf46073f 100644 --- a/src/plugins/qmljseditor/qmljsquickfixassist.h +++ b/src/plugins/qmljseditor/qmljsquickfixassist.h @@ -32,10 +32,11 @@ #include namespace QmlJSEditor { -namespace Internal { class QmlJSEditorWidget; +namespace Internal { + class QmlJSQuickFixAssistInterface : public TextEditor::AssistInterface { public: diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp index 63c2361339b..034c1b13017 100644 --- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp +++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp @@ -54,8 +54,6 @@ using namespace QmlJS::AST; namespace QmlJSEditor { -using namespace Internal; - namespace { static bool isIdScope(const ObjectValue *scope, const QList &chain) diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.h b/src/plugins/qmljseditor/qmljssemantichighlighter.h index 42525c7385b..7fa25b588fd 100644 --- a/src/plugins/qmljseditor/qmljssemantichighlighter.h +++ b/src/plugins/qmljseditor/qmljssemantichighlighter.h @@ -25,6 +25,7 @@ #pragma once +#include #include #include #include @@ -42,9 +43,7 @@ namespace QmlJSEditor { class QmlJSEditorDocument; -namespace Internal { - -class SemanticHighlighter : public QObject +class QMLJSEDITOR_EXPORT SemanticHighlighter : public QObject { Q_OBJECT public: @@ -92,5 +91,4 @@ private: QVector m_diagnosticRanges; }; -} // namespace Internal } // namespace QmlJSEditor