Skip to content

Conversation

@nskh
Copy link
Collaborator

@nskh nskh commented Aug 21, 2025

Enable Hazel to snap to proper subterms of an expression (i.e. highlight all of 1 + 2 when user selects over just, say, + 2 or 1 +). Handle left-associative binary operators for arithmetic by traversing the AST (described in a comment).

Still needs some work. Action items here:

  • behavior is a little odd over let = in, likely due to how that form is represented in the zipper
  • parenthesize and then run statics in Stepper contexts (which add some parens that aren't findable when we look up from statics.info_map)
  • pull this logic out of Deco and place in StepperEditor only
  • extend or refactor to generic exp-based selection

Later:

  • take hidden steps to reparenthesize parts of the AST that are selected before taking Stepper actions, so we can act on proper sub-terms instead of gating that behind only the outer-most left-associative term

@nskh nskh requested a review from Negabinary August 21, 2025 15:00
@cyrus-
Copy link
Member

cyrus- commented Aug 27, 2025

@nskh we just merged a PR where @disconcision rewrote some of the selection code, feel free to ping him

@nskh
Copy link
Collaborator Author

nskh commented Aug 27, 2025

@cyrus- #1906? I'll take a look.

@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 0% with 89 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.95%. Comparing base (d601b04) to head (846e315).

Files with missing lines Patch % Lines
src/web/app/editors/decoration/Highlight.re 0.00% 59 Missing ⚠️
src/haz3lcore/zipper/Zipper.re 0.00% 19 Missing ⚠️
src/language/term/Operators.re 0.00% 10 Missing ⚠️
src/web/app/editors/code/CodeEditable.re 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1890      +/-   ##
==========================================
- Coverage   51.28%   50.95%   -0.34%     
==========================================
  Files         205      205              
  Lines       21754    21841      +87     
==========================================
- Hits        11157    11128      -29     
- Misses      10597    10713     +116     
Files with missing lines Coverage Δ
src/web/app/editors/code/CodeEditable.re 0.00% <0.00%> (ø)
src/language/term/Operators.re 77.46% <0.00%> (-1.89%) ⬇️
src/haz3lcore/zipper/Zipper.re 56.72% <0.00%> (-4.93%) ⬇️
src/web/app/editors/decoration/Highlight.re 0.00% <0.00%> (ø)

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants