Skip to content

Fix product JSON path resolution for Windows to handle versioned resources - #27733

Merged
raycastbot merged 2 commits into
raycast:mainfrom
bhbs:fix-search-recent-projects-windows
May 11, 2026
Merged

raycastbot merged 2 commits into
raycast:mainfrom
bhbs:fix-search-recent-projects-windows

Conversation

@bhbs

@bhbs bhbs commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes: #27732

Before

image

After

image

Test

  • Windows - Visual Studio Code (1.118+)

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: visual-studio-code-recent-projects Issues related to the visual-studio-code-recent-projects extension platform: macOS platform: Windows labels May 7, 2026
@raycastbot

raycastbot commented May 7, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @thomaspaulmann @iainsimmons @macbookandrew @cy-98 @immint023 @pernielsentikaer @vimtor @tonka3000 @aka-rabbi-inv @oilbeater @QIanGua @hakob8956 @erics118 @tmwrnr @tleo19 @aeither @yug2005 @VatsalSy @Tarocch1 @list-jonas @xilopaint @lacherogwu @Nenuial @robertocinetto @ecntu @raxityo @yusifaliyevpro you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="fix-search-recent-projects-windows"
FORK_URL="https://github.com/bhbs/extensions.git"
EXTENSION_NAME="visual-studio-code-recent-projects"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@bhbs
bhbs force-pushed the fix-search-recent-projects-windows branch from c4115c6 to 2ec217e Compare May 7, 2026 21:36
@greptile-apps

greptile-apps Bot commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes product.json path resolution on Windows for VS Code builds that use a versioned resources layout (a 10-character commit-hash subdirectory introduced in VS Code 1.118+). The programPaths() refactor strips the now-variable suffix from each entry so the new resolveWindowsProductJSONPath helper can probe both the legacy flat path and the versioned directory, falling back gracefully on any FS error.

  • resolveWindowsProductJSONPath: checks the traditional resources/app/product.json first, then scans the install directory for a 10-char hex directory name, picks the most recently modified one when multiple are present, and falls back to the default path on failure.
  • macOS paths: updated in parallel to drop the product.json suffix (now appended uniformly in getProductJSONPath), producing identical resolved paths to before.

Confidence Score: 5/5

The logic change is well-scoped and safe to merge — the new Windows resolver has a proper fallback chain and the macOS path construction is equivalent to before.

The Windows versioned-path resolver handles all edge cases (missing directory, multiple candidates, FS errors) and falls back to the old path, so existing installations are unaffected. The macOS code path is a pure refactor with no behavioral change.

No files require special attention beyond the minor changelog date placeholder fix.

Important Files Changed

Filename Overview
extensions/visual-studio-code-recent-projects/src/lib/vscode.ts Adds resolveWindowsProductJSONPath to handle VS Code's versioned (10-char commit-hash) resource directory layout on Windows; correctly falls back to the legacy flat path and catches FS errors. The dirent.isDirectory() call is made as a method (no destructuring), so this context is properly preserved.
extensions/visual-studio-code-recent-projects/CHANGELOG.md New entry added at the top with a hardcoded date (2026-05-11) instead of the required {PR_MERGE_DATE} placeholder.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/visual-studio-code-recent-projects/CHANGELOG.md:3
The changelog entry uses a hardcoded date instead of the `{PR_MERGE_DATE}` placeholder. The placeholder is the expected convention for new entries in pre-merge PRs — it gets replaced automatically when the PR is merged.

```suggestion
## [Fix: Windows app path resolution] - {PR_MERGE_DATE}
```

Reviews (4): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

@bhbs
bhbs force-pushed the fix-search-recent-projects-windows branch from 2ec217e to f20adf3 Compare May 7, 2026 21:42
@bhbs bhbs mentioned this pull request May 7, 2026
8 tasks done
@bhbs
bhbs marked this pull request as draft May 7, 2026 21:56
@bhbs
bhbs force-pushed the fix-search-recent-projects-windows branch from f20adf3 to ef76885 Compare May 7, 2026 22:03
@bhbs
bhbs marked this pull request as ready for review May 7, 2026 22:09
@0xdhrv 0xdhrv self-assigned this May 11, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 0cd097f into raycast:main May 11, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: visual-studio-code-recent-projects Issues related to the visual-studio-code-recent-projects extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Visual Studio Code] Search recent projects shows no results on Windows

3 participants