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

feat: make logpoint parsing more resilient #252

Merged
merged 2 commits into from
Jan 22, 2020

Conversation

connor4312
Copy link
Member

Fixes #226. As suggested in the original issue, we use the TS parser
to parse the code inside the {} 'blocks', which lets us handle more
complex expressions. We also now support multiple statements, and
(try to) return the last one, and log the stacks of any thrown errors
rather than silently failing. Finally, we return a verbose error to the
user in the event that their logpoint isn't valid JS, though there's
an issue with VS Code right now: microsoft/vscode#89059

Fixes #226. As suggested in the original issue, we use the TS parser
to parse the code inside the {} 'blocks', which lets us handle more
complex expressions. We also now support multiple statements, and
(try to) return the last one, and log the stacks of any thrown errors
rather than silently failing. Finally, we return a verbose error to the
user in the event that their logpoint isn't valid JS, though there's
an issue with VS Code right now: microsoft/vscode#89059
@connor4312 connor4312 merged commit 2e1dfe9 into master Jan 22, 2020
@connor4312 connor4312 deleted the feat/logpoints-improvements branch January 22, 2020 15:43
@connor4312 connor4312 added this to the January 2020 milestone Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logPoints don't work correctly with } in the expression part
2 participants