winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.73k stars 185 forks source link

feat(vscode): rename refactor #6461

Closed tsuf239 closed 1 month ago

tsuf239 commented 1 month ago

Checklist

fixes: #4596 https://www.loom.com/share/234a65f04ecb471b84621aa0cf27f66c

Created a new rename_visitor that has a list of symbol declarations and the references to them. it adds a symbol either as a reference or as a declaration during the visit. when executing create_text_edits it chooses the symbol declaration and references the position belongs to and creates textEdits with the new_text passed by the LSP. I also updated the get_ranges method to get all ranges in a certain line (and not only the first one)

Currently, the renaming of class properties and namespaces is unsupported:

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

github-actions[bot] commented 1 month ago

Thanks for opening this pull request! :tada: 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 Discord.

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 commented 1 month ago

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

Last Updated (UTC) 2024-05-13 18:45
monadabot commented 1 month ago

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ | Benchmark | Before | After | Change | | :-- | --: | --: | --: | | version | 55ms±0.12 | 57ms±0.87 | +2ms (+3.47%)🟥 | | functions_1.test.w -t sim | 408ms±16.19 | 396ms±2.69 | -11ms (-2.81%)⬜ | | functions_1.test.w -t tf-aws | 816ms±4.36 | 825ms±9.84 | +8ms (+1.01%)⬜ | | jsii_big.test.w -t sim | 2791ms±15.37 | 2794ms±12.48 | +3ms (+0.1%)⬜ | | jsii_big.test.w -t tf-aws | 2988ms±10.49 | 2998ms±10.38 | +10ms (+0.34%)⬜ | | functions_10.test.w -t sim | 486ms±5.17 | 489ms±7.14 | +3ms (+0.54%)⬜ | | functions_10.test.w -t tf-aws | 2009ms±8.27 | 2012ms±13.16 | +3ms (+0.17%)⬜ | | jsii_small.test.w -t sim | 370ms±4.58 | 371ms±5.69 | +1ms (+0.24%)⬜ | | jsii_small.test.w -t tf-aws | 604ms±4.46 | 608ms±5.35 | +4ms (+0.62%)⬜ | | empty.test.w -t sim | 358ms±3.56 | 360ms±3.16 | +2ms (+0.6%)⬜ | | empty.test.w -t tf-aws | 594ms±5.68 | 591ms±3.9 | -3ms (-0.46%)⬜ | | hello_world.test.w -t sim | 392ms±2.98 | 403ms±4.96 | +11ms (+2.77%)⬜ | | hello_world.test.w -t tf-aws | 1515ms±18.59 | 1517ms±6.41 | +2ms (+0.14%)⬜ | ⬜ 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|57ms|56ms|60ms|1ms|1ms| |functions_1.test.w -t sim|396ms|388ms|400ms|3ms|4ms| |functions_1.test.w -t tf-aws|825ms|804ms|847ms|10ms|14ms| |jsii_big.test.w -t sim|2794ms|2768ms|2819ms|12ms|17ms| |jsii_big.test.w -t tf-aws|2998ms|2975ms|3029ms|10ms|15ms| |functions_10.test.w -t sim|489ms|473ms|502ms|7ms|10ms| |functions_10.test.w -t tf-aws|2012ms|1965ms|2031ms|13ms|18ms| |jsii_small.test.w -t sim|371ms|359ms|384ms|6ms|8ms| |jsii_small.test.w -t tf-aws|608ms|598ms|621ms|5ms|7ms| |empty.test.w -t sim|360ms|350ms|366ms|3ms|4ms| |empty.test.w -t tf-aws|591ms|579ms|599ms|4ms|5ms| |hello_world.test.w -t sim|403ms|389ms|413ms|5ms|7ms| |hello_world.test.w -t tf-aws|1517ms|1501ms|1530ms|6ms|9ms|
Last Updated (UTC) 2024-05-12 13:23
eladb commented 1 month ago

Please include a detailed description with any important implementation notes

mergify[bot] commented 1 month ago

Thanks for contributing, @tsuf239! This PR will now be added to the merge queue, or immediately merged if tsuf/rename-refactor is up-to-date with main and the queue is empty.

monadabot commented 1 month ago

Congrats! :rocket: This was released in Wing 0.73.46.