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

fix: update tree-sitter to latest #6231

Merged
merged 2 commits into from
Apr 14, 2024
Merged

fix: update tree-sitter to latest #6231

merged 2 commits into from
Apr 14, 2024

Conversation

MarkMcCulloh
Copy link
Contributor

@MarkMcCulloh MarkMcCulloh commented Apr 14, 2024

The primary goal of this PR is to update tree-sitter to the latest version. This resulted in:

  • Pinned tree-sitter to a git commit dependency until tree-sitter/tree-sitter@a7a47d5 is released. tree-sitter's release schedule is unpredictable and we don't publish any rust crates so this should be fine for now
  • The tree-sitter-traversal dependency is removed since it doesn't support newer versions of tree-sitter, so I just added some code for the equivalent functionality
  • Re-generated language bindings for tree-sitter. Due to a slight change in how tree-sitter builds it's hard to fully opt out of these (we do use the rust one). Luckily they should not require changing for a while
  • Added some additional ts queries and query tests, taken from the neovim tree-sitter repo
  • Changes to the scanner and rust parser to match the previous behavior of AUTOMATIC_SEMICOLON which had been broken
  • Changes to the scanner and rust parser to match the previous behavior of named and positional arguments. I didn't get an exact match but I think most cases actually look a little better now

Most of the new files here are a result of the binding regeneration and can kinda be ignored.

Side note: Also noticed that the automatic semicolon insertion hasn't been working for a while so I added a fix for that (see lsp.ts)

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

@MarkMcCulloh MarkMcCulloh requested a review from a team as a code owner April 14, 2024 03:49
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 @chriscbr
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 Apr 14, 2024

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

Last Updated (UTC) 2024-04-14 14:23

@monadabot
Copy link
Contributor

monadabot commented Apr 14, 2024

Benchmarks

Comparison to Baseline ⬜⬜⬜⬜🟥⬜🟥⬜🟥⬜⬜⬜⬜
Benchmark Before After Change
version 61ms±4.64 60ms±0.64 -1ms (-1.32%)⬜
functions_1.test.w -t sim 407ms±17.29 400ms±5.57 -8ms (-1.91%)⬜
functions_1.test.w -t tf-aws 830ms±9.72 825ms±6.45 -6ms (-0.71%)⬜
hello_world.test.w -t sim 397ms±6.71 405ms±8.51 +8ms (+2.1%)⬜
hello_world.test.w -t tf-aws 1494ms±8.76 1535ms±19.54 +42ms (+2.79%)🟥
jsii_big.test.w -t sim 2767ms±16.04 2796ms±10.03 +28ms (+1.02%)⬜
jsii_big.test.w -t tf-aws 2980ms±7.88 3032ms±18.94 +52ms (+1.73%)🟥
functions_10.test.w -t sim 486ms±8.17 496ms±6.85 +10ms (+2.04%)⬜
functions_10.test.w -t tf-aws 2021ms±9.71 2056ms±13.23 +35ms (+1.74%)🟥
jsii_small.test.w -t sim 372ms±5.04 371ms±4.18 -1ms (-0.17%)⬜
jsii_small.test.w -t tf-aws 600ms±4.41 608ms±4.08 +8ms (+1.31%)⬜
empty.test.w -t sim 366ms±6.89 365ms±3.99 -1ms (-0.27%)⬜
empty.test.w -t tf-aws 600ms±5.23 600ms±5.92 0ms (-0.08%)⬜

⬜ 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 60ms 59ms 62ms 1ms 1ms
functions_1.test.w -t sim 400ms 382ms 409ms 6ms 8ms
functions_1.test.w -t tf-aws 825ms 813ms 837ms 6ms 9ms
hello_world.test.w -t sim 405ms 393ms 434ms 9ms 12ms
hello_world.test.w -t tf-aws 1535ms 1511ms 1591ms 20ms 27ms
jsii_big.test.w -t sim 2796ms 2776ms 2812ms 10ms 14ms
jsii_big.test.w -t tf-aws 3032ms 2991ms 3084ms 19ms 26ms
functions_10.test.w -t sim 496ms 475ms 509ms 7ms 10ms
functions_10.test.w -t tf-aws 2056ms 2028ms 2087ms 13ms 18ms
jsii_small.test.w -t sim 371ms 363ms 381ms 4ms 6ms
jsii_small.test.w -t tf-aws 608ms 601ms 618ms 4ms 6ms
empty.test.w -t sim 365ms 356ms 372ms 4ms 6ms
empty.test.w -t tf-aws 600ms 587ms 612ms 6ms 8ms
Last Updated (UTC) 2024-04-14 14:27

apps/wing/src/commands/lsp.ts Show resolved Hide resolved
@clason
Copy link

clason commented Apr 14, 2024

Pinned tree-sitter to a git commit dependency until tree-sitter/tree-sitter@a7a47d5 is released. tree-sitter's release schedule is unpredictable and we don't publish any rust crates so this should be fine for now

Note that this doesn't help downstream users, who will have their own tree-sitter version (necessarily so, since they need to generate parsers for multiple different grammars). This PR will unbreak nvim-treesitter (until the next breaking change; tree-sitter is in a bit of flux right now), but it's not really sustainable. Not sure how to deal with this better, though; just wanted to make a note of this.

EDIT I worked around this in nvim-treesitter by skipping bindings when generating, so don't feel blocked by us. The general point still stands (downstream won't see the pin, so it's not 100% safe to rely on that).

Copy link
Contributor

mergify bot commented Apr 14, 2024

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

@mergify mergify bot merged commit ab4e6bb into main Apr 14, 2024
15 checks passed
@mergify mergify bot deleted the mark/update-tree-sitter branch April 14, 2024 14:28
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.70.8.

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.

4 participants