forked from qt-creator/qt-creator
ClangCodeModel: Do not let clangd insert header files on completion
... by default. This feature often doesn't do what you'd want it to, so we make it opt- in. Change-Id: I631eae9c154ddcb0e8feeac44c5d5c0265706a67 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -521,8 +521,10 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP
|
||||
const CppEditor::ClangdSettings settings(CppEditor::ClangdProjectSettings(project).settings());
|
||||
if (!settings.indexingEnabled())
|
||||
indexingOption += "=0";
|
||||
Utils::CommandLine cmd{settings.clangdFilePath(), {indexingOption, "--limit-results=0",
|
||||
"--clang-tidy=0"}};
|
||||
const QString headerInsertionOption = QString("--header-insertion=")
|
||||
+ (settings.autoIncludeHeaders() ? "iwyu" : "never");
|
||||
Utils::CommandLine cmd{settings.clangdFilePath(), {indexingOption, headerInsertionOption,
|
||||
"--limit-results=0", "--clang-tidy=0"}};
|
||||
if (settings.workerThreadLimit() != 0)
|
||||
cmd.addArg("-j=" + QString::number(settings.workerThreadLimit()));
|
||||
if (!jsonDbDir.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user