ClangCodeModel: Add experimental clangd support

If the user has enabled clangd (default is off), we start up one instance
per project when it is opened/changed (including build config switches),
and trigger background indexing.
So far, the index is used to provide results for locators and "Find
Usages".
Per-document functionality such as semantic highlighting and completion
is still provided by libclang.

Change-Id: I12532fca1b9c6278baab560e7238cba6189cde9f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-02-23 13:51:41 +01:00
parent 8bacd9bdc4
commit ecafdb7543
40 changed files with 881 additions and 190 deletions

View File

@@ -40,6 +40,7 @@
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <texteditor/textmark.h>
#include <utils/algorithm.h>
#include <utils/executeondestruction.h>
#include <utils/mimetypes/mimedatabase.h>
#include <utils/theme/theme.h>
@@ -375,6 +376,14 @@ Client *LanguageClientManager::clientForUri(const DocumentUri &uri)
return clientForFilePath(uri.toFilePath());
}
const QList<Client *> LanguageClientManager::clientsForProject(
const ProjectExplorer::Project *project)
{
return Utils::filtered(managerInstance->m_clients, [project](const Client *c) {
return c->project() == project;
}).toList();
}
void LanguageClientManager::openDocumentWithClient(TextEditor::TextDocument *document, Client *client)
{
Client *currentClient = clientForDocument(document);