forked from qt-creator/qt-creator
LanguageClient: fix semantic highlight after a server reset
Change-Id: I3a389ec82032d21e2eb932ae8d0e8d5678575427 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -280,6 +280,11 @@ void SemanticTokenSupport::setAdditionalTokenTypeStyles(
|
||||
m_additionalTypeStyles = typeStyles;
|
||||
}
|
||||
|
||||
void SemanticTokenSupport::clearTokens()
|
||||
{
|
||||
m_tokens.clear();
|
||||
}
|
||||
|
||||
//void SemanticTokenSupport::setAdditionalTokenModifierStyles(
|
||||
// const QHash<int, TextStyle> &modifierStyles)
|
||||
//{
|
||||
@@ -319,8 +324,9 @@ void SemanticTokenSupport::handleSemanticTokens(const Utils::FilePath &filePath,
|
||||
int documentVersion)
|
||||
{
|
||||
if (auto tokens = Utils::get_if<SemanticTokens>(&result)) {
|
||||
const bool force = !m_tokens.contains(filePath);
|
||||
m_tokens[filePath] = {*tokens, documentVersion};
|
||||
highlight(filePath);
|
||||
highlight(filePath, force);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user