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

rename changes argument instead of only parameter #6547

Closed
ekeren opened this issue May 23, 2024 · 2 comments · Fixed by #6637
Closed

rename changes argument instead of only parameter #6547

ekeren opened this issue May 23, 2024 · 2 comments · Fixed by #6637
Assignees
Labels
🐛 bug Something isn't working 🔌 vscode-extension Issues related to the Wing VS Code extension

Comments

@ekeren
Copy link

ekeren commented May 23, 2024

I tried this:

have the following code

class Example {
  var b: cloud.Bucket;
  new(c: cloud.Bucket){
    this.b = new cloud.Bucket();
  }

  something(b: cloud.Bucket) {
    this.b = b;
    //   ^ put cursor on this
  }
}

This happened:

I put the cursor on the code inside something method

    this.b = b;
    //   ^ put cursor on this

and renamed to renamed, the result is:

bring cloud;

class Example {
  var b: cloud.Bucket;
  new(c: cloud.Bucket){
    this.b = new cloud.Bucket();
  }

  something(renamed: cloud.Bucket) {
    this.renamed = renamed;
  }
}

Notice that:

  1. the actual member name wasn't renamed
  2. The argument of something was renamed

Instead, lets prevent this

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

0.74.8

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@ekeren ekeren added the 🐛 bug Something isn't working label May 23, 2024
@eladb
Copy link
Contributor

eladb commented May 23, 2024

Yes, encountered this too and was too lazy to submit an issue.

What is our strategy for implementing renames? Isn't it based on the compiler references? If not, why?

@staycoolcall911 staycoolcall911 added the 🔌 vscode-extension Issues related to the Wing VS Code extension label May 26, 2024
@tsuf239 tsuf239 self-assigned this May 30, 2024
mergify bot pushed a commit that referenced this issue Jun 13, 2024
fixes [#6546](#6546)
fixes [#6547](#6547)
fixes [#6484](#6484)
fixes [#6584](#6584)

I added some more visitors and cases to the `rename_request` to enable renaming of class members and struct properties 

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [x] 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](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
@mergify mergify bot closed this as completed in #6637 Jun 13, 2024
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.74.58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🔌 vscode-extension Issues related to the Wing VS Code extension
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants