PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Logpoints do not evaluate correctly
Expected: The actual value
Is this only in Preview?
@andschwa pretty sure but haven't fully tested, I know it used to work just fine, I've used it before.
I think you might be remembering wrong. AFAIK this is just a string, so you'd need to use subexpression for properties.
Update: Tested in stable and 2021.8.0. No change and $($test.TestProperty)
works as expected.
If anything I'd consider adding support for {}
as $()
since VSCode hardcodes the placeholder-text Message to log when breakpoint is hit. Expressions within {} are interpolated. 'Enter' to accept, 'esc' to cancel.
. Unless that is customizable somehow.
If {} is present it could just be replaced with $() before being sent to the evaluator. Good call on it being brought in as a string and not a scriptblock, wonder if there's a way to modify the placeholder text per-extension to be more clear on this.
If {} is present it could just be replaced with $() before being sent to the evaluator.
Will likely have to use AST-parsing to not break expressions with scriptblocks, ex Logpoint reached. {($myList | ? { $_ }).Count} items in list
. I've personally never used scriptblocks in them, but Murphy's law says someone is 🙂 Would that be too slow to be considered?
wonder if there's a way to modify the placeholder text per-extension to be more clear on this.
I can't really see a way to customize it without trying to override using localization, but I doubt we could change language pack depending on document language. I've submitted a feature request (microsoft/vscode#157324) for language-specific syntax in the placeholder-text.