-
-
Notifications
You must be signed in to change notification settings - Fork 241
Fix grow selection for :let bindings loops #2989
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
Open
jramosg
wants to merge
5
commits into
BetterThanTomorrow:dev
Choose a base branch
from
jramosg:fix-let-selection
base: dev
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.
Open
+101
−9
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
✅ Deploy Preview for calva-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
|
Looks great so far! Thanks for doing this! 🙏 ❤️ |
- Fixed isInPairsList to properly detect :let vectors by calling isPrecededByLetVector helper - Improved growSelection to check binding pairs before expanding to whole list - Added length comparison to only expand to pair when current selection is smaller - Updated currentSexpsRange to use fresh cursor for correct list context - Added comprehensive tests for :let binding pair selection Fixes BetterThanTomorrow#2988
b5d6ce4 to
8a7a09e
Compare
Updated the function name from isPrecededByLetVector to isPrecededByLetKeyword for clarity. Enhanced the logic to skip comments while checking for the preceding :let keyword, ensuring more accurate detection in various contexts.
This commit introduces new test cases to verify the behavior of the growSelection function when dealing with :let binding pairs within doseq constructs. The tests ensure that the selection correctly expands to include the appropriate binding pairs and the entire binding box, enhancing the robustness of the selection handling.
Fix grow selection to consider "form pairs" in :let bindings, aligning behavior with standard let functionality. This change addresses issue BetterThanTomorrow#2988 and improves user experience when working with selections in Clojure code.
This test verifies that the growSelection function correctly handles binding pairs in :let expressions, including cases with comments interspersed. It ensures that the selection behavior is consistent and accurate for various scenarios involving comments.
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.
What has changed?
Fixes #2988
My Calva PR Checklist
I have:
devbranch. (Or have specific reasons to target some other branch.)published. (Sorry for the nagging.)[Unreleased]entry inCHANGELOG.md, linking the issue(s) that the PR is addressing.npm run prettier-format)npm run eslintbefore creating your PR, or runnpm run eslint-watchto eslint as you go).