Repository navigation
Show variables by their name, with a line only to tell instances apart - #493
Conversation
|
Codex review, round 1
Not relevant, so no change:
Nothing else relevant, so the loop ends here. |
c732fd3 to
275ca17
Compare
|
Codex review, round 2 (diff rebased on main after #489, with alias expansions named by the error's
Not relevant, so no change. This is round 1's finding again, and the premise does not hold: Nothing else relevant, so the loop ends here. |
Errors and context refinements wrote every variable instance with its verifier-wide counter in superscript digits (box¹⁵), which matched nothing in the code and mixed two Unicode blocks that many fonts draw unevenly. Each error, and each context refinement, now names its variables in one scope: a variable written alike to no other keeps its plain name; when several are, the declared variable or the latest instance shown keeps it and each other one gets the line its value comes from (x@12), numbered only when they share a line or have none (x@12#1). The message, counterexample and Found steps share the error's names, exposed with getDisplayNames(); ContextHistory.format(refinement) does the same for the context view. Verification, internal names and the translation table are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
275ca17 to
6a3baee
Compare
|
Codex review, round 3 (after the clean-code pass: shared
Fixed. Nothing else relevant, so the loop ends here. |
Closes #492
Variables in errors no longer carry a superscript counter (
box¹⁵). That counter matched nothing in the code, and it mixed Latin-1¹²³with the Superscripts block, which many fonts draw unevenly. Each error now names its variables within one scope:x@12.x@12#1,x@12#2. Two different instances never print the same.The message, counterexample and Found steps of an error share the same names. The context view follows the same rule within each refinement. Verification, internal names, counters and the translation table are unchanged; this is presentation only.
toSuperscriptis removed.Before / after
Plain names (A2_10 RandomFailureSupplier, the case reported in the issue):
A3_07 ScannerOutputStage (the only study error with two instances of a name in the message):
A1_56 EditCommand: the message, and the original Found the panel steps back to:
Across the test suite, 11 of 437 errors still show a tag in the message. All of them are before-and-after values (
s--,b = -b, a typestate object across calls). Counters remain only where values on one line must be told apart, e.g.n@11#1infor (; n > 0; n -= 2);.API for the extension (liquid-java/vscode-liquidjava#175)
LJError.getDisplayNames()returns the error'sDisplayNamesfor aRefinementErrororStateRefinementError(null for other errors).names.get(internalName).ExpressionFormatter.format(expression, names).ExpressionFormatter.format(refinement.getExpression(), ContextHistory.getInstance()::lineOf)forVariableDTO.refinement/mainRefinement.RefinementError.getFoundAliases()/getExpectedAliases()(Show the definitions of the aliases a refinement error uses #489) use the same names:invocationandexpansionare formatted with the error'sDisplayNames, so an invocation reads as in Found/Expected, e.g.Below(b@9, 10)with expansionb@9 < 10.VariableFormatter.formatandExpressionFormatter.format(expression)keep working without a scope. They write plain names and number clashes within the expression.name@12#2as one identifier and can render the tag as<sub>.Tests
DisplayNamesTest: line tags with the latest shown value plain; numbering for a shared line or no line, and the declared variable kept plain.TestFoundBinders(newBasket.negatefixture): message, counterexample and original Found rows nameb@85,b@86andbalike.ContextHistoryTest: the refinement ofbafterb = -breadsb == b@19 && b > 0.mvn test(rebased on main after #489): 712 tests, 0 failures. Diff vs main: +353/−113 in 23 files.🤖 Generated with Claude Code