Repository navigation
Show the Context tab's refinements as the error messages show them - #186
CatarinaGamboa wants to merge 3 commits into
Conversation
The server formats the context with the verifier's display: states of a named set as values of the set (display(host) == notDisplayable), one DisplayNames for the context so values are named host@23 as in error messages, and the values the verifier introduces (##...) are no longer listed: one equal to a single expression is replaced by it, and a fact about an unconstrained one is left out. Ghost states are recognised by their parent set instead of a regex on state1(_) == 0, so states of a named set are states, shown as set(Type) == state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review, round 1Full review comments:
Both fixed in the next commit: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review, round 2
Nothing left to fix from Codex. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clean-code audit (clean-code-principles)Fixed: the first one, in the latest commit. |
Closes #184. Closes #177.
The Context tab now shows refinements the way the error messages of verifier 0.0.37 do. It works with the released verifier 0.0.37, so no verifier change or release is needed.
What changes
Server (
server/src/main/java/dtos/context)ContextDisplay, built once perContextHistory. It does three things:StateValues.toSetForm:display(host) == notDisplayableinstead ofnotDisplayable(host);DisplayNamesfor the whole context andContextHistory.lineOf. Values written alike becomehost@23, as in error messages, instead ofhost#1. The declared variable keeps the plain name;##switch_selector_N,##if_condition_N, ...) as variables. If one is always equal to a single expression, that expression replaces it in other rows, solength(data) == #array_lengthbecomeslength(data@143) == 1024. If a value has no constraint at all, the facts that mention it are dropped, socff == #getFileFilter_resultdisappears.VariableDTOgets adisplayName.namestays the plain name because hover, autocomplete and the relevant-row marking match it against code identifiers and translation-table keys. Method parameters (MethodDTO) are formatted the same way as before.GhostDTO(States of a named @StateSet are shown as plain ghosts (GhostDTO matches stateN by regex) #177):isStateis nowgetParent() != nullinstead of thestate\d+(_) == \d+regex. A newstateSetholds the set's name, or null when the name is generated (state1), matching whentoSetFormkeeps the shorthand. Ghosts are sorted so that the states of a set sit together, in the order they are declared.Client
displayName.compression(ImageWriteParam) == compressionExplicit. Other ghosts and the states of unnamed sets look the same as before.Screenshots (proposal D, headless VS Code, verifier 0.0.37)
Notes
DisplayNames/VariableFormatter). If that work renames#case_conditionand similar values in the verifier, the Context tab picks up the new names automatically.@RefinementPredicateghost functions. SotoSetFormreceives only the state sets as "ghosts". The one case this misses is a state with the same name as a@RefinementPredicatefunction. That state would be shown in value form, where the verifier keeps the shorthand.#if_condition,#case_condition) are no longer rows. Before, they were shown as#case_condition | #switch_selector == BORDERLESS.iforswitch, or in a loop) take the line where their variable is declared, which comes from the verifier's placement. That giveshost@22#1..#3in A1_09 andkb@145#2in A1_38. Error messages name these values the same way.Checks
npm run test:unit(124 passed),npm run test:typecheck,npm run lint, servermvn -B test(41 passed). Two new server tests and an updated webview spec. Each one fails without this change.🤖 Generated with Claude Code