ClangCodeModel: Do not use clangd for completing #ifdef & friends

Annoyingly, LLVM does not complete preprocessor directives in disabled
code, so that we would not offer e.g. "#endif" after "#if 0" (but we
would offer it after "#if 1").
Fixing it would require messing with the clang libs (rather than just
clangd), so let's just keep using our existing code, which seems to work
fine.

Change-Id: I9dabf9a2a8f3a2f68e88a11b62c3df3b5e64a55c
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-28 15:10:47 +02:00
parent 94a59f15c6
commit 29c0512416
6 changed files with 71 additions and 29 deletions

View File

@@ -568,7 +568,7 @@ void ClangCompletionAssistProcessor::completeIncludePath(const QString &realPath
bool ClangCompletionAssistProcessor::completePreprocessorDirectives()
{
foreach (const QString &preprocessorCompletion, m_preprocessorCompletions)
foreach (const QString &preprocessorCompletion, preprocessorCompletions())
addCompletionItem(preprocessorCompletion,
Utils::CodeModelIcon::iconForType(Utils::CodeModelIcon::Macro));