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

custom class internals are not rendered correctly #6459

Closed ekeren closed 3 weeks ago

ekeren commented 1 month ago

I tried this:

Start with this code:

bring cloud;
class X {
  b: cloud.Bucket;
  new(){
    this.b = new cloud.Bucket();
  }
  pub f(){
    this.b.onEvent(inflight () => {});
  }
  pub inflight ff(){
    this.b.put("sdads","dsadsa");
  }
}
let api = new cloud.Api();
let b = new cloud.Bucket();
new cloud.Function(inflight () => {
  b.put("file.txt", "dsasd" );
  b.get("dsasd");
});
new cloud.Function(inflight () => {
  b.put("file.txt", "dsasd" );
  b.get("dsasd");
  b.list();
}) as "2";
api.post("/doc/:id", inflight (req) => {

});

It should render something like this: image

Now add let x = new X(); at the end of the file, it renders this: image

This happened:

If I stop and start wing run it will show a correct representation: image

I expected this:

It should have generate the right structure

Is there a workaround?

No response

Anything else?

No response

Wing Version

0.73.41

Node.js Version

No response

Platform(s)

No response

Community Notes

monadabot commented 3 weeks ago

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