Skip to content
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

feat(console): improve jump to error when runing in vscode #4012

Merged

Conversation

polamoros
Copy link
Contributor

@polamoros polamoros commented Aug 30, 2023

When opening a hyperlink in vs-code, the default behavior is to open the hyperlink in the currently focused 'Editor Group.'

However, when we have the Console open side by side with the wing file, this default behavior causes vs-code to open the file as a new tab in the Console panel group (if the group where you have the Console is focused).

This PR adds two new endpoints: [POST] app.openFileInEditor and app.openFileInEditorSubscription
When clicking on an error link the Console emits an event named openFileInEditor.
Code editors like vscode (and potentially others) can subscribe to the new sub endpoint to receive these events.

Previous behaviour (using hyperlinks)

Screen.Recording.2023-08-30.at.11.51.25.mov

New behaviour (using sub)

Screen.Recording.2023-08-30.at.11.52.58.mov

Weird case when you have 425924593 groups

Screen.Recording.2023-08-30.at.11.55.03.mov

resolves #3337

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@polamoros polamoros marked this pull request as ready for review August 30, 2023 10:04
@skyrpex
Copy link
Contributor

skyrpex commented Sep 1, 2023

By default, clicking on a FileLink should use https://github.com/yyx990803/launch-editor/tree/master, which is what Vite uses.

For the VSCode extension specifically, it should be disabled since it does more than just opening the file.

@monadabot
Copy link
Contributor

monadabot commented Sep 4, 2023

Console preview environment is available at https://wing-console-pr-4012.fly.dev 🚀

Updated (UTC): 2023-09-04 10:00

@polamoros
Copy link
Contributor Author

By default, clicking on a FileLink should use https://github.com/yyx990803/launch-editor/tree/master, which is what Vite uses.

For the VSCode extension specifically, it should be disabled since it does more than just opening the file.

I created a new issue to add it:
#4067

@skyrpex
Copy link
Contributor

skyrpex commented Sep 4, 2023

The impl looks good to me 👍🏻

@polamoros polamoros changed the title fix(console): jump to error doesnt go to the correct tab in vscode feat(console): improve jump to error when runing console in vscode Sep 5, 2023
@polamoros polamoros changed the title feat(console): improve jump to error when runing console in vscode feat(console): improve jump to error when runing in vscode Sep 5, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 5, 2023

Thanks for contributing, @polamoros! This PR will now be added to the merge queue, or immediately merged if 3337-jump-to-error-doesnt-go-to-the-correct-tab-in-vscode is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Sep 5, 2023
mergify bot added a commit that referenced this pull request Sep 5, 2023
@mergify mergify bot merged commit 8fc4006 into main Sep 5, 2023
13 checks passed
@mergify mergify bot deleted the 3337-jump-to-error-doesnt-go-to-the-correct-tab-in-vscode branch September 5, 2023 09:06
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.29.1.

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.

Jump to error doesn't go to the correct tab in VSCode
3 participants