forked from qt-creator/qt-creator
LanguageClient: do not highlight unknown tokens
If the language server registers token types for unsupported tokens do not use the default text style for those tokens since it might overwrite correct syntax highlighting. Thanks to Alex Drozdov for providing a patch Fixes: QTCREATORBUG-26193 Change-Id: I5d70763bc1e9434ffc6241d94f50f3bb3852e62c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -246,8 +246,7 @@ void SemanticTokenSupport::updateFormatHash()
|
||||
case numberToken: style = C_NUMBER; break;
|
||||
case operatorToken: style = C_OPERATOR; break;
|
||||
default:
|
||||
style = m_additionalTypeStyles.value(tokenType, C_TEXT);
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
int mainHashPart = tokenType << tokenTypeBitOffset;
|
||||
m_formatHash[mainHashPart] = fontSettings.toTextCharFormat(style);
|
||||
|
Reference in New Issue
Block a user