Closed unbreakabl3 closed 2 months ago
So I know where this happenns specifically... it's in the vropkg/src/parse/transformers.ts
. It's actually something I wrote a while back to solve a use case and automatically transform these cases.
Problem Is, the regex is already complex and absurd enough as is... that I am not sure I want us to fiddle with it even further...
Should be something like:
https://regex101.com/r/K2cJ8Q/2
^(?!\s*(\/\/|\/\*|\*\/|\*)).*for each\s*\(\s*var\s+(\w+)\s+in\s+(\w+)\s*\)\s*\{\s*([\s\S]*?)\s*\}
But this also may cause other problems as it looks for *
in the beginning as well as / or // … The latter 2 don't bother me, but `` may be a problem. Also, it looks atrocious 😄
@VenelinBakalov what do you say?
As discussed with @VenelinBakalov, we'll do it.
Description
In TS vRO project, there is a bug. When in the commented code there is a
for each
instead offoreach
, the transpiled code in vRO uncomments this line.Example:
Will be transpiled to
If I remove the space in the commented
for each
, the code is commented properly.Steps to Reproduce
for each
loop with a space betweenfor
andeach
Preconditions: [What are the preconditions to reproduce the issue]
Expected behavior: [What you expect to happen]
The comment should comment anything
Actual behavior: [What actually happens]
The doesn't work properly in some cases
Reproduces how often: [What percentage of the time does it reproduce]
All the time
Component/s: [What are the Build Tools for VMware Aria components affected by the issue (e.g. "common/artifact-manager", "maven/plugins/vra-ng", "typescript/vrotest", etc)]
vRO TS Project
Affects Build/s: [Which are the Build Tools for VMware Aria releases / builds affected by the issue]
2.41.0
Environment
Client
Server
Failure Logs
Related issues and PRs
Additional Context