ClangTools: Add help context menu entry

...that opens the documentation page for the current diagnostic.

Change-Id: I398fdc82bb118a80536acbb12420a9bac84e66c9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-11-29 09:52:02 +01:00
committed by Cristian Adam
parent 311779e53e
commit 1b4de8d769
11 changed files with 79 additions and 15 deletions

View File

@@ -49,13 +49,6 @@ using Internal::ClangFixItOperation;
namespace {
// CLANG-UPGRADE-CHECK: Checks/update URLs.
//
// Once it gets dedicated documentation pages for released versions,
// use them instead of pointing to master, as checks might vanish.
const char CLAZY_DOCUMENTATION_URL_TEMPLATE[]
= "https://github.com/KDE/clazy/blob/master/docs/checks/README-%1.md";
const char LINK_ACTION_GOTO_LOCATION[] = "#gotoLocation";
const char LINK_ACTION_APPLY_FIX[] = "#applyFix";
@@ -230,7 +223,8 @@ private:
// Clazy
if (ClangCodeModel::Utils::DiagnosticTextInfo::isClazyOption(option)) {
option = optionAsUtf8String.mid(8); // Remove "-Wclazy-" prefix.
return QString::fromUtf8(CLAZY_DOCUMENTATION_URL_TEMPLATE).arg(option);
return QString::fromUtf8(CppTools::Constants::CLAZY_DOCUMENTATION_URL_TEMPLATE)
.arg(option);
}
// Clang itself