forked from qt-creator/qt-creator
LanguageClient: Re-highlight also on empty deltas
This is needed for e.g. ClangdClient, which may need to update even if the highlighting delta from the server is empty. Task-number: QTCREATORBUG-26183 Change-Id: I38398c9563fa7a6a1906c5cb57fd1cbcd444cbd9 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1432,7 +1432,6 @@ ClangdTestCompletion::ClangdTestCompletion()
|
||||
void ClangdTestCompletion::initTestCase()
|
||||
{
|
||||
ClangdTest::initTestCase();
|
||||
client()->forceHighlightingOnEmptyDelta();
|
||||
startCollectingHighlightingInfo();
|
||||
}
|
||||
|
||||
|
||||
@@ -1016,13 +1016,6 @@ void Client::setSemanticTokensHandler(const SemanticTokensHandler &handler)
|
||||
m_tokenSupport.setTokensHandler(handler);
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
void Client::forceHighlightingOnEmptyDelta()
|
||||
{
|
||||
m_tokenSupport.forceHighlightingOnEmptyDelta();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Client::setSymbolStringifier(const LanguageServerProtocol::SymbolStringifier &stringifier)
|
||||
{
|
||||
m_symbolStringifier = stringifier;
|
||||
|
||||
@@ -195,10 +195,6 @@ public:
|
||||
void log(const LanguageServerProtocol::ResponseError<Error> &responseError) const
|
||||
{ log(responseError.toString()); }
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
void forceHighlightingOnEmptyDelta();
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void initialized(const LanguageServerProtocol::ServerCapabilities &capabilities);
|
||||
void capabilitiesChanged(const DynamicCapabilities &capabilities);
|
||||
|
||||
@@ -387,8 +387,7 @@ void SemanticTokenSupport::handleSemanticTokensDelta(
|
||||
} else if (auto tokensDelta = Utils::get_if<SemanticTokensDelta>(&result)) {
|
||||
QList<SemanticTokensEdit> edits = tokensDelta->edits();
|
||||
if (edits.isEmpty()) {
|
||||
if (m_highlightOnEmptyDelta)
|
||||
highlight(filePath);
|
||||
highlight(filePath);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@ public:
|
||||
// void setAdditionalTokenModifierStyles(const QHash<int, TextEditor::TextStyle> &modifierStyles);
|
||||
|
||||
void setTokensHandler(const SemanticTokensHandler &handler) { m_tokensHandler = handler; }
|
||||
void forceHighlightingOnEmptyDelta() { m_highlightOnEmptyDelta = true; }
|
||||
|
||||
private:
|
||||
LanguageServerProtocol::SemanticRequestTypes supportedSemanticRequests(
|
||||
@@ -107,7 +106,6 @@ private:
|
||||
SemanticTokensHandler m_tokensHandler;
|
||||
QStringList m_tokenTypeStrings;
|
||||
QStringList m_tokenModifierStrings;
|
||||
bool m_highlightOnEmptyDelta = false;
|
||||
};
|
||||
|
||||
} // namespace LanguageClient
|
||||
|
||||
Reference in New Issue
Block a user