From 648a2f5976551f0b024011c2951990002448c61f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Sat, 27 Jun 2026 14:15:25 -0700 Subject: [PATCH 1/2] Fix clang-format/clang-tidy version check failing on Windows (and paths with spaces) --- Extension/src/LanguageServer/settings.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index e3e02e6e5..ad60dce90 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'; @@ -295,9 +294,9 @@ export class CppSettings extends Settings { } else { // Attempt to invoke both our own version of clang-* to see if we can successfully execute it, and to get its version. let bundledVersion: string; + const bundledPath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); 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 = ""; From 2cc7176fb3b1194035ef40eea86c49b7a97f760c Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Sat, 27 Jun 2026 14:29:02 -0700 Subject: [PATCH 2/2] Fix Copilot review comment. --- Extension/src/LanguageServer/settings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index ad60dce90..71f6730bd 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -294,8 +294,8 @@ export class CppSettings extends Settings { } else { // Attempt to invoke both our own version of clang-* to see if we can successfully execute it, and to get its version. let bundledVersion: string; - const bundledPath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); try { + const bundledPath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); const output: string = execFileSync(bundledPath, ['--version']).toString(); bundledVersion = output.match(/(\d+\.\d+\.\d+)/)?.[1] ?? ""; if (!semver.valid(bundledVersion)) {