Repository navigation
Show the error's origin, counterexample and hints in the editor hover as markdown, and code in the view as in the hover - #198
Conversation
|
Codex review, round 1 (
No findings, so no further rounds. |
|
Clean-code audit (SOLID / DRY / KISS) of this PR's diff
Nothing to change. |
VS Code's diagnostic hover is plain text and leaves the hints out, so the extension's hover now adds them in markdown over the error: code spans as inline code, the lines they name as links to that line, the rest escaped. The parsing of code spans and references moves to a module that the panel and the hover share, and so does the grouping of call sequences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l code as in the hover The diagnostic message is now the headline alone, with the code it marks written without backticks, since VS Code shows that message as plain text (hover, Problems tab, problem view). The notes, the counterexample and the hints go to the extension's markdown part of the hover, with inline code and line links, as the hints already did. In the LiquidJava view, code in a message gets the look of inline code in a markdown hover (textCodeBlock.background) instead of the preformatted-text colours, which drew grey boxes around the Origin and Hint code in light themes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
7442f7e to
9b6502c
Compare
Codex review, round 1
Declined. A diagnostic without a position has no file either, and Nothing else reported. |
It is the text of the Problems tab, the problem view and the hover's problem part, not of the hover alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Clean-code reviewAudit of this PR's own diff with the clean-code-principles checklist.
Nothing else: the hover, the markdown formatter and the HTML renderer each keep one job, and the parser they share has one home ( |
…s title The PM wants the error, its origin and its hints all rendered alike. The diagnostic's message is now the title alone, so the Problems tab and the problem view show the error type, and the card under it shows the headline with its code as inline code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Round 2 (acbeda2): the headline is in the markdown card as well, with its code as inline code; the diagnostic itself now carries only the title, so the Problems tab and F8 show the error type (screenshot row added to the description). Hover and Problems screenshots in the description are from this build, dark and light. |
Closes #197
What changes
The editor hover shows a LiquidJava error as one markdown card: VS Code's own problem part holds only the title (it renders that message as plain text), and the extension's markdown part under it holds the headline, the origin notes, the counterexample and the hints:
line 134) is a link that opens that file at that line, from the structuredreferences(SourceReferenceDTO), not a text search;*,_,<,|,#in expressions stay literal.In the LiquidJava view, the code in the Origin line and in the hints gets the look of inline code in a markdown hover (
textCodeBlock.background, inherited colour) instead of the preformatted-text colours, which drew grey boxes around it in light themes.Before this PR, the hints were not in the editor hover at all, and the notes and counterexample were plain text with raw backticks.
Server: the diagnostic message is the title alone (
LJDiagnosticsHandler.diagnosticMessage). This is what the Problems tab, F8 and the squiggle show; the headline, the notes and the counterexample are in the hover's card and in the view.Shared parsing. The code-span and reference parsing that #193 wrote for the panel moves from
webview/message-text.tstoutils/message-text.ts(splitMessageText, novscodeimport, so both bundles use it). The panel renders the segments as HTML, the hover as markdown (utils/message-markdown.ts,formatDiagnosticMarkdown). The grouping of call sequences into options (groupHints) moves there too.Trust. The links are
file:URIs with an#L<line>,<col>fragment, which VS Code opens without a command, so the markdown part is not trusted (noisTrusted, no command links). The existing refinement hover keeps its own trustedMarkdownString; the diagnostic card is a separate part of the hover.Design choice
VS Code's diagnostic hover is always plain text, and the same string is the Problems tab entry. Rendering the headline in markdown without showing it twice means the diagnostic itself carries only the title, so the Problems tab and the problem view (F8) show the error type, not the headline (screenshot below). The PM chose the card over the Problems tab text (2026-11-11); putting
Title: headlineback in the diagnostic is a one-line change indiagnosticMessageif that is ever wanted.Screenshots
Headless VS Code (openvscode 1.109), verifier 0.0.38, study task A1_38, cursor on the error. Before =
main+ the first version of this PR (hints only); after = this PR.The first version's screenshots (hints only, E_A3_07 with a clickable
line 51, A1_09 with two call sequences) are in the PR's history underpr-screenshots/197/*-after.pngand*-link.png.Not in this PR
getRangeFromPositionusesendColumn - 1), so on the last character of the error our part shows without the problem part. Pre-existing; left alone.x@51) in the hover's code are shown as the verifier writes them; Render the verifier's line tags as subscripts and name every part of an error alike #196 renders them as subscripts in the panel only.Tests
utils/message-markdown.spec.ts: code spans incl. a multi-backtick and a padded span, the link at the reference'sstart, escaping of* < _ | #; call sequences as options; a diagnostic's headline, then notes, then counterexample, then hints; the headline alone when it has nothing else.LJDiagnosticsHandlerTest: the diagnostic's message is the title alone.npm run test:unit(140 passed),npm run test:typecheck,npm run lint,npx tsc --noEmit. Server:mvn -B test -Dtest=LJDiagnosticsHandlerTest.main(after Render the verifier's line tags as subscripts and name every part of an error alike #196); the conflict inwebview/message-text.tsresolved as described in the overlap note of the first version.🤖 Generated with Claude Code