-
Notifications
You must be signed in to change notification settings - Fork 61
Hazel CLI LSP #2056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
disconcision
wants to merge
35
commits into
probe-III
Choose a base branch
from
hazel-lsp-cli
base: probe-III
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Hazel CLI LSP #2056
Conversation
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
CLI implementation (src/CLI/): - Rust-style error formatting with source context, line numbers, carets - evaluate_with_probe_map for probe sample collection - All commands working: run, format, analyze, probe (with --many) Documentation (plans/hazel-lsp-cli/): - cli-api.md: Complete CLI reference with examples - hazel-primer.md: Comprehensive Hazel syntax guide - hazel-builtins.md: Full builtin list with OCaml/ReasonML differences - vision.md: Long-term direction (semantic views, structural queries) - experience-log.md: AI experience tracking workflow - README.md: Project plan with status tracking Sample programs (hazel-programs/): - 9 documentation programs extracted from ML slides - 39 B2T2 programs extracted from ML slides - Folder structure for study tasks and examples Utilities (scripts/): - extract-docs.py: Extract .hz programs from ML backup_text fields 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
CLI test command (src/CLI/): - ./hazel test runs tests and reports pass/fail with line numbers - Shows hint strings for named tests (hint "name" test ... end) - Supports --verbose flag to show all tests - Exit code 0 = pass, 124 = failures Study program infrastructure (plans/study-programs.md): - Requirements for probe debugging user study programs - Development process and bug design guidelines - Tiered list of program concepts ready for parallel implementation - Probe mechanism overview from codebase research Example programs: - emojipaint.hz: Working version with comprehensive tests - emojipaint-bug.hz: Buggy version with single failing test - Proper indentation applied to both Documentation updates: - cli-api.md: Full test command documentation - hazel-primer.md: Named tests, debugging workflow with probes - README.md: Updated status and TODOs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Three new programs for probe debugging user studies: Tic-Tac-Toe (~265 lines, 18 tests): - 3x3 board with win/draw detection - Bug variants: wrong diagonal indices, turn not alternating Game of Life (~230 lines, 20 tests): - Cellular automaton with birth/death rules - Bug variants: missing diagonal neighbors (easy), wrong survival threshold (medium), sequential instead of simultaneous update (hard) Calculator (~270 lines, 28 tests): - Expression parser with operator precedence - Tokenizer, recursive descent parser, evaluator - Bug variants: flat precedence, right-associativity Documentation updates: - hazel-primer.md: Added note about comment syntax - experience-log.md: Documented eval reserved name and comment gotchas - Each program folder has detailed README with bug descriptions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## probe-III #2056 +/- ##
============================================
Coverage ? 50.38%
============================================
Files ? 219
Lines ? 25075
Branches ? 0
============================================
Hits ? 12635
Misses ? 12440
Partials ? 0
🚀 New features to boost your workflow:
|
CLI changes: - Add --auto/-a flag to ./hazel probe command - When enabled, uses AutoProbe.ids_to_autoprobe to automatically place probes on expressions (one per line heuristic) - Works with existing --many flag for multiple samples Study-write tasks for probes user study: - basepoint: tiny task, parameter order ambiguity - clamp: tiny task, condition boundary errors - running-sum: small task, fold accumulator errors - Each has sketch, solution, and storyboard files - Tests formatted with line breaks for auto-probe visibility Also includes: - study-write-plan.md: research questions, task categories, design notes - cli-autoprobe-proposal.md: implementation design document - session-log.md: example incremental CLI session Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Replace verbose ^^probe(...) with cleaner ⟦...⟧ brackets in CLI output - Fix probe values appearing on first line of multi-line expressions (now correctly placed at end of expression using m.last.row) - Add Token.probe_start/probe_end constants for Unicode brackets - Add refractor_seg_to_seg_text for customizable probe rendering Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changed ~indent="" to skip Printer's computed indentation, which was causing output to have different (usually more) indentation than the source file. The computed indentation is designed for Hazel's structural editor, but CLI output should preserve the original whitespace from the parsed segment. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Botanical/celestial themed tutorial introducing probes: - Seeing values with basic probes - Environment hover for variable values - Branches and the ∅ (not evaluated) icon - Functions and multiple samples - Closure cursor and sample alignment - Single/many mode, arrow key navigation Uses ⟦⟧ bracket notation to represent probed expressions in text. Sets up for Part 2: larger Greenhouse Planner program with debugging. Co-Authored-By: Claude Opus 4.5 <[email protected]>
New study-write tasks with sketch/solution pairs: - emojipaint-extend: Extend emoji paint with new brush feature - last-element: Find the last element of a list - mentions: Extract @mentions from text - safe-head: Safe version of list head with Option type Each task includes storyboard documentation for guided exploration. Also adds task-ideas.md and CLI syntax exploration notes. Co-Authored-By: Claude Opus 4.5 <[email protected]>
New commands: - ./hazel gen-slides: Generate ML slide files from hazel-programs/examples/ - ./hazel gen-slides-clean: Remove generated files and restore empty stub Features: - Recursively finds all .hz files in the examples directory - Parses each file and serializes to PersistentSegment format - Generates individual ML files for each program - Creates AllExamples.re aggregation module - Strips leading indentation before parsing (configurable) - Hierarchical slide titles based on directory structure Configuration in src/CLI/GenSlides.re (input_dir, output_dir, root_title, etc.) Integration: - Added examples library to web dependencies - Added Examples.AllExamples.all to Init.re documentation list - Stub AllExamples.re allows build to succeed when slides not generated Co-Authored-By: Claude Opus 4.5 <[email protected]>
Resolve merge conflicts from refactors.manuals changing from Id.Map.t to RefractorList.t (association list). Updated call sites to use list operations instead of Id.Map operations: - Printer.re: Use [] instead of Id.Map.empty for default refractors - Triggers.re: Update type annotations and use List.assoc_opt, ListUtil.remove_assoc, List.is_empty - Cli.re: Build refractor list instead of Map, fold into list - ProbeSidebar.re: Add missing projector_list arg to mk_view, convert manuals to Map for RefractorView.mk_data - Test_ExpToSegment.re: Use [] for empty refractors Co-Authored-By: Claude Opus 4.5 <[email protected]>
Convert recursive do_until and do_until_piece functions in Zipper.re to iterative implementations using while loops. The previous recursive versions would overflow the JavaScript call stack when traversing documents with thousands of tokens. Also includes related refactoring: - Move Sample.Capture type to its own submodule in Sample.re to avoid type inference issues with overlapping field names - Add clear_transient() to EvaluatorState to prevent serializing large app_args data (~100MB+) over postMessage - Only store app_args for probe target IDs to reduce memory usage Co-Authored-By: Claude Opus 4.5 <[email protected]>
When a function argument is syntactically just a variable (e.g., g(x)), filter that variable from the environment display since its value is already visible in the call display (e.g., g(5)). - Add get_arg_var_names to extract variable names from direct Var args - Handles tuples: f(x, y+1) filters x but keeps y - Handles parenthesized expressions - Update sample_environment to accept filter_vars parameter Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.
No description provided.