infi-pc / locatorjs

https://www.locatorjs.com
1.31k stars 60 forks source link

Fixed URL for VSCode #129

Closed sushantkadam15 closed 10 months ago

sushantkadam15 commented 10 months ago

Summary of the PR

This PR addresses the issue reported on GitHub: GitHub Issue Link. It aims to fix a problem that occurred after a new VS Code update, which prevented opening React components in VS Code from the browser. The solution involves changes to the Index.ts file.

Changes Made

In the Index.ts file, modifications were made to the allTargets object. Specifically, changes were made to the URLs for VS Code and WebStorm. Here is the code snippet with the modifications:


export const allTargets: Targets = {
  vscode: {
    url: "vscode://file${projectPath}${filePath}:${line}:${column}", // Old url vscode://file/${projectPath}${filePath}:${line}:${column}
    label: "VSCode",
  },
  webstorm: {
    url: "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}",
    label: "WebStorm",
  },
};
vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
locatorjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2023 3:59pm
joelbqz commented 10 months ago

~this is a problem with VSCode, not LocatorJS, it breaks many other apps, like React DevTools or Next.js error pages and all of them still use the same link structure~

~this should be fixed on VSCode end~

It seems VSCode did this change intentionally but then this breaks other tools using VSCode url 🙂

sushantkadam15 commented 10 months ago

~this is a problem with VSCode, not LocatorJS, it breaks many other apps, like React DevTools or Next.js error pages and all of them still use the same link structure~

~this should be fixed on VSCode end~

It seems VSCode did this change intentionally but then this breaks other tools using VSCode url 🙂

@joelbqz 👉🏻 https://github.com/microsoft/vscode/issues/197450

infi-pc commented 10 months ago

It looks good, thanks for fixing @sushantkadam15

HiChen404 commented 9 months ago

Cannot open vscode after change on Windows. vscode: 1.84.2 latest