Skip to content

Show the declared-here gloss of state errors in the IDE #181

Closed

Description

@CatarinaGamboa

Problem

liquid-java/liquidjava#515 makes the CLI print a gloss under the "Refinement declared here" excerpt of a state error when the declaration writes states of named sets in the shorthand:

--> Refinement declared here:
13 |     @StateRefinement(from = "closed(this) && unlocked(this)", to = "opened(this)")
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  where closed(this) means doorState(this) == closed, unlocked(this) means lockState(this) == unlocked

The headline shows doorState(d) == closed && lockState(d) == unlocked, so the gloss is what connects the two notations.

The extension does not show the declaration excerpt at all: StateRefinementErrorDTO only sends declarationPosition, and renderLocation (client/src/webview/views/sections.ts) shows it as a location link. So the gloss does not reach the IDE.

The hints already reach it unchanged (they are plain message text in hints), so the new hint notation needs no change here.

Proposal

  • Server: send the gloss lines in StateRefinementErrorDTO, e.g. a declarationNotes: string[] field from StateRefinementError.getDeclarationNotes(...) (the verifier reads the declaration text from the source; the server can do the same, or the verifier can expose the lines directly).
  • Client: show them under the declaration's location link, in the same style as the other notes.

Only when there are lines; nothing changes for declarations written in value form (doorState(this) == closed) or with unnamed sets.

Depends on liquid-java/liquidjava#515's PR.

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