microsoft / microsoft/vscode-js-debug
Copy, store as `temp` and more from hover: allow global `customPropertiesGenerator` for user macros
@connor4312 is already working on this.
Since Aug 5, 2023.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 373
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 6
Description
Is your feature request related to a problem? Please describe.
Hi! First of all, I want to thank you for adding this excellent feature (I'm really not sure what its deprecated), I have already added a lot of macros for general and more specific use. For example, when I go deeply when observing the properties of some object I want to store the value in a temp variable so I can call methods with specific arguments, copy its value, etc...
"customPropertiesGenerator": "function () { return {...this, get _storeAsTemp() { globalThis.temp = this; return true; } }",
It could also be a button to call any function without writing a line in the console:
"customPropertiesGenerator": "function __() { const o = { ...this, get _storeAsTemp() { globalThis.temp = this; return true } }; if(typeof this === 'function' && this.length === 0) Object.defineProperty(o, '__functionResult', { get: () => this.apply(this) }); return o; },
Also, it would be useful to have a way to copy the access path to use it in debugging code later e.g. variable.items[0].text, however, it seems impossible with customPropertiesGenerator
Describe the feature you'd like
Probably add a global vscode setting so I add properties like _storeAsTemp to any configuration I launch, including the Node Terminal.
Also, can I have a few questions regarding this feature?
- How to make it not show in the variables view? I have tried a few different things but didn't find a solution yet
I don't understand why it breaksupdate: example from documentation is misleading you should never use rest syntax[[Prototype]]property and why thecopyfunction doesn't work incustomPropertiesGenerator...because of getters and prototype
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.