Help beta test multi-cursor Calva Paredit, please 鉂わ笍 馃檹
#1,662 opened on Apr 3, 2022
Description
@riotrah is bringing something wonderful to Calva, multi cursor support to Paredit!
The way this beta test will work is that Calva Team members will maintain a checklist of known issues right here and all who participate in the testing can report findings in the comments. See How to test custom VSIX packaged on the Calva wiki if this is unfamiliar to you. (TL;DR: It is super easy.)
- Issue: #610
- PR: #1606
- Latest VSIX: calva-2.0.266-pull-1606-62a922f0.vsix
This is recorded April 3, 2022, with the build: calva-2.0.263-pull-1606-298af21c.vsix
https://user-images.githubusercontent.com/30010/161421143-7058384e-447d-4da9-b7f2-7dcb00f16e43.mp4
As you can see it is largely working! As you also can see, sometimes it doesn't do the right thing. So this is a call for help testing this to help us find bugs and to help us discover what is the right thing for certain cases.
See Paredit, a Visual Guide for how Calva Paredit works for a single cursor (and to appreciate what an effort this is for @riotrah to pull off, and why the rest of us should help with testing.
Test notation
In the Calva tests for structural navigation and editing we use a special document notation, which is easy to read for both the machine and for us humans:
/**
* Text Notation for expressing states of a document, including
* current text and selection.
* See this video for an intro: https://www.youtube.com/watch?v=Sy3arG-Degw
* * Since JavasScript makes it clumsy with multiline strings,
* newlines are denoted with the paragraph character: `搂`
* * Selections are denoted like so
* * Cursors, (which are actually selections with identical start and end) are denoted with a single `|`, with <= 10 multiple cursors defined by `|1`, `|2`, ... `|9`, etc, or in regex: /\|\d/. 0-indexed, so `|` is 0, `|1` is 1, etc.
* * This is however actually an alternative for the following `>\d?` notation, it has the same left->right semantics, but looks more like a cursor/caret lol, and more importantly, drops the 0 for the first cursor.
* * Selections with direction left->right are denoted with `>0`, `>1`, `>2`, ... `>9` etc at the range boundaries
* * Selections with direction right->left are denoted with `<0`, `<1`, `<2`, ... `<9` etc at the range boundaries
*/
See this CalvaTV video for tutorial: https://www.youtube.com/watch?v=Sy3arG-Degw
A typical report has
- a description of a before-document
- a command
- a description of a an expected after-document
- a description of a the actual after-document
We try to keep the document descriptions as minimal as possible. See the first report in the comments for an example.
There's a command for it
The test VSIX has a command for printing the text notation from the state of the current document.
Which makes creating a report involve these steps:
- Create your minimal document (an Untitled doc in Clojure mode will do)
- Place your cursors/selections
- Issue the Print TextNotaion. command
- Issue the Paredit command
- Issue the Print TextNotaion. command again
Now you have the Before and Actual texts in the Output channel Calva says. You only need to add the Expected texts yoursefl.
Reported issues
- Delete Forward to End of List only deletes for the first cursor, and loses the other cursors
- Delete Backward to End of List only deletes for the first cursor, and loses the other cursors
- Raise sexp wrong placement of cursor after the edit
- Delete Sexp Forwards only deletes at primary cursor, loses the others
- Delete Sexp Backwards only deletes at primary cursor, loses the others
- Expand selection when all text in a list is selected, doesn't select the list. It selects the opening paren
- Paredit Delete Backward does not move cursor inside list when used from adjacent after the list
- Paredit Delete Forward does not move cursor inside list when used from adjacent before the list
- Forward Sexp moves cursor out of line comment instead of moving by word
- Multi-cursor Paredit Delete Backward destroys structure when a cursor is at the beginning of a list
- Multi-cursor Paredit Delete Forward destroys structure when a cursor is at the end of a list
- Multi-cursor edit commands loose all but the primary cursor (because formatting, which is not multi-cursor aware)
- Multi-cursor Splice sexp misplaces cursors
- Wrap around commands only wraps primary cursor and loses the other cursors
- Delete backward does not move into list from behind closing bracket