From 58af642a37363ea5be003b8c88b9f58ef7e603fe Mon Sep 17 00:00:00 2001 From: Peter Steiwer Date: Wed, 20 Aug 2025 15:01:51 -0400 Subject: [PATCH] Fix CSP files not being included in server side search results Bug with the expected value of "projects". This was leading to projectList being undefined and throwing an error. Earlier logic to populate projectList uses if (project) {, so using if (project && ... here keeps the checks consistent. isfsConfig() defaults project to "", which is why it is in this state. The following logic is used if apiVersion >= 6, which Cache is not: project: project ? project : undefined, // Needs to be undefined if project is an empty string. This means special handling is needed in this case --- src/providers/FileSystemProvider/TextSearchProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/FileSystemProvider/TextSearchProvider.ts b/src/providers/FileSystemProvider/TextSearchProvider.ts index 2821ba27..d9e62636 100644 --- a/src/providers/FileSystemProvider/TextSearchProvider.ts +++ b/src/providers/FileSystemProvider/TextSearchProvider.ts @@ -676,7 +676,7 @@ export class TextSearchProvider implements vscode.TextSearchProvider { if (token.isCancellationRequested) { return; } - if (project != undefined && file.doc.includes("/")) { + if (project && file.doc.includes("/")) { // Check if this web app file is in the project if (!projectList.includes(file.doc.slice(1))) { // This web app file isn't in the project, so ignore its matches