Infer DS labels from code + argument display names (arg-N)#128
Open
mkayander wants to merge 9 commits into
Open
Infer DS labels from code + argument display names (arg-N)#128mkayander wants to merge 9 commits into
mkayander wants to merge 9 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
54babea to
7956594
Compare
7956594 to
55d0d43
Compare
55d0d43 to
5bcccdd
Compare
5bcccdd to
cf6dc58
Compare
- JS: extend array literal transform to call __dstructArrayLiteralWithName for const/assign/assignment-pattern RHS; keep unnamed helper for single-string literals and return-position literals - Runtime: build labeled literals via ControlledArray with displayLabel in addArray options - Redux: store displayLabel on ArrayData; show caption in array/map/matrix views - Python: attach AST parents and infer list names from assign/ann/aug assign; pass displayLabel in TrackedList addArray options; seed case arg labels from arg name Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Add optional ArgumentObject.label (non-unique); getArgumentDisplayLabel falls back to arg-{order+1}
- caseSlice.updateArgumentLabel + include label in args content signature
- ArgInput: composite field labels; suffix rename opens Popover with debounced 300ms save + flush on close
- JsonInput: suffixSlot + timeout passthrough; string/json inputs use 300ms debounce
- New projects/cases: short-uuid argument ids instead of head/array keys; addCase binary tree uses uuid
- useArgumentsParsing: structure displayLabel uses display name, not store id
- i18n: rename tooltip strings (en + generated types)
Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Extend array literal transform: append { displayLabel } to new Array/ArrayProxy
when RHS is inferable; skip ambiguous new Array(singleNumber) length form
- Require array literal parent to be actual RHS (init/right) for named literals
- ArrayProxy constructor accepts optional trailing options object for displayLabel
Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Plain array literals do not use ArrayProxy, so DS labels and addArray frames only appear after the AST transform. Apply array literal rewriting whenever parse succeeds, not only when line probes are injected; fall back to transforming all functions if the return-function template is missing. Also recognize ??=/||=/&&= bindings for named literals, inherit displayLabel through Array.map, and always run transformed code in the worker.
- Share buildTrackedArrayFromLiteralElements for named/unnamed literals - Collapse program-wide function traversal into one Babel visitor - Keep runtime display label helper module-private - Align Python ListOptions TypedDict with displayLabel field Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
7f11e9f to
b9e3d56
Compare
- Runtime tests: literal helper, map inheritance, plain [] gap, getLevels path - Redux: arraySlice.create and caseSlice.updateArgumentLabel - Args: getArgumentDisplayLabel fallbacks and duplicate labels - AST: transformArrayLiteralsInProgram fallback - Python: inline list literal emits displayLabel in addArray frame - Remove duplicate getLevels file and instrument tests that only checked ok:true Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
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.
Summary
Infers display labels for runtime-built arrays/maps (from variable names in user code) and for test-case arguments (optional rename +
arg-Ndefaults). Fixes thegetLevels/const array = []case where plain literals were invisible to the visualizer.Problem
[]creates a plain JS array even whenArrayis aliased toArrayProxy. Without the AST transform there are noaddArrayframes and no captions.Solution
[]→__dstructArrayLiteralWithName("array")when bound; unnamed otherwise.new Array(1,2,3)gets trailing{ displayLabel }.return function …template, still rewrite literals in all functions.displayLabelonaddArrayoptions → Redux →StructureDisplayLabelabove array/matrix/map views.labelon arguments; UI popover with debounced save; uuid store keys for new projects.attach_ast_parents+ inferred list literal names →displayLabelinaddArrayframes.Regression coverage
getLevelsArrayTracking.test.ts— instrumented binary-tree solution emitsaddArraywithdisplayLabel: "array".??=,new Array, fallback template.Review notes (post-rebase on
main)exec.pyimport conflict (collection tracker +attach_ast_parents).buildTrackedArrayFromLiteralElements, collapsed program traversal visitor, private runtime label helper.array[depth] ??= []rows stay unnamed;Array.from/ push-built arrays not instrumented; Python dict/set literals still use legacynameoption in collection tracker.