LanguageClient: reapply semantic highlight after font changed

Change-Id: I609e26b7f85744fdffb8399e0d651691b7c39900
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-08-09 14:44:34 +02:00
parent a5aef91411
commit bbb06a72ec
2 changed files with 3 additions and 1 deletions

View File

@@ -1354,6 +1354,7 @@ void Client::handleSemanticHighlight(const SemanticHighlightingParams &params)
void Client::rehighlight() void Client::rehighlight()
{ {
using namespace TextEditor; using namespace TextEditor;
m_tokentSupport.rehighlight();
for (auto it = m_highlights.begin(), end = m_highlights.end(); it != end; ++it) { for (auto it = m_highlights.begin(), end = m_highlights.end(); it != end; ++it) {
if (TextDocument *doc = TextDocument::textDocumentForFilePath(it.key().toFilePath())) { if (TextDocument *doc = TextDocument::textDocumentForFilePath(it.key().toFilePath())) {
if (LanguageClientManager::clientForDocument(doc) == this) if (LanguageClientManager::clientForDocument(doc) == this)

View File

@@ -374,8 +374,9 @@ void SemanticTokenSupport::handleSemanticTokens(const Utils::FilePath &filePath,
if (auto tokens = Utils::get_if<SemanticTokens>(&result)) { if (auto tokens = Utils::get_if<SemanticTokens>(&result)) {
m_tokens[filePath] = *tokens; m_tokens[filePath] = *tokens;
highlight(filePath); highlight(filePath);
} else {
m_tokens.remove(filePath);
} }
m_tokens.remove(filePath);
} }
void SemanticTokenSupport::handleSemanticTokensDelta( void SemanticTokenSupport::handleSemanticTokensDelta(