forked from qt-creator/qt-creator
ClangCodeModel: Prefer clangd's switch header/source
It's more reliable than the built-in code model with non-trivial directory layouts. Fixes: QTCREATORBUG-28878 Change-Id: I02a058e7efb54e6af0998948a20d990e10293f03 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -341,15 +341,9 @@ void ClangModelManagerSupport::findUsages(const CppEditor::CursorInEditor &curso
|
|||||||
|
|
||||||
void ClangModelManagerSupport::switchHeaderSource(const FilePath &filePath, bool inNextSplit)
|
void ClangModelManagerSupport::switchHeaderSource(const FilePath &filePath, bool inNextSplit)
|
||||||
{
|
{
|
||||||
if (ClangdClient * const client = clientForFile(filePath)) {
|
if (ClangdClient * const client = clientForFile(filePath))
|
||||||
// The fast, synchronous approach works most of the time, so let's try that one first.
|
|
||||||
const FilePath otherFile = correspondingHeaderOrSource(filePath);
|
|
||||||
if (!otherFile.isEmpty())
|
|
||||||
openEditor(otherFile, inNextSplit);
|
|
||||||
else
|
|
||||||
client->switchHeaderSource(filePath, inNextSplit);
|
client->switchHeaderSource(filePath, inNextSplit);
|
||||||
return;
|
else
|
||||||
}
|
|
||||||
CppModelManager::switchHeaderSource(inNextSplit, CppModelManager::Backend::Builtin);
|
CppModelManager::switchHeaderSource(inNextSplit, CppModelManager::Backend::Builtin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user