From b50eb35a1758b718e2009bb4bc5c180419103d25 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 1 Apr 2022 07:35:08 +0200 Subject: [PATCH] Coco: long live the cocoplugin Change-Id: I1d21c67233d302a0689c4689bf9c2f349387ba1c Reviewed-by: Christian Stenger Reviewed-by: Reviewed-by: Eike Ziller Reviewed-by: hjk --- src/plugins/CMakeLists.txt | 1 + src/plugins/coco/CMakeLists.txt | 7 + src/plugins/coco/Coco.json.in | 19 ++ src/plugins/coco/coco.qbs | 21 ++ src/plugins/coco/cocolanguageclient.cpp | 228 ++++++++++++++++++ src/plugins/coco/cocolanguageclient.h | 50 ++++ src/plugins/coco/cocoplugin.cpp | 125 ++++++++++ src/plugins/coco/cocoplugin.h | 48 ++++ .../languageclient/diagnosticmanager.cpp | 8 +- src/plugins/plugins.qbs | 1 + .../texteditor/texteditorconstants.cpp | 12 + src/plugins/texteditor/texteditorconstants.h | 11 + src/plugins/texteditor/texteditorsettings.cpp | 41 ++++ 13 files changed, 570 insertions(+), 2 deletions(-) create mode 100644 src/plugins/coco/CMakeLists.txt create mode 100644 src/plugins/coco/Coco.json.in create mode 100644 src/plugins/coco/coco.qbs create mode 100644 src/plugins/coco/cocolanguageclient.cpp create mode 100644 src/plugins/coco/cocolanguageclient.h create mode 100644 src/plugins/coco/cocoplugin.cpp create mode 100644 src/plugins/coco/cocoplugin.h diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 8534fcab7f9..569bb9d7afb 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -61,6 +61,7 @@ add_subdirectory(languageclient) # Level 6: add_subdirectory(cmakeprojectmanager) add_subdirectory(debugger) +add_subdirectory(coco) # Level 7: add_subdirectory(android) diff --git a/src/plugins/coco/CMakeLists.txt b/src/plugins/coco/CMakeLists.txt new file mode 100644 index 00000000000..ee5685ccbbf --- /dev/null +++ b/src/plugins/coco/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qtc_plugin(Coco + PUBLIC_DEPENDS app_version + PLUGIN_DEPENDS Core LanguageClient + SOURCES + cocoplugin.cpp cocoplugin.h + cocolanguageclient.cpp cocolanguageclient.h +) diff --git a/src/plugins/coco/Coco.json.in b/src/plugins/coco/Coco.json.in new file mode 100644 index 00000000000..d4a16e34a65 --- /dev/null +++ b/src/plugins/coco/Coco.json.in @@ -0,0 +1,19 @@ +{ + \"Name\" : \"Coco\", + \"Version\" : \"$$QTCREATOR_VERSION\", + \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", + \"Experimental\" : true, + \"Vendor\" : \"The Qt Company Ltd\", + \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", + \"License\" : [ \"Commercial Usage\", + \"\", + \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", + \"\", + \"GNU General Public License Usage\", + \"\", + \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + ], + \"Description\" : \"Squish Coco support. Squish Coco is a code coverage tool for Tcl, QML, C# and C/C++.\", + \"Url\" : \"http://www.qt.io\", + $$dependencyList +} diff --git a/src/plugins/coco/coco.qbs b/src/plugins/coco/coco.qbs new file mode 100644 index 00000000000..3a771f27175 --- /dev/null +++ b/src/plugins/coco/coco.qbs @@ -0,0 +1,21 @@ +import qbs 1.0 + +QtcPlugin { + name: "Coco" + + Depends { name: "Core" } + Depends { name: "LanguageClient" } + Depends { name: "TextEditor" } + + Depends { name: "app_version_header" } + + Depends { name: "Qt"; submodules: ["widgets"] } + + files: [ + "cocoplugin.cpp", + "cocoplugin.h", + "cocolanguageclient.cpp", + "cocolanguageclient.h", + ] +} + diff --git a/src/plugins/coco/cocolanguageclient.cpp b/src/plugins/coco/cocolanguageclient.cpp new file mode 100644 index 00000000000..89c75d77d6d --- /dev/null +++ b/src/plugins/coco/cocolanguageclient.cpp @@ -0,0 +1,228 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "cocolanguageclient.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace LanguageClient; +using namespace LanguageServerProtocol; +using namespace Utils; +using namespace Core; + +namespace Coco { + +CocoLanguageClient::CocoLanguageClient(const FilePath &coco, const FilePath &csmes) + : Client(clientInterface(coco, csmes)) +{ + setName("Coco"); + setActivateDocumentAutomatically(false); + LanguageFilter allFiles; + allFiles.filePattern = QStringList{"*"}; + setSupportedLanguage(allFiles); + connect(EditorManager::instance(), + &EditorManager::documentOpened, + this, + &CocoLanguageClient::handleDocumentOpened); + connect(EditorManager::instance(), + &EditorManager::documentClosed, + this, + &CocoLanguageClient::handleDocumentClosed); + for (IDocument *openDocument : DocumentModel::openedDocuments()) + handleDocumentOpened(openDocument); + + ClientInfo info; + info.setName("CocoQtCreator"); + info.setVersion(Core::Constants::IDE_VERSION_DISPLAY); + setClientInfo(info); + + initClientCapabilities(); +} + +BaseClientInterface *CocoLanguageClient::clientInterface(const FilePath &coco, + const FilePath &csmes) +{ + auto interface = new StdIOClientInterface(); + interface->setCommandLine(CommandLine(coco, {"--lsp-stdio", "--debug", csmes.toUserOutput()})); + return interface; +} + +enum class CocoDiagnosticSeverity { + Error = 1, + Warning = 2, + Information = 3, + Hint = 4, + + CodeAdded = 100, + PartiallyCovered = 101, + NotCovered = 102, + FullyCovered = 103, + ManuallyValidated = 104, + DeadCode = 105, + ExecutionCountTooLow = 106, + NotCoveredInfo = 107, + CoveredInfo = 108, + ManuallyValidatedInfo = 109 +}; + +static TextEditor::TextStyle styleForSeverity(const CocoDiagnosticSeverity &severity) +{ + using namespace TextEditor; + switch (severity) { + case CocoDiagnosticSeverity::Error: return C_ERROR; + case CocoDiagnosticSeverity::Warning: return C_WARNING; + case CocoDiagnosticSeverity::Information: return C_WARNING; + case CocoDiagnosticSeverity::Hint: return C_WARNING; + case CocoDiagnosticSeverity::CodeAdded: return C_COCO_CODE_ADDED; + case CocoDiagnosticSeverity::PartiallyCovered: return C_COCO_PARTIALLY_COVERED; + case CocoDiagnosticSeverity::NotCovered: return C_COCO_NOT_COVERED; + case CocoDiagnosticSeverity::FullyCovered: return C_COCO_FULLY_COVERED; + case CocoDiagnosticSeverity::ManuallyValidated: return C_COCO_MANUALLY_VALIDATED; + case CocoDiagnosticSeverity::DeadCode: return C_COCO_DEAD_CODE; + case CocoDiagnosticSeverity::ExecutionCountTooLow: return C_COCO_EXECUTION_COUNT_TOO_LOW; + case CocoDiagnosticSeverity::NotCoveredInfo: return C_COCO_NOT_COVERED_INFO; + case CocoDiagnosticSeverity::CoveredInfo: return C_COCO_COVERED_INFO; + case CocoDiagnosticSeverity::ManuallyValidatedInfo: return C_COCO_MANUALLY_VALIDATED_INFO; + } + return C_TEXT; +} + +class CocoDiagnostic : public Diagnostic +{ +public: + using Diagnostic::Diagnostic; + optional cocoSeverity() const + { + if (auto val = optionalValue(severityKey)) + return Utils::make_optional(static_cast(*val)); + return Utils::nullopt; + } +}; + +class CocoTextMark : public TextEditor::TextMark +{ +public: + CocoTextMark(const FilePath &fileName, const CocoDiagnostic &diag, const Id &clientId) + : TextEditor::TextMark(fileName, diag.range().start().line() + 1, clientId) + { + setLineAnnotation(diag.message()); + setToolTip(diag.message()); + } +}; + +class CocoDiagnosticManager : public DiagnosticManager +{ +public: + CocoDiagnosticManager(Client *client) + : DiagnosticManager(client) + { + setExtraSelectionsId("CocoExtraSelections"); + } + +private: + TextEditor::TextMark *createTextMark(const FilePath &filePath, + const Diagnostic &diagnostic, + bool /*isProjectFile*/) const override + { + const CocoDiagnostic cocoDiagnostic(diagnostic); + if (optional severity = cocoDiagnostic.cocoSeverity()) + return new CocoTextMark(filePath, cocoDiagnostic, client()->id()); + return nullptr; + } + + QTextEdit::ExtraSelection createDiagnosticSelection(const Diagnostic &diagnostic, + QTextDocument *textDocument) const override + { + if (optional severity = CocoDiagnostic(diagnostic).cocoSeverity()) { + QTextCursor cursor(textDocument); + cursor.setPosition(diagnostic.range().start().toPositionInDocument(textDocument)); + cursor.setPosition(diagnostic.range().end().toPositionInDocument(textDocument), + QTextCursor::KeepAnchor); + + const TextEditor::TextStyle style = styleForSeverity(*severity); + const QTextCharFormat format = TextEditor::TextEditorSettings::fontSettings() + .toTextCharFormat(style); + return QTextEdit::ExtraSelection{cursor, format}; + } + return {}; + } + + void setDiagnostics(const DocumentUri &uri, + const QList &diagnostics, + const Utils::optional &version) override + { + DiagnosticManager::setDiagnostics(uri, diagnostics, version); + showDiagnostics(uri, client()->documentVersion(uri.toFilePath())); + } +}; + +DiagnosticManager *CocoLanguageClient::createDiagnosticManager() +{ + return new CocoDiagnosticManager(this); +} + +class CocoTextDocumentCapabilities : public TextDocumentClientCapabilities +{ +public: + using TextDocumentClientCapabilities::TextDocumentClientCapabilities; + void enableCodecoverageSupport() + { + JsonObject coverageSupport(QJsonObject{{"codeCoverageSupport", true}}); + insert("publishDiagnostics", coverageSupport); + } +}; + +void CocoLanguageClient::initClientCapabilities() +{ + ClientCapabilities capabilities = defaultClientCapabilities(); + CocoTextDocumentCapabilities textDocumentCapabilities( + capabilities.textDocument().value_or(TextDocumentClientCapabilities())); + textDocumentCapabilities.enableCodecoverageSupport(); + capabilities.setTextDocument(textDocumentCapabilities); + setClientCapabilities(capabilities); +} + +void CocoLanguageClient::handleDocumentOpened(IDocument *document) +{ + if (auto textDocument = qobject_cast(document)) + openDocument(textDocument); +} + +void CocoLanguageClient::handleDocumentClosed(IDocument *document) +{ + if (auto textDocument = qobject_cast(document)) + closeDocument(textDocument); +} + +} // namespace Coco diff --git a/src/plugins/coco/cocolanguageclient.h b/src/plugins/coco/cocolanguageclient.h new file mode 100644 index 00000000000..5fa75508d60 --- /dev/null +++ b/src/plugins/coco/cocolanguageclient.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include + +namespace Coco { + +class CocoLanguageClient : public LanguageClient::Client +{ +public: + CocoLanguageClient(const Utils::FilePath &coco, const Utils::FilePath &csmes); + + LanguageClient::BaseClientInterface *clientInterface(const Utils::FilePath &coco, + const Utils::FilePath &csmes); + +protected: + LanguageClient::DiagnosticManager *createDiagnosticManager() override; + +private: + void initClientCapabilities(); + void handleDocumentOpened(Core::IDocument *document); + void handleDocumentClosed(Core::IDocument *document); +}; + + +} // namespace Coco diff --git a/src/plugins/coco/cocoplugin.cpp b/src/plugins/coco/cocoplugin.cpp new file mode 100644 index 00000000000..f99893cf4a4 --- /dev/null +++ b/src/plugins/coco/cocoplugin.cpp @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "cocoplugin.h" + +#include "cocolanguageclient.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace Utils; + +namespace Coco { + +class CocoPluginPrivate +{ +public: + void startCoco(); + + CocoLanguageClient *m_client = nullptr; +}; + +void CocoPluginPrivate::startCoco() +{ + if (m_client) + m_client->shutdown(); + m_client = nullptr; + + QDialog dialog(Core::ICore::dialogParent()); + dialog.setModal(true); + auto layout = new QFormLayout(); + + const Environment env = Environment::systemEnvironment(); + FilePath squishCocoPath = FilePath::fromString(env.value("SQUISHCOCO")); + const FilePaths candidates = env.findAllInPath("coveragebrowser", {squishCocoPath}); + + PathChooser cocoChooser; + if (!candidates.isEmpty()) + cocoChooser.setFilePath(candidates.first()); + cocoChooser.setExpectedKind(PathChooser::Command); + cocoChooser.setPromptDialogTitle(CocoPlugin::tr( + "Select a Squish Coco CoverageBrowser Executable")); + + cocoChooser.setHistoryCompleter("Coco.CoverageBrowser.history", true); + layout->addRow(CocoPlugin::tr("CoverageBrowser:"), &cocoChooser); + PathChooser csmesChoser; + csmesChoser.setHistoryCompleter("Coco.CSMes.history", true); + csmesChoser.setExpectedKind(PathChooser::File); + csmesChoser.setInitialBrowsePathBackup(FileUtils::homePath()); + csmesChoser.setPromptDialogFilter(CocoPlugin::tr("Coco instrumentation files (*.csmes)")); + csmesChoser.setPromptDialogTitle(CocoPlugin::tr("Select a Squish Coco Instrumentation File")); + layout->addRow(CocoPlugin::tr("CSMes:"), &csmesChoser); + QDialogButtonBox buttons(QDialogButtonBox::Cancel | QDialogButtonBox::Open); + layout->addWidget(&buttons); + dialog.setLayout(layout); + + QObject::connect(&buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); + QObject::connect(&buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); + + if (dialog.exec() == QDialog::Accepted) { + const FilePath cocoPath = cocoChooser.filePath(); + const FilePath csmesPath = csmesChoser.filePath(); + if (cocoPath.isExecutableFile() && csmesPath.exists()) { + m_client = new CocoLanguageClient(cocoPath, csmesPath); + m_client->start(); + } + } +} + +CocoPlugin::CocoPlugin() + : d (new CocoPluginPrivate) +{} + +CocoPlugin::~CocoPlugin() +{ + delete d; +} + +bool CocoPlugin::initialize(const QStringList &arguments, QString *errorString) +{ + using namespace Core; + ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER); + + auto startCoco = new QAction("Squish Coco ...", this); + Command *cmd = ActionManager::registerAction(startCoco, "Coco.startCoco"); + menu->addAction(cmd, Debugger::Constants::G_ANALYZER_TOOLS); + + connect(startCoco, &QAction::triggered, this, [this]() { d->startCoco(); }); + + return true; +} + +} // namespace Coco + + diff --git a/src/plugins/coco/cocoplugin.h b/src/plugins/coco/cocoplugin.h new file mode 100644 index 00000000000..129a047d53c --- /dev/null +++ b/src/plugins/coco/cocoplugin.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include + +namespace Coco { + +class CocoPluginPrivate; + +class CocoPlugin : public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Coco.json") + +public: + CocoPlugin(); + ~CocoPlugin() override; + + bool initialize(const QStringList &arguments, QString *errorString) override; +private: + CocoPluginPrivate *d; +}; + +} // namespace Coco diff --git a/src/plugins/languageclient/diagnosticmanager.cpp b/src/plugins/languageclient/diagnosticmanager.cpp index f3bb4521a77..e772baf3f52 100644 --- a/src/plugins/languageclient/diagnosticmanager.cpp +++ b/src/plugins/languageclient/diagnosticmanager.cpp @@ -110,8 +110,12 @@ void DiagnosticManager::showDiagnostics(const DocumentUri &uri, int version) const bool isProjectFile = m_client->project() && m_client->project()->isKnownFile(filePath); for (const Diagnostic &diagnostic : versionedDiagnostics.diagnostics) { - extraSelections << createDiagnosticSelection(diagnostic, doc->document()); - marks.append(createTextMark(filePath, diagnostic, isProjectFile)); + const QTextEdit::ExtraSelection selection + = createDiagnosticSelection(diagnostic, doc->document()); + if (!selection.cursor.isNull()) + extraSelections << selection; + if (TextEditor::TextMark *mark = createTextMark(filePath, diagnostic, isProjectFile)) + marks.append(mark); } if (!marks.isEmpty()) emit textMarkCreated(filePath); diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index efd1f689731..a929eafe6db 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -20,6 +20,7 @@ Project { "clearcase/clearcase.qbs", "cmakeprojectmanager/cmakeprojectmanager.qbs", "mesonprojectmanager/mesonprojectmanager.qbs", + "coco/coco.qbs", "compilationdatabaseprojectmanager/compilationdatabaseprojectmanager.qbs", "conan/conan.qbs", "coreplugin/coreplugin.qbs", diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index 01459630bb5..b5fbaad4e5d 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -117,6 +117,18 @@ const char *nameForStyle(TextStyle style) case C_OUTPUT_ARGUMENT: return "OutputArgument"; case C_STATIC_MEMBER: return "StaticMember"; + case C_COCO_CODE_ADDED: return "CocoCodeAdded"; + case C_COCO_PARTIALLY_COVERED: return "CocoPartiallyCovered"; + case C_COCO_NOT_COVERED: return "CocoNotCovered"; + case C_COCO_FULLY_COVERED: return "CocoFullyCovered"; + case C_COCO_MANUALLY_VALIDATED: return "CocoManuallyValidated"; + case C_COCO_DEAD_CODE: return "CocoDeadCode"; + case C_COCO_EXECUTION_COUNT_TOO_LOW: return "CocoExecutionCountTooLow"; + case C_COCO_NOT_COVERED_INFO: return "CocoNotCoveredInfo"; + case C_COCO_COVERED_INFO: return "CocoCoveredInfo"; + case C_COCO_MANUALLY_VALIDATED_INFO: return "CocoManuallyValidatedInfo"; + + case C_LAST_STYLE_SENTINEL: return "LastStyleSentinel"; } return "Unknown Style"; diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index bb95b6f93d3..eff3f65e047 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -117,6 +117,17 @@ enum TextStyle : quint8 { C_OUTPUT_ARGUMENT, C_STATIC_MEMBER, + C_COCO_CODE_ADDED, + C_COCO_PARTIALLY_COVERED, + C_COCO_NOT_COVERED, + C_COCO_FULLY_COVERED, + C_COCO_MANUALLY_VALIDATED, + C_COCO_DEAD_CODE, + C_COCO_EXECUTION_COUNT_TOO_LOW, + C_COCO_NOT_COVERED_INFO, + C_COCO_COVERED_INFO, + C_COCO_MANUALLY_VALIDATED_INFO, + C_LAST_STYLE_SENTINEL }; diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 4141806679c..d1cd42836ed 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -368,6 +368,47 @@ FormatDescriptions TextEditorSettingsPrivate::initialFormats() tr("Names of static fields or member functions."), FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_CODE_ADDED, + tr("Code Coverage Added Code"), + tr("New code that was not checked for tests."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_PARTIALLY_COVERED, + tr("Partially Covered Code"), + tr("Partial branch/condition coverage."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_NOT_COVERED, + tr("Uncovered Code"), + tr("Not covered at all."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_FULLY_COVERED, + tr("Fully Covered Code"), + tr("Fully covered code."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_MANUALLY_VALIDATED, + tr("Manually Validated Code"), + tr("User added validation."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_DEAD_CODE, + tr("Code Coverage Dead Code"), + tr("Unreachable code."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_EXECUTION_COUNT_TOO_LOW, + tr("Code Coverage Execution Count To Low"), + tr("Minimum count not reached."), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_NOT_COVERED_INFO, + tr("Implicitly Not Covered Code"), + tr("PLACEHOLDER"), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_COVERED_INFO, + tr("Implicitly Covered Code"), + tr("PLACEHOLDER"), + FormatDescription::ShowAllControls); + formatDescr.emplace_back(C_COCO_MANUALLY_VALIDATED_INFO, + tr("Implicit Manual Coverage Validation"), + tr("PLACEHOLDER"), + FormatDescription::ShowAllControls); + return formatDescr; }