iljapostnovs / VSCodeUI5Plugin

Visual Studio Code Extension for UI5 Development
Apache License 2.0
61 stars 6 forks source link

Bug: Reference counting does not recognize closure references in consuming modules. #381

Closed richardatsap closed 10 months ago

richardatsap commented 10 months ago

Describe the bug

To Reproduce See example project: ui5-minimal.zip

Expected behavior Reference counting and code completion should work also for references in a modules closure.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

iljapostnovs commented 10 months ago

Hi,

The code outside of the class body is not parsed by the extension, so, if you want this example to work as expected, put Util into the class itself: image

richardatsap commented 10 months ago

Hi,

I use that pattern at a couple of places, that would be a major rewrite. As well, your suggestion will expose the reference to outside the consuming module which I would want to avoid.

I have the habit to put a bunch of stuff into the closure (=outside the class body), to enforce it being private. Eslint parses it just fine.

If you don't mind and it's feasible, take this as a feature request then ;-).

Kind Regards Richard

iljapostnovs commented 10 months ago

I will leave it as enhancement, no promises regarding when and if it will be done :)

iljapostnovs commented 10 months ago

It was actually easy to implement ;) Please check latest version and let me know if it works for you

richardatsap commented 10 months ago

Hi,

works like a charm. Thanks for fixing this.

Kind Regards Richard