forked from qt-creator/qt-creator
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:
@@ -328,7 +328,7 @@ void CppModelManager::globalRename(const CursorInEditor &data, UsagesCallback &&
|
||||
void CppModelManager::findUsages(const CppTools::CursorInEditor &data,
|
||||
UsagesCallback &&showUsagesCallback) const
|
||||
{
|
||||
RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines);
|
||||
RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines, false);
|
||||
QTC_ASSERT(engine, return;);
|
||||
engine->findUsages(data, std::move(showUsagesCallback));
|
||||
}
|
||||
@@ -466,6 +466,11 @@ void CppModelManager::removeRefactoringEngine(RefactoringEngineType type)
|
||||
instance()->d->m_refactoringEngines.remove(type);
|
||||
}
|
||||
|
||||
RefactoringEngineInterface *CppModelManager::builtinRefactoringEngine()
|
||||
{
|
||||
return instance()->d->m_refactoringEngines.value(RefactoringEngineType::BuiltIn);
|
||||
}
|
||||
|
||||
template<class FilterClass>
|
||||
static void setFilter(std::unique_ptr<FilterClass> &filter,
|
||||
std::unique_ptr<FilterClass> &&newFilter)
|
||||
@@ -917,6 +922,11 @@ QByteArray CppModelManager::codeModelConfiguration() const
|
||||
return QByteArray::fromRawData(pp_configuration, qstrlen(pp_configuration));
|
||||
}
|
||||
|
||||
CppLocatorData *CppModelManager::locatorData() const
|
||||
{
|
||||
return &d->m_locatorData;
|
||||
}
|
||||
|
||||
static QSet<QString> tooBigFilesRemoved(const QSet<QString> &files, int fileSizeLimitInMb)
|
||||
{
|
||||
if (fileSizeLimitInMb <= 0)
|
||||
|
||||
Reference in New Issue
Block a user