Clang: Move unexported classes to Internal

Change-Id: I3ea197b734f146d4b11431aaf927aed9be7d8756
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-02-06 16:17:03 +01:00
parent caf6755426
commit 0f8612f20f
19 changed files with 48 additions and 19 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -30,12 +30,13 @@
#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(
ClangEditorDocumentProcessor *processor = ClangEditorDocumentProcessor::get(
data.filePath().toString());
const int startRevision = data.cursor().document()->revision();
@@ -79,4 +80,5 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
m_watcher->setFuture(cursorFuture);
}
}
} // namespace Internal
} // namespace ClangCodeModel

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -34,7 +34,7 @@
#include <QVector>
using ClangBackEnd::FixItContainer;
using ClangCodeModel::ClangFixItOperation;
using ClangCodeModel::Internal::ClangFixItOperation;
using ::testing::PrintToString;

View File

@@ -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();