Skip to content

Conversation

@jramosg
Copy link

@jramosg jramosg commented Jan 21, 2026

What has changed?

This PR adds support for growing selection to consider value/result pairs in case forms, similar to how it works for cond and binding forms like let.

  • Updated src/cursor-doc/paredit.ts to include case in conditional forms with correct offset handling (pairs start after function name and initial form).
  • Added unit tests in src/extension-test/unit/cursor-doc/paredit-test.ts for pair selecting in case forms.
  • Updated CHANGELOG.md with an enhancement entry linking to issue Pair selecting in case #2993.
  • Added test data in test-data/test-files/paredit_sandbox.clj for the new forms.

Fixes #2993

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Made sure there is an issue registered with a clear problem statement that this PR addresses, (created the issue if it was not present).
    • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • Confirmed that there are no linter warnings or errors (use the eslint extension, run npm run eslint before creating your PR, or run npm run eslint-watch to eslint as you go).

Enhance the growSelection function to consider value/result pairs
in `case` forms. This allows users to expand selections correctly
when working with conditional expressions, improving the editing
experience in Calva.

Fixes BetterThanTomorrow#2993
@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for calva-docs ready!

Name Link
🔨 Latest commit 8f25eb2
🔍 Latest deploy log https://app.netlify.com/projects/calva-docs/deploys/6970b40e739a250009a6406b
😎 Deploy Preview https://deploy-preview-2997--calva-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jramosg jramosg marked this pull request as draft January 21, 2026 10:41
@jramosg jramosg marked this pull request as ready for review January 21, 2026 10:59
This change introduces a new test case to verify that the
selection grows correctly to value/result pairs in case
statements when the value is selected first. This ensures
the functionality works as intended for different selection
scenarios in case forms.
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.

1 participant