forked from qt-creator/qt-creator
Clang: Fix highlighting of operators (==, <<, ..)
Handle all enum values that can be reported for clang highlighting marks. Change-Id: I07eec789902f36d70fa15f26cad0b151e2adff6e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include "clanghighlightingmarksreporter.h"
|
#include "clanghighlightingmarksreporter.h"
|
||||||
|
|
||||||
#include <texteditor/textstyles.h>
|
#include <texteditor/textstyles.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
|
|
||||||
@@ -64,8 +65,17 @@ TextEditor::TextStyle toTextStyle(ClangBackEnd::HighlightingType type)
|
|||||||
return TextEditor::C_DECLARATION;
|
return TextEditor::C_DECLARATION;
|
||||||
case HighlightingType::OutputArgument:
|
case HighlightingType::OutputArgument:
|
||||||
return TextEditor::C_OUTPUT_ARGUMENT;
|
return TextEditor::C_OUTPUT_ARGUMENT;
|
||||||
default:
|
case HighlightingType::Operator:
|
||||||
return TextEditor::C_TEXT; // never called
|
return TextEditor::C_OPERATOR;
|
||||||
|
case HighlightingType::Comment:
|
||||||
|
return TextEditor::C_COMMENT;
|
||||||
|
case HighlightingType::StringLiteral:
|
||||||
|
return TextEditor::C_STRING;
|
||||||
|
case HighlightingType::NumberLiteral:
|
||||||
|
return TextEditor::C_NUMBER;
|
||||||
|
case HighlightingType::Invalid:
|
||||||
|
QTC_CHECK(false); // never called
|
||||||
|
return TextEditor::C_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
|
|||||||
Reference in New Issue
Block a user