diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index e3e02e6e5..71f6730bd 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -4,11 +4,10 @@ * ------------------------------------------------------------------------------------------ */ 'use strict'; -import { execSync } from 'child_process'; +import { execFileSync } from 'child_process'; import * as os from 'os'; import * as path from 'path'; import * as semver from 'semver'; -import { quote } from 'shell-quote'; import * as vscode from 'vscode'; import * as nls from 'vscode-nls'; import * as which from 'which'; @@ -297,7 +296,7 @@ export class CppSettings extends Settings { let bundledVersion: string; try { const bundledPath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); - const output: string = execSync(quote([bundledPath, '--version'])).toString(); + const output: string = execFileSync(bundledPath, ['--version']).toString(); bundledVersion = output.match(/(\d+\.\d+\.\d+)/)?.[1] ?? ""; if (!semver.valid(bundledVersion)) { return path; @@ -309,7 +308,7 @@ export class CppSettings extends Settings { // Invoke the version on the system to compare versions. Use ours if it's more recent. try { - const output: string = execSync(`"${path}" --version`).toString(); + const output: string = execFileSync(path, ['--version']).toString(); const userVersion = output.match(/(\d+\.\d+\.\d+)/)?.[1] ?? ""; if (semver.ltr(userVersion, bundledVersion)) { path = "";