fix: improve ParseDiagnostic display format#330
Merged
bartlomieju merged 1 commit intoMay 2, 2026
Conversation
bartlomieju
added a commit
to bartlomieju/deno_graph
that referenced
this pull request
Mar 14, 2026
Remove string-parsing logic (clean_parse_message, format_parse_diagnostic) from deno_graph and delegate to deno_ast's improved ParseDiagnostic::Display. See: denoland/deno_ast#330 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dsherret
reviewed
Mar 14, 2026
bartlomieju
commented
Mar 14, 2026
5d01e64 to
97631e5
Compare
bartlomieju
added a commit
to bartlomieju/deno_graph
that referenced
this pull request
Mar 14, 2026
Remove string-parsing logic (clean_parse_message, format_parse_diagnostic) from deno_graph and delegate to deno_ast's improved ParseDiagnostic::Display. See: denoland/deno_ast#330 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
97631e5 to
4dccfb4
Compare
Restructure the error display to show line numbers with pipe margins, add SyntaxError: prefix, and move the location after the snippet. Refactors get_range_text_highlight to return structured HighlightEntry data instead of a plain string, enabling direct formatting with line numbers without string parsing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4dccfb4 to
beb69fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SyntaxError:prefix toParseDiagnostic::Displayoutputget_range_text_highlightintoget_range_highlight_entriesreturning structuredHighlightEntrydata instead of a plain stringBefore:
After:
Context
This was requested as part of denoland/deno_graph#637 (review) — the formatting logic belongs in
deno_astrather than being done by parsing the display string indeno_graph.