-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Alt + click not working on windows and mac #7785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 7435fa5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Close #7135 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With macOs and VSCode is working fine 👏
Thanks @LazyClicks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one working for you @Shane-Donlon
C%3A%2F%2FUsers%2Ffolder-location-stuff%2Ffolder-location-stuff%2Ffolder-location-stuff%2Ffolder%2Ftesting-windows-stuff%2Fsrc%2Froutes%2Findex.tsx%3A35%3A7
I added an extra / in the beginning
@gioboa Yes this works, but the problem wasn't with the index.tsx file. The below URL fetch works: The below URL fetch does not work: the fetch request for the button is missing the If I manually add this absolute URL details to the URL for the button VSCode opens the button component tsx file perfectly. |
i was able to reproduce it on my end, i added a if check to see if file path starts with prefix |
Yeah that loads perfectly on Windows now 🥳 Although I'll need to double check this again later when the CI Checks are passing Follow-up: |
✅ Confirmed: this patch successfully resolves the issue on Windows. Tested on Windows 11 24H2 using both VSCode and Cursor as editors, with the application running in Google Chrome (v139.0.7258.67) and Microsoft Edge (v138.0.3351.121). Thanks! |
did it work with cursor? because on my end the vite plugin only works with vsc, even with an independent script that uses the plugin directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Linux and Mac is working fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @LazyClicks for your help 🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔌
At some point we might use the vite dev url for a file instead, with a query parameter, and then in the plugin call launch-editor after resolving the path. But until then, this is very welcome 🤗 |
ah, i found another edge case where it's failing |
@LazyClicks perhaps you could try calling launch-editor directly from resolveId() in plugin.ts of qwik? Then you could call this.resolve to get the path when getting e.g. /src/root.tsx?openEditor And we'd change the optimizer to put vite paths in the jsxdev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help @LazyClicks
Hi, I'm encountering a problem with the Alt+Click "open in editor" feature and this fix doesn't work for me. In my qwikVite({
srcDir: new URL('./src/some/directory', import.meta.url).pathname
}) However, when I Alt+Click a component in the browser, the generated URL looks like this:
You can see that the some/directory part is duplicated in the file path. It seems that the path passed to qwikOpenInEditor() is relative to the repo root instead of being resolved relative to the configured srcDir. As a result, the final path is incorrect and the editor can't open the file. Let me know if I can help testing a fix. Thanks! |
Hi, thanks I appreciate the hint! It's working well without the srcDir, but that assumes the project is located directly under the default src/ directory. That said, I believe the core issue goes a bit deeper than just filtering out the "src" path. The real problem is that the path passed to the qwikOpenInEditor() function includes the srcDir portion as well as the srcDir itself. This leads to the srcDir being duplicated in the final result. For example: path: /src/presentation/app/components/xyz.tsx:50:9 srcDir: http://local.local/home/user/project/src/presentation/app/ So when the full path is constructed, the srcDir is effectively included twice, which breaks setups with custom directory structures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Can you create an issue for that? Would you like to drop a PR to fix that?
What is it?
Description
Checklist
pnpm change