diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-02-06 16:17:03 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-02-19 14:09:43 +0000 |
commit | 0f8612f20fba99c8dddbdd1d089756dca0255d9f (patch) | |
tree | d88480faa8197d9649020486a20a91c86bccb462 | |
parent | caf675542613c3d8cd2a749a76a3fa2fa2395aee (diff) |
Clang: Move unexported classes to Internal
Change-Id: I3ea197b734f146d4b11431aaf927aed9be7d8756
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
19 files changed, 48 insertions, 19 deletions
diff --git a/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp index 951c6efd53..702d4557b6 100644 --- a/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp +++ b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp @@ -48,6 +48,7 @@ #include <QRegularExpression> namespace ClangCodeModel { +namespace Internal { ClangCurrentDocumentFilter::ClangCurrentDocumentFilter() { @@ -108,7 +109,6 @@ QList<Core::LocatorFilterEntry> ClangCurrentDocumentFilter::matchesFor( if (!regexp.isValid()) return goodEntries; - using Internal::ClangEditorDocumentProcessor; ClangEditorDocumentProcessor *processor = ClangEditorDocumentProcessor::get(m_currentPath); if (!processor) return goodEntries; @@ -170,4 +170,5 @@ void ClangCurrentDocumentFilter::onCurrentEditorChanged(Core::IEditor *newCurren reset(); } +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h index e355862bdf..891905fbda 100644 --- a/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h +++ b/src/plugins/clangcodemodel/clangcurrentdocumentfilter.h @@ -30,6 +30,7 @@ namespace Core { class IEditor; } namespace ClangCodeModel { +namespace Internal { class ClangCurrentDocumentFilter : public Core::ILocatorFilter { @@ -53,4 +54,5 @@ private: QString m_currentPath; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp b/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp index af8c13e76d..f2e52c1fd0 100644 --- a/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp +++ b/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp @@ -46,6 +46,7 @@ using namespace ClangCodeModel; using Internal::ClangDiagnosticWidget; +using Internal::ClangFixItOperation; namespace { @@ -87,7 +88,7 @@ void openEditorAt(const ClangBackEnd::DiagnosticContainer &diagnostic) void applyFixit(const ClangBackEnd::DiagnosticContainer &diagnostic) { - ClangCodeModel::ClangFixItOperation operation(Utf8String(), diagnostic.fixIts); + ClangFixItOperation operation(Utf8String(), diagnostic.fixIts); operation.perform(); } diff --git a/src/plugins/clangcodemodel/clangeditordocumentparser.cpp b/src/plugins/clangcodemodel/clangeditordocumentparser.cpp index 0d4195c538..b892f39364 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentparser.cpp +++ b/src/plugins/clangcodemodel/clangeditordocumentparser.cpp @@ -26,6 +26,7 @@ #include "clangeditordocumentparser.h" namespace ClangCodeModel { +namespace Internal { ClangEditorDocumentParser::ClangEditorDocumentParser(const QString &filePath) : BaseEditorDocumentParser(filePath) @@ -46,4 +47,5 @@ void ClangEditorDocumentParser::updateImpl(const QFutureInterface<void> &, setState(state_); } +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangeditordocumentparser.h b/src/plugins/clangcodemodel/clangeditordocumentparser.h index 28dd52a46a..a5b2ff27bf 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentparser.h +++ b/src/plugins/clangcodemodel/clangeditordocumentparser.h @@ -28,6 +28,7 @@ #include <cpptools/baseeditordocumentparser.h> namespace ClangCodeModel { +namespace Internal { class ClangEditorDocumentParser : public CppTools::BaseEditorDocumentParser { @@ -41,4 +42,5 @@ private: const UpdateParams &updateParams) override; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangfixitoperation.cpp b/src/plugins/clangcodemodel/clangfixitoperation.cpp index b123c9af45..a7170dc881 100644 --- a/src/plugins/clangcodemodel/clangfixitoperation.cpp +++ b/src/plugins/clangcodemodel/clangfixitoperation.cpp @@ -32,6 +32,7 @@ #include <QTextDocument> namespace ClangCodeModel { +namespace Internal { using FileToFixits = QMap<QString, QVector<ClangBackEnd::FixItContainer>>; using FileToFixitsIterator = QMapIterator<QString, QVector<ClangBackEnd::FixItContainer>>; @@ -50,7 +51,7 @@ int ClangFixItOperation::priority() const return 10; } -QString ClangCodeModel::ClangFixItOperation::description() const +QString ClangFixItOperation::description() const { return QStringLiteral("Apply Fix: ") + fixItText.toString(); } @@ -120,5 +121,5 @@ Utils::ChangeSet ClangFixItOperation::toChangeSet( return changeSet; } +} // namespace Internal } // namespace ClangCodeModel - diff --git a/src/plugins/clangcodemodel/clangfixitoperation.h b/src/plugins/clangcodemodel/clangfixitoperation.h index 4f37f3d479..7caf0cf652 100644 --- a/src/plugins/clangcodemodel/clangfixitoperation.h +++ b/src/plugins/clangcodemodel/clangfixitoperation.h @@ -34,13 +34,13 @@ #include <QVector> #include <QSharedPointer> -namespace TextEditor -{ +namespace TextEditor { class RefactoringChanges; class RefactoringFile; } namespace ClangCodeModel { +namespace Internal { class ClangFixItOperation : public TextEditor::QuickFixOperation { @@ -67,4 +67,5 @@ private: QVector<ClangBackEnd::FixItContainer> fixItContainers; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp b/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp index 8ec6496794..981a679a9b 100644 --- a/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp +++ b/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp @@ -72,6 +72,7 @@ bool hasFixItAt(const QVector<ClangBackEnd::FixItContainer> &fixits, } // anonymous namespace namespace ClangCodeModel { +namespace Internal { ClangFixItOperationsExtractor::ClangFixItOperationsExtractor( const QVector<DiagnosticContainer> &diagnosticContainers) @@ -114,4 +115,5 @@ void ClangFixItOperationsExtractor::extractFromDiagnostic( } } +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangfixitoperationsextractor.h b/src/plugins/clangcodemodel/clangfixitoperationsextractor.h index ee2da9a4b2..77b5643f8b 100644 --- a/src/plugins/clangcodemodel/clangfixitoperationsextractor.h +++ b/src/plugins/clangcodemodel/clangfixitoperationsextractor.h @@ -30,6 +30,7 @@ #include <clangsupport/diagnosticcontainer.h> namespace ClangCodeModel { +namespace Internal { class ClangFixItOperationsExtractor { @@ -50,4 +51,5 @@ private: TextEditor::QuickFixOperations operations; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp b/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp index 27eeea1af4..46bdbc33ea 100644 --- a/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp +++ b/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp @@ -144,6 +144,7 @@ TextEditor::HighlightingResult toHighlightingResult( } // anonymous namespace ClangCodeModel { +namespace Internal { HighlightingResultReporter::HighlightingResultReporter( const QVector<ClangBackEnd::TokenInfoContainer> &tokenInfos) @@ -219,4 +220,5 @@ QFuture<TextEditor::HighlightingResult> HighlightingResultReporter::start() return future; } +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clanghighlightingresultreporter.h b/src/plugins/clangcodemodel/clanghighlightingresultreporter.h index 0f57bc10d8..2c6e7a89a8 100644 --- a/src/plugins/clangcodemodel/clanghighlightingresultreporter.h +++ b/src/plugins/clangcodemodel/clanghighlightingresultreporter.h @@ -35,6 +35,7 @@ #include <clangsupport/tokeninfocontainer.h> namespace ClangCodeModel { +namespace Internal { class HighlightingResultReporter: public QObject, @@ -67,4 +68,5 @@ private: unsigned m_flushLine = 0; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.cpp b/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.cpp index 07fdaba9e5..72c6c2dd09 100644 --- a/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.cpp +++ b/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.cpp @@ -30,6 +30,7 @@ #include <cplusplus/Token.h> namespace ClangCodeModel { +namespace Internal { bool ClangPreprocessorAssistProposalItem::prematurelyApplies(const QChar &typedCharacter) const { @@ -156,4 +157,5 @@ bool ClangPreprocessorAssistProposalItem::isInclude() const || m_completionOperator == CPlusPlus::T_ANGLE_STRING_LITERAL; } +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h b/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h index cbdb5383b0..1a5ee440a0 100644 --- a/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h +++ b/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h @@ -31,6 +31,7 @@ #include <QString> namespace ClangCodeModel { +namespace Internal { class ClangPreprocessorAssistProposalItem final : public TextEditor::AssistProposalItemInterface { @@ -68,4 +69,5 @@ private: mutable QChar m_typedCharacter; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangrefactoringengine.cpp b/src/plugins/clangcodemodel/clangrefactoringengine.cpp index bb985a650e..ed9af84d66 100644 --- a/src/plugins/clangcodemodel/clangrefactoringengine.cpp +++ b/src/plugins/clangcodemodel/clangrefactoringengine.cpp @@ -30,13 +30,14 @@ #include <utils/qtcassert.h> namespace ClangCodeModel { +namespace Internal { void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data, CppTools::ProjectPart *, RenameCallback &&renameSymbolsCallback) { - Internal::ClangEditorDocumentProcessor *processor = Internal::ClangEditorDocumentProcessor::get( - data.filePath().toString()); + ClangEditorDocumentProcessor *processor = ClangEditorDocumentProcessor::get( + data.filePath().toString()); const int startRevision = data.cursor().document()->revision(); using ClangBackEnd::SourceLocationsContainer; @@ -79,4 +80,5 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data, m_watcher->setFuture(cursorFuture); } -} +} // namespace Internal +} // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangrefactoringengine.h b/src/plugins/clangcodemodel/clangrefactoringengine.h index 79537f24df..297c8ff238 100644 --- a/src/plugins/clangcodemodel/clangrefactoringengine.h +++ b/src/plugins/clangcodemodel/clangrefactoringengine.h @@ -36,6 +36,7 @@ class RefactoringServerInterface; } namespace ClangCodeModel { +namespace Internal { class RefactoringEngine : public CppTools::RefactoringEngineInterface { @@ -60,4 +61,5 @@ private: std::unique_ptr<FutureCursorWatcher> m_watcher; }; +} // namespace Internal } // namespace ClangRefactoring diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index 61a4c7716c..ddeb862366 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -51,6 +51,7 @@ using namespace Utils; namespace ClangCodeModel { +namespace Internal { namespace { @@ -228,8 +229,6 @@ void ClangTextMark::updateIcon(bool valid) bool ClangTextMark::addToolTipContent(QLayout *target) const { - using Internal::ClangDiagnosticWidget; - QWidget *widget = ClangDiagnosticWidget::createWidget({m_diagnostic}, ClangDiagnosticWidget::ToolTip); target->addWidget(widget); @@ -243,5 +242,6 @@ void ClangTextMark::removedFromEditor() m_removedFromEditorHandler(this); } +} // namespace Internal } // namespace ClangCodeModel diff --git a/src/plugins/clangcodemodel/clangtextmark.h b/src/plugins/clangcodemodel/clangtextmark.h index 00cadfb5c8..ae67bcef86 100644 --- a/src/plugins/clangcodemodel/clangtextmark.h +++ b/src/plugins/clangcodemodel/clangtextmark.h @@ -33,6 +33,7 @@ #include <functional> namespace ClangCodeModel { +namespace Internal { class ClangTextMark : public TextEditor::TextMark { @@ -56,4 +57,5 @@ private: RemovedFromEditorHandler m_removedFromEditorHandler; }; +} // namespace Internal } // namespace ClangCodeModel diff --git a/tests/unit/unittest/clangfixitoperation-test.cpp b/tests/unit/unittest/clangfixitoperation-test.cpp index 21b250fdeb..e8fa178014 100644 --- a/tests/unit/unittest/clangfixitoperation-test.cpp +++ b/tests/unit/unittest/clangfixitoperation-test.cpp @@ -34,7 +34,7 @@ #include <QVector> using ClangBackEnd::FixItContainer; -using ClangCodeModel::ClangFixItOperation; +using ClangCodeModel::Internal::ClangFixItOperation; using ::testing::PrintToString; diff --git a/tests/unit/unittest/highlightingresultreporter-test.cpp b/tests/unit/unittest/highlightingresultreporter-test.cpp index 29803783b1..dfe8dfbd2e 100644 --- a/tests/unit/unittest/highlightingresultreporter-test.cpp +++ b/tests/unit/unittest/highlightingresultreporter-test.cpp @@ -43,6 +43,7 @@ using ClangBackEnd::Document; using ClangBackEnd::Documents; using ClangBackEnd::UnsavedFiles; using ClangBackEnd::ChunksReportedMonitor; +using ClangCodeModel::Internal::HighlightingResultReporter; namespace { @@ -86,7 +87,7 @@ QVector<TokenInfoContainer> generateTokenInfos(uint count) TEST_F(HighlightingResultReporter, StartAndFinish) { - auto reporter = new ClangCodeModel::HighlightingResultReporter(noTokenInfos()); + auto reporter = new ::HighlightingResultReporter(noTokenInfos()); auto future = reporter->start(); @@ -96,7 +97,7 @@ TEST_F(HighlightingResultReporter, StartAndFinish) TEST_F(HighlightingResultReporter, ReportNothingIfNothingToReport) { - auto reporter = new ClangCodeModel::HighlightingResultReporter(generateTokenInfos(0)); + auto reporter = new ::HighlightingResultReporter(generateTokenInfos(0)); auto future = reporter->start(); @@ -106,7 +107,7 @@ TEST_F(HighlightingResultReporter, ReportNothingIfNothingToReport) TEST_F(HighlightingResultReporter, ReportSingleResultAsOneChunk) { - auto reporter = new ClangCodeModel::HighlightingResultReporter(generateTokenInfos(1)); + auto reporter = new ::HighlightingResultReporter(generateTokenInfos(1)); reporter->setChunkSize(1); auto future = reporter->start(); @@ -117,7 +118,7 @@ TEST_F(HighlightingResultReporter, ReportSingleResultAsOneChunk) TEST_F(HighlightingResultReporter, ReportRestIfChunkSizeNotReached) { - auto reporter = new ClangCodeModel::HighlightingResultReporter(generateTokenInfos(1)); + auto reporter = new ::HighlightingResultReporter(generateTokenInfos(1)); const int notReachedChunkSize = 100; reporter->setChunkSize(notReachedChunkSize); @@ -129,7 +130,7 @@ TEST_F(HighlightingResultReporter, ReportRestIfChunkSizeNotReached) TEST_F(HighlightingResultReporter, ReportChunksWithoutRest) { - auto reporter = new ClangCodeModel::HighlightingResultReporter(generateTokenInfos(4)); + auto reporter = new ::HighlightingResultReporter(generateTokenInfos(4)); reporter->setChunkSize(1); auto future = reporter->start(); @@ -140,7 +141,7 @@ TEST_F(HighlightingResultReporter, ReportChunksWithoutRest) TEST_F(HighlightingResultReporter, ReportSingleChunkAndRest) { - auto reporter = new ClangCodeModel::HighlightingResultReporter(generateTokenInfos(5)); + auto reporter = new ::HighlightingResultReporter(generateTokenInfos(5)); reporter->setChunkSize(2); auto future = reporter->start(); @@ -158,7 +159,7 @@ TEST_F(HighlightingResultReporter, ReportCompleteLines) TokenInfoContainer(1, 2, 1, types), TokenInfoContainer(2, 1, 1, types), }; - auto reporter = new ClangCodeModel::HighlightingResultReporter(tokenInfos); + auto reporter = new ::HighlightingResultReporter(tokenInfos); reporter->setChunkSize(1); auto future = reporter->start(); |