Skip to content

fix: fix go to source file whose path contains $ symbol#450

Open
knthmn wants to merge 2 commits into
TanStack:mainfrom
knthmn:fix-click-to-code-dollar-sign
Open

fix: fix go to source file whose path contains $ symbol#450
knthmn wants to merge 2 commits into
TanStack:mainfrom
knthmn:fix-click-to-code-dollar-sign

Conversation

@knthmn
Copy link
Copy Markdown

@knthmn knthmn commented May 22, 2026

🎯 Changes

Fix @tanstack/devtools-vite click-to-code for source files whose paths contain $. The previous implementation escaped $ before passing the path to launch-editor which turns a real path e.g. src/routes/$postId.tsx into src/routes/\$postId.tsx. launch-editor checks fs.existsSync(fileName) before spawning the editor, so the escaped path fails existence checks.

Verified locally by:

  • building @tanstack/devtools-vite
  • linking the local package into an app with TanStack router
  • confirming click-to-code now opens $... route files correctly in both VS Code and IntelliJ

I am not sure why this wasn't reported before since TanStack Router makes heavy use of $ in file path. I believe my fix is independent of OS and editor, please point out if the fix is wrong.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where opening source files in the editor failed when file paths contained the dollar sign ($), ensuring "go to source" works reliably.
  • Chores
    • Updated release metadata to publish a patch with the above fix.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

The PR stops escaping $ in the file path when building the filename:line:column argument passed to launch-editor and updates the changelog entry to publish a patch noting the go-to-source fix for $-containing paths.

Changes

Editor path argument handling

Layer / File(s) Summary
Remove dollar sign escaping from path argument
packages/devtools-vite/src/editor.ts
The launch-editor path argument in DEFAULT_EDITOR_CONFIG.open no longer escapes dollar signs and uses the raw path when constructing the filename:line:column argument.
Patch changeset update
.changeset/floppy-mammals-write.md
Changeset updated to publish a patch for @tanstack/devtools-vite and documents the fix for go-to-source when file paths contain $.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A dollar sign hops through the code,
Unescaped it finds a friendly road,
One tiny change, a cleaner flight,
Source opens true, just right tonight,
🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: removing dollar sign escaping in the path passed to launch-editor for click-to-code functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is comprehensive and well-structured, addressing all required template sections with clear explanations of the change, testing, and checklist completion.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant