Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logpoints do not evaluate correctly #1707

Open
JustinGrote opened this issue Feb 15, 2022 · 5 comments
Open

Logpoints do not evaluate correctly #1707

JustinGrote opened this issue Feb 15, 2022 · 5 comments
Labels

Comments

@JustinGrote
Copy link
Collaborator

image

Expected: The actual value

@ghost ghost added the Needs: Triage Maintainer attention needed! label Feb 15, 2022
@JustinGrote JustinGrote added Area-Debugging Issue-Bug A bug to squash. and removed Needs: Triage Maintainer attention needed! labels Feb 15, 2022
@andyleejordan
Copy link
Member

Is this only in Preview?

@JustinGrote
Copy link
Collaborator Author

JustinGrote commented Feb 16, 2022

@andschwa pretty sure but haven't fully tested, I know it used to work just fine, I've used it before.

@fflaten
Copy link
Contributor

fflaten commented Aug 5, 2022

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.

@JustinGrote
Copy link
Collaborator Author

JustinGrote commented Aug 5, 2022

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.

@fflaten
Copy link
Contributor

fflaten commented Aug 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants