Highlighting: Add highlighting style for punctuation

Currently only operators have their own style but not
punctuation tokens. Make possible to highlight both.

Task-number: QTCREATORBUG-20666
Change-Id: I9533e0f1bef65b86c4e4f5c9756571103584124b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-08-22 17:25:12 +02:00
parent ccf2d848f4
commit 50e5aacb02
14 changed files with 93 additions and 79 deletions

View File

@@ -224,9 +224,16 @@ TextEditorSettings::TextEditorSettings()
formatDescr.emplace_back(C_KEYWORD, tr("Keyword"),
tr("Reserved keywords of the programming language except "
"keywords denoting primitive types."), Qt::darkYellow);
formatDescr.emplace_back(C_PUNCTUATION, tr("Punctuation"),
tr("Punctuation excluding operators."));
formatDescr.emplace_back(C_OPERATOR, tr("Operator"),
tr("Non user-defined language operators.\n"
"To style user-defined operators, use Overloaded Operator."));
"To style user-defined operators, use Overloaded Operator."),
Format::createMixinFormat());
formatDescr.emplace_back(C_OVERLOADED_OPERATOR,
tr("Overloaded Operators"),
tr("Calls and declarations of overloaded (user-defined) operators."),
Format::createMixinFormat());
formatDescr.emplace_back(C_PREPROCESSOR, tr("Preprocessor"),
tr("Preprocessor directives."), Qt::darkBlue);
formatDescr.emplace_back(C_LABEL, tr("Label"), tr("Labels for goto statements."),
@@ -313,10 +320,6 @@ TextEditorSettings::TextEditorSettings()
QColor(255, 190, 0),
QTextCharFormat::DotLine,
FormatDescription::ShowUnderlineControl);
formatDescr.emplace_back(C_OVERLOADED_OPERATOR,
tr("Overloaded Operators"),
tr("Calls and declarations of overloaded (user-defined) operators."),
Format::createMixinFormat());
Format declarationFormat = Format::createMixinFormat();
declarationFormat.setBold(true);
formatDescr.emplace_back(C_DECLARATION,