forked from qt-creator/qt-creator
ClangCodeModel: Provide highlighting via clangd
Note that we lose the highlighting for virtual function calls. We need to amend clangd to add the respective information to its semantic tokens message. Also, Qt properties are no longer highlighted as class members. We'll investigate how to best restore this feature. Change-Id: I403712aada3d7a8e1c7b7c1277f43f7f64f8450b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -426,9 +426,12 @@ void Client::closeDocument(TextEditor::TextDocument *document)
|
||||
deactivateDocument(document);
|
||||
const DocumentUri &uri = DocumentUri::fromFilePath(document->filePath());
|
||||
m_highlights[uri].clear();
|
||||
if (m_openedDocument.remove(document) != 0 && m_state == Initialized) {
|
||||
DidCloseTextDocumentParams params(TextDocumentIdentifier{uri});
|
||||
sendContent(DidCloseTextDocumentNotification(params));
|
||||
if (m_openedDocument.remove(document) != 0) {
|
||||
handleDocumentClosed(document);
|
||||
if (m_state == Initialized) {
|
||||
DidCloseTextDocumentParams params(TextDocumentIdentifier{uri});
|
||||
sendContent(DidCloseTextDocumentNotification(params));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1003,6 +1006,11 @@ void Client::setDiagnosticsHandlers(const TextMarkCreator &textMarkCreator,
|
||||
m_diagnosticManager.setDiagnosticsHandlers(textMarkCreator, hideHandler);
|
||||
}
|
||||
|
||||
void Client::setSemanticTokensHandler(const SemanticTokensHandler &handler)
|
||||
{
|
||||
m_tokentSupport.setTokensHandler(handler);
|
||||
}
|
||||
|
||||
void Client::setSymbolStringifier(const LanguageServerProtocol::SymbolStringifier &stringifier)
|
||||
{
|
||||
m_symbolStringifier = stringifier;
|
||||
|
||||
Reference in New Issue
Block a user