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(vscode): improved wing debugging and docs (breakpoints) #5981

Merged
merged 9 commits into from
Mar 19, 2024

Conversation

MarkMcCulloh
Copy link
Contributor

image

To support this, a change was made to the simulator to bundle inflights next to the entrypoint. This helps VSCode (and other debugger probably) to discover the file that's running.

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

Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistence, don't hesitate to ping the relevant owner over Slack.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @eladb
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon

@monadabot
Copy link
Contributor

monadabot commented Mar 18, 2024

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

Last Updated (UTC) 2024-03-19 02:49

@monadabot
Copy link
Contributor

monadabot commented Mar 18, 2024

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 60ms±0.46 61ms±0.79 +2ms (+2.95%)🟥
empty.test.w -t sim 521ms±31.34 497ms±3.47 -24ms (-4.61%)⬜
empty.test.w -t tf-aws 712ms±6.14 713ms±5.42 +2ms (+0.22%)⬜
hello_world.test.w -t sim 525ms±6.1 533ms±10.17 +8ms (+1.55%)⬜
hello_world.test.w -t tf-aws 1651ms±7.69 1661ms±4.75 +11ms (+0.64%)⬜
functions_10.test.w -t sim 602ms±7.79 607ms±8.16 +5ms (+0.75%)⬜
functions_10.test.w -t tf-aws 2245ms±9.45 2257ms±12.63 +12ms (+0.53%)⬜
jsii_small.test.w -t sim 499ms±10.88 500ms±6.79 +1ms (+0.26%)⬜
jsii_small.test.w -t tf-aws 719ms±5.43 720ms±4.4 +1ms (+0.12%)⬜
jsii_big.test.w -t sim 2927ms±10.36 2931ms±7.01 +4ms (+0.12%)⬜
jsii_big.test.w -t tf-aws 3139ms±8.27 3138ms±12.03 -1ms (-0.04%)⬜
functions_1.test.w -t sim 518ms±6.1 522ms±4.02 +4ms (+0.7%)⬜
functions_1.test.w -t tf-aws 960ms±5.66 955ms±7.28 -5ms (-0.51%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 61ms 60ms 63ms 1ms 1ms
empty.test.w -t sim 497ms 487ms 502ms 3ms 5ms
empty.test.w -t tf-aws 713ms 702ms 729ms 5ms 8ms
hello_world.test.w -t sim 533ms 510ms 561ms 10ms 14ms
hello_world.test.w -t tf-aws 1661ms 1653ms 1672ms 5ms 7ms
functions_10.test.w -t sim 607ms 586ms 624ms 8ms 11ms
functions_10.test.w -t tf-aws 2257ms 2226ms 2289ms 13ms 18ms
jsii_small.test.w -t sim 500ms 488ms 521ms 7ms 9ms
jsii_small.test.w -t tf-aws 720ms 710ms 727ms 4ms 6ms
jsii_big.test.w -t sim 2931ms 2914ms 2942ms 7ms 10ms
jsii_big.test.w -t tf-aws 3138ms 3112ms 3162ms 12ms 17ms
functions_1.test.w -t sim 522ms 514ms 533ms 4ms 6ms
functions_1.test.w -t tf-aws 955ms 940ms 971ms 7ms 10ms
Last Updated (UTC) 2024-03-19 02:54

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Yey!

docs/docs/06-tools/03-debugging.md Outdated Show resolved Hide resolved

### Limitations

- When using the Wing Console (`wing it`) and attempting to debug `inflight` code in a `test` or Function, the first execution of the test will not hit a breakpoint and will need to be run again
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- When using the Wing Console (`wing it`) and attempting to debug `inflight` code in a `test` or Function, the first execution of the test will not hit a breakpoint and will need to be run again
- When using the Wing Console (`wing it`) and attempting to debug inflight code in a `test` or Function, the first execution of the test will not hit a breakpoint and will need to be run again

I don't see a reason to quote inflight every time. It's a term we use, not a symbol.

Copy link
Contributor Author

@MarkMcCulloh MarkMcCulloh Mar 18, 2024

Choose a reason for hiding this comment

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

I use inflight over "inflight" pretty often because it's a keyword. I would do the same with let or class. Should inflight specifically not use "`" or should other keywords also not get backticks?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use backticks when we refer to the keyword and no backticks when we refer to the concept or the term.

For example:

  • "Let's declare a class that represents an employee."

  • "To declare a data shape use the struct keyword followed by the name of the struct"

  • "This value is a constant"

Makes sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To me, the keyword is the concept and vice-versa. It helps my brain establish the link between the two, so that when I see the word in code I'll think of the concept and when I read the word in docs I'll think about how it's used in code.

I don't get confused when I see alternating struct vs "struct" so always using backticks isn't crazy important to me, but I'm not sold on the reasoning to avoid them so far.

The only reason I do get is aesthetics, because keywords can be pretty ugly when overused. So if that's part of our "Style Guide" then ok.

docs/docs/06-tools/03-debugging.md Outdated Show resolved Hide resolved
docs/docs/06-tools/03-debugging.md Outdated Show resolved Hide resolved
docs/docs/06-tools/03-debugging.md Outdated Show resolved Hide resolved
docs/docs/06-tools/03-debugging.md Show resolved Hide resolved
Copy link
Contributor

mergify bot commented Mar 19, 2024

Thanks for contributing, @MarkMcCulloh! This PR will now be added to the merge queue, or immediately merged if mark/debugging-plus is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit ed54e0c into main Mar 19, 2024
25 checks passed
@mergify mergify bot deleted the mark/debugging-plus branch March 19, 2024 03:00
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.61.16.

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

Successfully merging this pull request may close these issues.

3 participants