ClangCodeModel: Remove some unused functions

Change-Id: Ibaab69aaab66998d1975663d1a1824d89aaa23a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-05-02 16:33:55 +02:00
parent f5c255e04c
commit 026126eed0
2 changed files with 0 additions and 63 deletions

View File

@@ -72,60 +72,6 @@ ProjectPart::ConstPtr projectPartForFile(const QString &filePath)
return ProjectPart::ConstPtr();
}
ProjectPart::ConstPtr projectPartForFileBasedOnProcessor(const QString &filePath)
{
if (const auto processor = ClangEditorDocumentProcessor::get(filePath))
return processor->projectPart();
return ProjectPart::ConstPtr();
}
bool isProjectPartLoaded(const ProjectPart::ConstPtr projectPart)
{
if (projectPart)
return !CppModelManager::instance()->projectPartForId(projectPart->id()).isNull();
return false;
}
QString projectPartIdForFile(const QString &filePath)
{
const ProjectPart::ConstPtr projectPart = projectPartForFile(filePath);
if (isProjectPartLoaded(projectPart))
return projectPart->id(); // OK, Project Part is still loaded
return QString();
}
CppEditorDocumentHandle *cppDocument(const QString &filePath)
{
return CppEditor::CppModelManager::instance()->cppEditorDocument(filePath);
}
void setLastSentDocumentRevision(const QString &filePath, uint revision)
{
if (CppEditorDocumentHandle *document = cppDocument(filePath))
document->sendTracker().setLastSentRevision(int(revision));
}
int clangColumn(const QTextBlock &line, int cppEditorColumn)
{
// (1) cppEditorColumn is the actual column shown by CppEditor.
// (2) The return value is the column in Clang which is the utf8 byte offset from the beginning
// of the line.
// Here we convert column from (1) to (2).
// '- 1' and '+ 1' are because of 1-based columns
return line.text().left(cppEditorColumn - 1).toUtf8().size() + 1;
}
int cppEditorColumn(const QTextBlock &line, int clangColumn)
{
// (1) clangColumn is the column in Clang which is the utf8 byte offset from the beginning
// of the line.
// (2) The return value is the actual column shown by CppEditor.
// Here we convert column from (1) to (2).
// '- 1' and '+ 1' are because of 1-based columns
return QString::fromUtf8(line.text().toUtf8().left(clangColumn - 1)).size() + 1;
}
QString diagnosticCategoryPrefixRemoved(const QString &text)
{
QString theText = text;

View File

@@ -51,9 +51,6 @@ namespace ProjectExplorer { class Project; }
namespace ClangCodeModel {
namespace Internal {
CppEditor::CppEditorDocumentHandle *cppDocument(const QString &filePath);
void setLastSentDocumentRevision(const QString &filePath, uint revision);
CppEditor::ClangDiagnosticConfig warningsConfigForProject(ProjectExplorer::Project *project);
const QStringList optionsForProject(ProjectExplorer::Project *project,
const CppEditor::ClangDiagnosticConfig &warningsConfig);
@@ -72,11 +69,6 @@ QJsonArray clangOptionsForFile(const CppEditor::ProjectFile &file,
CppEditor::UsePrecompiledHeaders usePch);
CppEditor::ProjectPart::ConstPtr projectPartForFile(const QString &filePath);
CppEditor::ProjectPart::ConstPtr projectPartForFileBasedOnProcessor(const QString &filePath);
bool isProjectPartLoaded(const CppEditor::ProjectPart::ConstPtr projectPart);
QString projectPartIdForFile(const QString &filePath);
int clangColumn(const QTextBlock &line, int cppEditorColumn);
int cppEditorColumn(const QTextBlock &line, int clangColumn);
QString currentCppEditorDocumentFilePath();
@@ -235,6 +227,5 @@ inline bool operator!=(const ClangDiagnostic &first, const ClangDiagnostic &seco
return !(first == second);
}
} // namespace Internal
} // namespace Clang