LanguageServer: Use Utils::CommandLine in StdIOClientInterface

Change-Id: Ic2516387d7308bfad05cef54467c417cc47a7655
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-04-30 08:25:10 +02:00
parent e5312362c8
commit 2f593d9db9
5 changed files with 13 additions and 20 deletions

View File

@@ -41,14 +41,14 @@ static QString indexingToken() { return "backgroundIndexProgress"; }
static BaseClientInterface *clientInterface(const Utils::FilePath &jsonDbDir)
{
QString clangdArgs = "--index --background-index --limit-results=0";
Utils::CommandLine cmd{CppTools::codeModelSettings()->clangdFilePath(),
{"--index", "--background-index", "--limit-results=0"}};
if (!jsonDbDir.isEmpty())
clangdArgs += " --compile-commands-dir=" + jsonDbDir.toString();
cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString());
if (clangdLog().isDebugEnabled())
clangdArgs += " --log=verbose --pretty";
cmd.addArgs({"--log=verbose", "--pretty"});
const auto interface = new StdIOClientInterface;
interface->setExecutable(CppTools::codeModelSettings()->clangdFilePath().toString());
interface->setArguments(clangdArgs);
interface->setCommandLine(cmd);
return interface;
}