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): rename refactor #6461

Merged
merged 7 commits into from
May 15, 2024
Merged

feat(vscode): rename refactor #6461

merged 7 commits into from
May 15, 2024

Conversation

tsuf239
Copy link
Collaborator

@tsuf239 tsuf239 commented May 12, 2024

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:

  • namespaces need a "customized" edit: bring ex; with externals as the new word won't become bring externals; but bring ex as externals;.

  • it seems like properties aren't declared/defined as the other symbols- so the current procedure isn't working for them.

  • Title matches Winglang's style guide

  • Description explains motivation and solution

  • Tests added (always)

  • Docs updated (only required for features)

  • Added pr/e2e-full label if this feature requires end-to-end testing

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

@tsuf239 tsuf239 requested a review from a team as a code owner May 12, 2024 12:56
Copy link

github-actions bot commented May 12, 2024

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 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
Copy link
Contributor

monadabot commented May 12, 2024

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

Last Updated (UTC) 2024-05-13 18:45

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 12, 2024
@monadabot
Copy link
Contributor

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

@tsuf239 tsuf239 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 12, 2024
@eladb
Copy link
Contributor

eladb commented May 13, 2024

Please include a detailed description with any important implementation notes

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.

LGTM great job!

libs/wingc/src/lsp/rename_visitor.rs Outdated Show resolved Hide resolved
libs/wingc/src/lsp/rename_visitor.rs Show resolved Hide resolved
libs/wingc/src/lsp/rename_request.rs Show resolved Hide resolved
libs/wingc/src/lsp/rename_request.rs Show resolved Hide resolved
Copy link
Contributor

mergify bot commented May 15, 2024

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.

mergify bot added a commit that referenced this pull request May 15, 2024
mergify bot added a commit that referenced this pull request May 15, 2024
@mergify mergify bot merged commit 79bddc6 into main May 15, 2024
15 checks passed
@mergify mergify bot deleted the tsuf/rename-refactor branch May 15, 2024 08:59
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.73.46.

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.

Support for rename refactoring in VSCode
4 participants