From 2e5933cec624f75ba691fa6bfd0f0c7657d7ada1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Feb 2026 20:47:15 +0000 Subject: [PATCH] Fix normalizeQuery regex to preserve leading dots in dotfile names The regex /^[@./]+/ greedily stripped all leading @, ., and / characters, which caused dotfile queries like '.env' to be normalized to 'env'. This made searches match too broadly and rank actual dotfiles last. Changed to /^@?(\.\/)?/ which only strips an optional @ prefix and an optional ./ path prefix, preserving leading dots that are meaningful parts of filenames. --- apps/server/src/workspaceEntries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/workspaceEntries.ts b/apps/server/src/workspaceEntries.ts index 1064a7bed5..febd8d6cfa 100644 --- a/apps/server/src/workspaceEntries.ts +++ b/apps/server/src/workspaceEntries.ts @@ -54,7 +54,7 @@ function basenameOf(input: string): string { } function normalizeQuery(input: string): string { - return input.trim().replace(/^[@./]+/, "").toLowerCase(); + return input.trim().replace(/^@?(\.\/)?/, "").toLowerCase(); } function scoreEntry(entry: ProjectEntry, query: string): number {