-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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(cli): improved diagnostics printing #22049
Conversation
This initially uses the new diagnostic printer in `deno lint`, `deno doc` and `deno publish`. In the limit we should also update `deno check` to use this printer.
d4d82aa
to
a560699
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, a few nits and questions.
I think we should aim to rewrite TS diagnostics to use this system in the next patch release. Thoughts?
/// Returns the text of the line that contains the given positions, split at the | ||
/// given positions. | ||
/// | ||
/// If the positions are on different lines, this will panic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this okay? Maybe it should return an option and not panic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caller ensures they are on the same line already.
// error[missing-return-type]: missing explicit return type on public function | ||
// at /mnt/artemis/Projects/github.com/denoland/deno/test.ts:1:16 | ||
// | | ||
// 1 | export function test() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think in the future we could syntax highlight this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely!
Yeah, sounds good. It's a bit more involved because TS diagnostics can be "nested", so the printer needs to become a bit smarter. I attempted it briefly, but then realized that it would be too much work to do right away. I estimate 2-3 days of work to get it all perfect. |
This initially uses the new diagnostic printer in `deno lint`, `deno doc` and `deno publish`. In the limit we should also update `deno check` to use this printer.
This initially uses the new diagnostic printer in
deno lint
,deno doc
anddeno publish
. In the limit we should also updatedeno check
to use this printer.