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.77k stars 189 forks source link

rename changes argument instead of only parameter #6547

Closed ekeren closed 2 weeks ago

ekeren commented 1 month ago

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

eladb commented 1 month ago

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?

monadabot commented 2 weeks ago

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