From 4e2ffa279baa6a16040e01263feda7e271616705 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 16 Apr 2025 10:40:28 -0700 Subject: [PATCH 1/3] Add a message explaining why we couldn't find a quote-wrapped path --- Extension/src/LanguageServer/configurations.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index f132d8739..74a95eb50 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -2132,6 +2132,9 @@ export class CppProperties { badPath = `"${expandedPaths[0]}"`; } message = localize('cannot.find', "Cannot find: {0}", badPath); + if (incorrectExpandedPaths.length === 1 && incorrectExpandedPaths[0].match(/".*"/) !== null) { + message += '.\n' + localize('wrapped.with.quotes', 'Do not add extra quotes around paths.'); + } newSquiggleMetrics.PathNonExistent++; } else { // Check for file versus path mismatches. From 699e7ec3c2b937dcb0f0d2058e5835ec7e8fce59 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 16 Apr 2025 11:51:24 -0700 Subject: [PATCH 2/3] Update the message for the settings UI --- Extension/src/LanguageServer/configurations.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 74a95eb50..738cb6b2f 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -1721,6 +1721,7 @@ export class CppProperties { for (const p of paths) { let pathExists: boolean = true; + let quotedPath: boolean = false; let resolvedPath: string = this.resolvePath(p); if (!resolvedPath) { continue; @@ -1728,7 +1729,10 @@ export class CppProperties { // Check if resolved path exists if (!fs.existsSync(resolvedPath)) { - if (assumeRelative && !path.isAbsolute(resolvedPath)) { + if (resolvedPath.match(/".*"/) !== null) { + pathExists = false; + quotedPath = true; + } else if (assumeRelative && !path.isAbsolute(resolvedPath)) { continue; } else if (!this.rootUri) { pathExists = false; @@ -1744,7 +1748,10 @@ export class CppProperties { } if (!pathExists) { - const message: string = localize('cannot.find', "Cannot find: {0}", resolvedPath); + let message: string = localize('cannot.find', "Cannot find: {0}", resolvedPath); + if (quotedPath) { + message += '. ' + localize('wrapped.with.quotes', 'Do not add extra quotes around paths.'); + } errors.push(message); continue; } From de8af3f70b9d89bea9c8b8ea50fcbba211671fee Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 16 Apr 2025 13:22:10 -0700 Subject: [PATCH 3/3] PR feedback --- Extension/src/LanguageServer/configurations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 738cb6b2f..94c349a11 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -2139,7 +2139,7 @@ export class CppProperties { badPath = `"${expandedPaths[0]}"`; } message = localize('cannot.find', "Cannot find: {0}", badPath); - if (incorrectExpandedPaths.length === 1 && incorrectExpandedPaths[0].match(/".*"/) !== null) { + if (incorrectExpandedPaths.some(p => p.match(/".*"/) !== null)) { message += '.\n' + localize('wrapped.with.quotes', 'Do not add extra quotes around paths.'); } newSquiggleMetrics.PathNonExistent++;