Skip to content

Mark code in every message with backticks: blue in the CLI, code font in the IDE #532

Closed

Description

@CatarinaGamboa

Messages mix our own words with code and spec expressions, and nothing tells them apart:

State Refinement Error: found markState(buffered) == unmarked but expected markState(buffered) == marked
Call buffered.mark(int) before this call; afterwards markState(buffered) == marked
Origin: line 134, new BufferedInputStream(stream) makes markState(buffered) == unmarked

Proposal (PM, 2026-11-10)

Every message that shows code marks it, not just the notes. That covers:

  • headlines (found … but expected …, expected … but could not prove it);
  • hints;
  • message notes (Origin:);
  • the declared-here gloss (where … means …);
  • counterexamples.

The marker is backticks inside the message string: found `markState(buffered) == unmarked` but expected `markState(buffered) == marked` .

  • CLI: show each code span in blue (ANSI) without the backticks. With colour off (NO_COLOR, or not a terminal), keep the backticks, as rustc does.
  • Plain-text consumers (the Problems tab, the diagnostic hover): get the string with backticks, which reads like rustc's messages.
  • IDE panel: renders each span in the editor font (vscode-liquidjava#192).
  • Escaping: code that itself contains a backtick needs escaping or a longer fence; char/string literals rarely do.

Line references (line 134) also carry their file and position in the diagnostic data, so the IDE can make them clickable.

Activity

  1. changed the title [-]Structured message notes: tell code from prose, carry source positions[/-] [+]Mark code in every message with backticks: blue in the CLI, code font in the IDE[/+] on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    studyNeeded before the error-message user study

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions