ClangCodeModel: Start a fallback clangd for files without a project

These were still being served by the old code model even when clangd
support was enabled.

Change-Id: I5f01b6a7071b90c374750f93435299755cabe3e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-07-14 17:07:34 +02:00
parent 2e7891bedd
commit c999b6066f
4 changed files with 81 additions and 19 deletions

View File

@@ -522,7 +522,9 @@ private:
void addLanguageOptions()
{
// Determine file kind with respect to ambiguous headers.
CppTools::ProjectFile::Kind fileKind = CppTools::ProjectFile::classify(m_filePath);
CppTools::ProjectFile::Kind fileKind = CppTools::ProjectFile::Unclassified;
if (!m_filePath.isEmpty())
fileKind = CppTools::ProjectFile::classify(m_filePath);
if (fileKind == CppTools::ProjectFile::AmbiguousHeader) {
fileKind = m_projectPart.languageVersion <= ::Utils::LanguageVersion::LatestC
? CppTools::ProjectFile::CHeader