Repository navigation
Explain the verifier's generated names on hover and link them to their lines - #199
Merged
Merged
Conversation
…r lines Names the verifier gives values of the code, such as #if_condition, #getUndoManager_result or #case_condition@74, now say on hover what they stand for in plain words, with the line when it is known, and go to that line on click. This applies in Expected, the Found steps and their diff, the counterexample and the Context tab's refinements. The error's translation table already has a position for each of these names, keyed by the name as shown. For the Context tab, the server now sends where each generated value comes from (generatedPlaces). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Codex review, round 1 (
Fixed in 1e96c37: Codex review, round 2 (on 1e96c37): No findings. |
Collaborator
Author
|
Clean-code review (clean-code-principles skill, on this PR's own code)
|
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.
Closes #195
Names the verifier gives values of the code, such as
#if_condition,#getUndoManager_resultor#case_condition@74, now explain themselves on hover in plain words. When their source line is known, the hover gives it and a click goes there.What the verifier already sends
No verifier change is needed. Since 0.0.38 (#196), the error's translation table is keyed by the name as shown, and it holds a position for every generated name in the error:
#if_condition→ the condition,#getUndoManager_result→ the call,#case_condition@74→ itscase, and so on.#case_condition@71…@74), so they no longer share one entry. The issue's note about this is out of date.The Context tab has no translation table. There, the server leaves out generated variables. This PR adds one field,
generatedPlaces(name as shown → place). The server code is in this repo, so this is still a vscode-only change.What the hover says
The text is the title of the name, with "at line N" when the line is known and "Click to go to it." when the name is a link. Every title ends with "LiquidJava gives it the name #…".
#if_condition#loop_condition#ternary_condition#switch_selector#case_condition#try_branch#catch_branch#array_length#new_File#size_result#count_value#operation_result#expression_valueWhere the line comes from:
generatedPlaces). The name is then a link.@74). The line is shown, but the name is not a link.extended#1is not a generated name. It is a line tag with no line, on a program variable, and #196 already explains it ("the 1st value of extended (line unknown)").Where
∀#if_conditionwas "Go to source (boolean)"; it is now the explanation, and the click still highlights the source;The names have a dotted underline, like the binders, and a pointer cursor when they are links. A link uses the same
location-linkclick as the message references from #193.Screenshots
A1_56 EditCommand, Found at step 7/20, in headless VS Code (openvscode-server) with verifier 0.0.38.
Headless screenshots do not capture native tooltips. The box under the name is drawn by the screenshot script from the element's real
titleattribute. On main, the same box shows "(no tooltip)" for the predicate and "Go to source (boolean)" for the binder.#getUndoManager_resultin a predicate, dark∀#if_conditionbinder, dark#getUndoManager_result, light∀#if_conditionbinder, lightThere is no Context tab screenshot. In A1_56, the Context tab replaces each generated value by its expression or drops it, so no generated name is left to show. The unit test covers the Context tab.
Changes
client/src/webview/generated-names.ts(new): the kinds and their wording, the hover text, and the rendered name.highlighting.ts: the highlighter takes an optionalplacestable (name → place). A generated name, together with its line tag, is rendered byrenderGeneratedName.vc-changes.ts,errors.ts,counterexample.ts,context/*.ts: pass the table through.renderBinderuses the explanation as its title.ContextHistoryDTO.generatedPlaces, filled byContextHistoryConverter.Tests
vc-changes.spec: one test, which fails on main. It checks:#ret, which is left alone;context.spec: one test, which fails on main: a refinement's name linked throughgeneratedPlaces.ContextHistoryConverterTest:#array_lengthof the Door fixture has its place.npm run test:unit(142),test:typecheck,lint;mvn -B package(45);VSCODE_TEST_VERSION=minimum xvfb-run -a npm test(9 + 1 passing).Not in this PR
found … #getUndoManager_result …) and the editor hover are markdown or plain text with no translation table, so their names are not explained.#ret(a method's return value) is not one of the verifier's generated kinds and is left as is.operationor a field namedexpressionwould be described as an operation result or expression value, because the verifier names them alike.🤖 Generated with Claude Code