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

Support debugging individual Prism tests in VS Code #311

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Oct 29, 2024

Motivation

This is based on @amomchilov's prior work in prism...Shopify:sorbet:Alex/vscode-debugging

Debugging.Sorbet.Prism.tests.in.VS.Code.mp4

I'll also add this to #279 so we remove these stuff before upstreaming.

Test plan

See included automated tests.

Copy link

@egiurleo egiurleo left a comment

Choose a reason for hiding this comment

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

Thank you @st0012 and @amomchilov 🫶

@st0012 st0012 merged commit 6ff11c3 into prism Oct 29, 2024
1 check passed
@st0012 st0012 deleted the improve-debugger-integration branch October 29, 2024 14:30
Copy link

@amomchilov amomchilov left a comment

Choose a reason for hiding this comment

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

A bit late toeh party, but I left some comments

"preLaunchTask": "Prepare tests debugging",
"stopOnEntry": false,
"sourceMap": {
"${env:BAZEL_EXEC_ROOT}": "${workspaceFolder}",

Choose a reason for hiding this comment

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

Nice.

{
"label": "Prepare tests debugging",
"type": "shell",
"command": "export BAZEL_EXEC_ROOT=$(./bazel info execution_root)",

Choose a reason for hiding this comment

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

IIRC it's beneficial to use the same configuration here, otherwise the Bazel server restarts

Suggested change
"command": "export BAZEL_EXEC_ROOT=$(./bazel info execution_root)",
"command": "export BAZEL_EXEC_ROOT=$(./bazel info execution_root --config=dbg)",

Copy link
Member Author

Choose a reason for hiding this comment

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

Does bazel info requires starting a server? I tried running it manually with/out the flag and I don't see any difference.

{
"id": "test_name",
"type": "promptString",
"description": "Enter the test name, e.g. case for running test/prism_regression/case.rb",

Choose a reason for hiding this comment

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

Should we add a default, to give an example input?

Choose a reason for hiding this comment

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

Also, is there an equivalent to this:

// With this option, when running this task with the `Tasks: Rerun Last Test` command, it'll
// reuse the previous run's input, rather than prompting for it again
"runOptions": {
"reevaluateOnRerun": false
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Personally, I wouldn't use default for example. I think that's what description should do:

Screenshot 2024-10-29 at 14 57 42

Also, is there an equivalent to this:

No it's not available for launch entries. But the input should automatically be filled with the previous value by default. Does that not happen?

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.

3 participants