Skip to content

Commit 4950f55

Browse files
fix(server): @ file search matches paths containing square brackets
fff reads any query word containing '[' as a glob and offers no escape, so dynamic route folders like [id] never matched. Drop '[' before handing the query to fff; its subsequence fuzzy match still finds and ranks the bracketed path first. Fixes #34465 AI-assisted; verified with the tests and tools listed above.
1 parent d02f035 commit 4950f55

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/server/src/workspace/WorkspaceSearchIndex.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,10 @@ export const make = Effect.fn("WorkspaceSearchIndex.make")(function* (
451451

452452
const search: WorkspaceSearchIndex["Service"]["search"] = Effect.fn(
453453
"WorkspaceSearchIndex.search",
454-
)(function* (query, limit, kind, imageOnly) {
454+
)(function* (rawQuery, limit, kind, imageOnly) {
455+
// fff parses any word containing "[" as a glob and has no escape for it; fuzzy
456+
// matching is subsequence-based, so dropping "[" still matches "[id]" folders.
457+
const query = rawQuery.replaceAll("[", "");
455458
const pageSize = imageOnly ? WORKSPACE_INDEX_PAGE_SIZE : Math.max(1, limit + 1);
456459
const incompleteBeforeQuery = hasIncompleteInitialScan();
457460
if (kind === "file" || imageOnly) {

0 commit comments

Comments
 (0)