forked from qt-creator/qt-creator
CppEditor: Change parsing opposite bracket
Fixed behavior: - when comparing sign was determined as angle bracket - when in complex combination brackets, an opposite bracket was detected not correct - not correct mismatch case highlightning Added tests for the cases form bug 26395 Fixes: QTCREATORBUG-26400 Fixes: QTCREATORBUG-26395 Change-Id: Ic45566d2677f80fb9a8e4fe830307254dd1db51d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -225,7 +225,7 @@ void SemanticHighlighter::onHighlighterResultAvailable(int from, int to)
|
||||
} else if (result.kind == DoubleAngleBracketClose) {
|
||||
Parenthesis extraParen = {Parenthesis::Closed, '>', result.column - 1};
|
||||
extraParen.source = parenSource();
|
||||
parentheses.second.append(extraParen);
|
||||
insertSorted(parentheses.second, extraParen);
|
||||
paren = {Parenthesis::Closed, '>', result.column};
|
||||
} else if (result.kind == TernaryIf) {
|
||||
paren = {Parenthesis::Opened, '?', result.column - 1};
|
||||
|
||||
@@ -607,7 +607,11 @@ void TokenInfo::punctuationOrOperatorKind()
|
||||
&& m_types.mixinHighlightingTypes.empty()
|
||||
&& kind != CXCursor_OverloadedDeclRef
|
||||
&& kind != CXCursor_InclusionDirective
|
||||
&& kind != CXCursor_PreprocessingDirective) {
|
||||
&& kind != CXCursor_PreprocessingDirective
|
||||
&& kind != CXCursor_MacroDefinition
|
||||
&& kind != CXCursor_DeclStmt
|
||||
&& kind != CXCursor_CompoundStmt
|
||||
&& kind != CXCursor_FirstInvalid) {
|
||||
const ClangString spelling = m_token->spelling();
|
||||
if (spelling == "<")
|
||||
m_types.mixinHighlightingTypes.push_back(HighlightingType::AngleBracketOpen);
|
||||
|
||||
Reference in New Issue
Block a user