Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Extension/src/LanguageServer/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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] ?? "";
Comment thread
sean-mcmanus marked this conversation as resolved.
if (!semver.valid(bundledVersion)) {
return path;
Expand All @@ -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 = "";
Expand Down
Loading