zero-plusplus / vscode-autohotkey-debug

https://marketplace.visualstudio.com/items?itemName=zero-plusplus.vscode-autohotkey-debug
52 stars 4 forks source link

Output object directly, without label #322

Open Lexikos opened 6 months ago

Lexikos commented 6 months ago

I often find that I want to simply output the immediate properties of an object at a given point in the code.

With the current behaviour of the output directive in v1.11.0, I must click on the label (variable name or expression) to expand it. This inhibits productivity and seems suboptimal for several reasons.

Although the J and Jo format options of #244 seem to be a helpful workaround, I think it would be ideal to change the behaviour of the output directive and logpoint so that a single output consisting only of an {object} will omit the initial object label line and instead output only the part that would normally be shown by expanding the label once, i.e. object: ClassName {Properties}. I think it should be default behaviour, but a setting to enable it would be equally welcome.

A format option to expand the object by default would also be welcome (my searching did not turn up any existing or planned way to do this).

zero-plusplus commented 6 months ago

I think you are right, this should be improved.

A format option to expand the object by default would also be welcome (my searching did not turn up any existing or planned way to do this).

As far as I have checked in the past, it is not possible to expand objects from the adapter side.

I think I can solve this issue by using an idea I came up with some time ago and didn't register in Issues.

The grouping feature of the Output Directive (But broken since v1.10.0 ...) allows for controlled folding/expand and can also be checked after the debugger has exited.

By using this specification to simulate object output, it would be possible to solve the issues and make an ideal object output.

However, due to the high processing costs involved in retrieving all the object's child elements when logging output, it is ideal to be able to change these behaviours by using format specifiers or by using attributes in launch.json. (I think "lazy" or "immediate" would be a good value for the attribute).


I am currently working towards v2.0.0, but it is taking a long time due to the fact that I am rebuilding the code from scratch (which is why I haven't been able to provide exception breakpoints yet).

This will probably delay the provision of this improvement.

The reason for rebuilding the code is due to the lack of understanding of the debugger adaptor and the fact that it has become very complex as a result of multiple patching for new features etc., which will have a significant impact on future development.

It has also taken a long time due to the fact that it is difficult to work freely on development for various reasons.

Current development branch is v2.0.0-develop. I am continuing to develop it here, little by little, so it would be helpful if you could continue to contribute ideas.