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

refactor(cli/fmt_errors): Color stack traces in Rust #7628

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

nayeemrmn
Copy link
Collaborator

This duplicates formatting logic from prepareStackTrace() to cli/fmt_errors and removes colouring logic from prepareStackTrace(). In return, there's no JsStackFrame::formatted_frames, error formatting as a whole is greatly simplified and partially moving prepareStackTrace() to core should be easier.

cc @bartlomieju

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nayeemrmn this looks great! I think formatCallSite could be removed from JS altogether if we replaced it with an op?

@nayeemrmn
Copy link
Collaborator Author

I think formatCallSite could be removed from JS altogether if we replaced it with an op?

Will that work with the copy in cli/tsc?

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @nayeemrmn, I'll work on the format op

@bartlomieju
Copy link
Member

I think formatCallSite could be removed from JS altogether if we replaced it with an op?

Will that work with the copy in cli/tsc?

@ry and I discussed this matter and we think of using default error.stack for deno_core::JsError. All the coloring and source mapping would be a CLI-only operation. cli/tsc is JavaScript only code so it doesn't need source mapping support and coloring could still be done in Rust.

@bartlomieju bartlomieju merged commit a43984c into denoland:master Sep 22, 2020
@nayeemrmn nayeemrmn deleted the color-stack-traces-in-rust branch September 22, 2020 22:13
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.

2 participants