ClangCodeModel: Respect settings

If the user disables usage of clangd and opens a cpp file
without a project we still tried to set up the fallback clangd.
Silences a soft assert.

Change-Id: I753ce2eddb00b344b109ba4ff3da61a849767a79
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2023-10-13 13:05:21 +02:00
parent 3a671c2bb9
commit 43cfe48fed

View File

@@ -768,6 +768,8 @@ void ClangModelManagerSupport::onEditorOpened(IEditor *editor)
Project * project = ProjectManager::projectForFile(document->filePath());
const ClangdSettings settings(ClangdProjectSettings(project).settings());
if (!settings.useClangd())
return;
if (!settings.sizeIsOkay(textDocument->filePath()))
return;
if (sessionModeEnabled())