Skip to content
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

Support fully compositional modifiers #672

Merged
merged 334 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
40d469f
Fixed bug in removal range for range target
AndreasArvidsson May 16, 2022
661a790
A dead delimiter highlight to range target
AndreasArvidsson May 16, 2022
691bb15
Added token context to all marks
AndreasArvidsson May 16, 2022
045ff32
Added correct token context too regex
AndreasArvidsson May 16, 2022
c47e6b5
Don't unifi ranges on content only removal
AndreasArvidsson May 16, 2022
3c5fec4
Update the test
AndreasArvidsson May 16, 2022
16a3704
Added feature to run single recorded test
AndreasArvidsson May 16, 2022
91c4116
Updated tests
AndreasArvidsson May 16, 2022
880980d
Fallback on token context for containing scope
AndreasArvidsson May 16, 2022
d34e2c8
Updated target inference
AndreasArvidsson May 17, 2022
3d8fb74
general refactoring of removable ranges
AndreasArvidsson May 17, 2022
7ce940b
Updated unify removal targets
AndreasArvidsson May 17, 2022
fcec5b0
Fixed that mark bug on set selection
AndreasArvidsson May 17, 2022
2b489bb
Fixed is reverse bug on vertical range targets
AndreasArvidsson May 17, 2022
204dff1
Fixed is reverse bug on vertical range targets
AndreasArvidsson May 17, 2022
db64b72
Set empty delimiter on end of and start of positions
AndreasArvidsson May 17, 2022
a5f311f
Updated test
AndreasArvidsson May 17, 2022
ca4e6a2
Fixed last tests
AndreasArvidsson May 17, 2022
e59fc47
Added description to run single recorded test
AndreasArvidsson May 17, 2022
cc9b9f8
At dead tests for bring before and after file
AndreasArvidsson May 17, 2022
1abbf8a
Update to removal ranges
AndreasArvidsson May 17, 2022
ffd79ea
Mark cleanup
AndreasArvidsson May 17, 2022
625baac
Added interior only and exclude interior as proper modifiers
AndreasArvidsson May 17, 2022
15b6d07
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 17, 2022
c1b4d63
Added support for every line
AndreasArvidsson May 17, 2022
3abd406
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' of…
AndreasArvidsson May 17, 2022
d1771a0
Only select lines with content
AndreasArvidsson May 17, 2022
d92c942
Added take every paragraph
AndreasArvidsson May 17, 2022
fcccf12
Added every file line and block tests
AndreasArvidsson May 17, 2022
01e77ea
Added take every token
AndreasArvidsson May 17, 2022
66a936c
Added every too regex stages
AndreasArvidsson May 17, 2022
9b7d94d
Cleanup
AndreasArvidsson May 17, 2022
e22b28f
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
AndreasArvidsson May 18, 2022
b700e45
Moved example of custom test transformation to docs
AndreasArvidsson May 18, 2022
e85e913
Update src/core/commandVersionUpgrades/upgradeV1ToV2/commandV1.types.ts
AndreasArvidsson May 18, 2022
ca1295f
Update src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts
AndreasArvidsson May 18, 2022
06adf4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 18, 2022
ab1071b
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
AndreasArvidsson May 19, 2022
c95e0dc
Added OO targets
AndreasArvidsson May 19, 2022
815f0c2
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' of…
AndreasArvidsson May 19, 2022
470fb27
Fixed merge conflict
AndreasArvidsson May 19, 2022
824f37d
Reversed order of migration modifiers
AndreasArvidsson May 19, 2022
c9a761c
Default to array
AndreasArvidsson May 19, 2022
fe06227
Cleaned up inference code
AndreasArvidsson May 19, 2022
4e9dd6f
Added paragraph target
AndreasArvidsson May 19, 2022
c5348c2
Better updates of new range
AndreasArvidsson May 19, 2022
affcac1
oo targets past all test
AndreasArvidsson May 19, 2022
11b624b
Added line and paragraph tests
AndreasArvidsson May 19, 2022
a8b633d
Highlight update
AndreasArvidsson May 19, 2022
6616f62
Added script to show unused exports
AndreasArvidsson May 19, 2022
af09763
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 19, 2022
ab2a684
Added line 2 unused export
AndreasArvidsson May 19, 2022
326adff
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' of…
AndreasArvidsson May 19, 2022
494e090
Default modifiers to empty array
AndreasArvidsson May 19, 2022
cfef36f
Don't use hat map
AndreasArvidsson May 19, 2022
c42cd8e
Modifiers default to undefined
AndreasArvidsson May 19, 2022
8fa7add
Fixed is implicit inference
AndreasArvidsson May 19, 2022
66c09ed
Removed get tokens function
AndreasArvidsson May 19, 2022
62491b6
Update src/core/commandVersionUpgrades/upgradeV1ToV2/commandV1.types.ts
AndreasArvidsson May 19, 2022
5ce6b18
Update src/core/inferFullTargets.ts
AndreasArvidsson May 19, 2022
76b2b1a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 19, 2022
c052580
General cleanup
AndreasArvidsson May 19, 2022
31148f0
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' of…
AndreasArvidsson May 19, 2022
b68c16e
Added notebook cell target
AndreasArvidsson May 19, 2022
8d9a8e8
Support delimiter based edit newline (#684)
AndreasArvidsson May 20, 2022
a48f9ac
Run yarn
pokey May 21, 2022
fad62d0
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
pokey May 21, 2022
0de0798
Attempt to fix raw delimiter
pokey May 21, 2022
a035390
Fixed delimiter
pokey May 21, 2022
84f4f4b
Revert "Attempt to fix raw delimiter"
pokey May 21, 2022
c8aee08
Revert "Fixed delimiter"
pokey May 21, 2022
77126f1
Use low dash unique with
AndreasArvidsson May 22, 2022
b1044ff
Made base target abstract
AndreasArvidsson May 22, 2022
83bed37
Updated tests
AndreasArvidsson May 22, 2022
652ef14
Added return type
AndreasArvidsson May 22, 2022
44cdd6a
Fixed compilation errors
AndreasArvidsson May 22, 2022
682a930
Updated position
AndreasArvidsson May 22, 2022
9a35cea
Add empty string as default delimiter for sub tokens
AndreasArvidsson May 22, 2022
fb89dfc
Updated bugs
AndreasArvidsson May 22, 2022
567999a
Cleanup
AndreasArvidsson May 22, 2022
cdc2384
Added tests
AndreasArvidsson May 22, 2022
cfe87bc
Updated inference of implicit target
AndreasArvidsson May 23, 2022
a5c5752
Updated spoken forms in test
AndreasArvidsson May 23, 2022
e050a2a
Utilize getters
AndreasArvidsson May 23, 2022
f645dcd
Refactored getters and setters for targets
AndreasArvidsson May 23, 2022
848364f
Implemented get final stages
AndreasArvidsson May 23, 2022
f68edd8
Added final stages to process targets
AndreasArvidsson May 23, 2022
f73e669
Cleanup
AndreasArvidsson May 23, 2022
b46392f
Converted command action into object with associated arguments
AndreasArvidsson May 23, 2022
2c125e6
Switch to complex scope types
pokey May 23, 2022
6a758da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2022
713ac87
Remove scope type type from base target
pokey May 23, 2022
9642209
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2022
b805fa8
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
pokey May 23, 2022
0aa8149
Updated to edit new context
AndreasArvidsson May 24, 2022
0239d07
Added bring statement test
AndreasArvidsson May 24, 2022
05d3f46
Change behavior of pour line
AndreasArvidsson May 24, 2022
55f761f
Use weak containing line stage for edit new
AndreasArvidsson May 24, 2022
8dc708e
Updated edit new
AndreasArvidsson May 24, 2022
ab45cc6
Get targets in correct order
AndreasArvidsson May 24, 2022
fa73fa5
Updated selection for editor
AndreasArvidsson May 24, 2022
74370d7
Cleanup
AndreasArvidsson May 24, 2022
5f82b78
New attempt at EditNew
pokey May 24, 2022
83b2741
Added rich targets
AndreasArvidsson May 25, 2022
b50c7d5
Updated edit new with proper line handling
AndreasArvidsson May 25, 2022
2a07980
Only used single edit
AndreasArvidsson May 25, 2022
d5e2651
Added comment
AndreasArvidsson May 25, 2022
c52571d
Added comment
AndreasArvidsson May 25, 2022
abfd398
Cleanup
AndreasArvidsson May 25, 2022
40a9bd2
Added derived target
AndreasArvidsson May 25, 2022
25535ed
Moved weak target into base target class
AndreasArvidsson May 25, 2022
27b2edd
Cleanup
AndreasArvidsson May 25, 2022
f566dd1
Updated action form
AndreasArvidsson May 25, 2022
ca80d97
Updated scope type for tests
AndreasArvidsson May 25, 2022
bc6ccc1
Fix upgrade path with ordinal range
AndreasArvidsson May 25, 2022
608ea3d
Pass leading and trailing delimiters to super constructor
AndreasArvidsson May 25, 2022
cde81f5
Learn to spell
AndreasArvidsson May 25, 2022
aeeb3ab
Updated more tests
AndreasArvidsson May 25, 2022
04b1fdd
Cleanup
AndreasArvidsson May 25, 2022
0125212
Fixed bug taking matching pair in error code
AndreasArvidsson May 25, 2022
eec2f65
Added block tests
AndreasArvidsson May 25, 2022
d92f07a
Fixed test
AndreasArvidsson May 25, 2022
7fbb155
Added support for custom delimiters in copy lines
AndreasArvidsson May 25, 2022
cfeed47
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
pokey May 25, 2022
390a541
Fix package json
pokey May 25, 2022
d32c5da
Fix one test
pokey May 25, 2022
e877922
Updated tests
AndreasArvidsson May 26, 2022
1793c27
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 26, 2022
2cbaaf5
Disabled phrase snapshot on recorded test runner
AndreasArvidsson May 26, 2022
77e053b
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' of…
AndreasArvidsson May 26, 2022
6432c47
Updated test and upgrade path
AndreasArvidsson May 26, 2022
5a09ee2
Fixed failing hat map tests
pokey May 26, 2022
3af398b
Added sleep option to recorded tests
AndreasArvidsson May 26, 2022
af9407f
Verbosity for the win
pokey May 26, 2022
db462c9
Tweak modify of week stage
pokey May 26, 2022
0f307fc
Minor python cleanup
pokey May 26, 2022
d3216a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 26, 2022
1fd4be3
Don't de duplicate that mark
pokey May 26, 2022
0bce727
Use utility function to set selection that deduplicates
AndreasArvidsson May 26, 2022
419922d
Make document content range the entire file including white lines
AndreasArvidsson May 26, 2022
81af818
Added source mark to wrap action
AndreasArvidsson May 26, 2022
1f96954
Added source mark to actions wrap and rewrap
AndreasArvidsson May 26, 2022
8bb43b1
Updated error messages
AndreasArvidsson May 26, 2022
8168472
Updated tests
AndreasArvidsson May 26, 2022
bce013e
Don't focus editor on notebook cell insertion
AndreasArvidsson May 26, 2022
f484db4
Cleanup
AndreasArvidsson May 26, 2022
25dafe4
Don't update selection on notebook cell insertion
AndreasArvidsson May 26, 2022
d7dac9b
Add comment
pokey May 26, 2022
4cca7c7
Various fixes
pokey May 26, 2022
bb23701
More renames and stuff
pokey May 26, 2022
6282e91
Fix bug with missing delimiters in weak targets
AndreasArvidsson May 26, 2022
5514215
Update src/processTargets/processTargets.ts
AndreasArvidsson May 26, 2022
41997d9
Unify implementation of copy lines and edit new actions
AndreasArvidsson May 26, 2022
13451ae
Rename
AndreasArvidsson May 26, 2022
6c4f8c8
Started working on lazy removal
AndreasArvidsson May 27, 2022
7bf31e9
Clarify processPrimitiveTarget
pokey May 27, 2022
c4a59e3
Tweak
pokey May 27, 2022
6bac958
Tweak again
pokey May 27, 2022
7bf79eb
Imports fix
pokey May 27, 2022
d6928f7
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
pokey May 27, 2022
5b242d0
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' in…
AndreasArvidsson May 27, 2022
ecd4869
All tests pass
AndreasArvidsson May 27, 2022
956b159
Updated highlights
AndreasArvidsson May 27, 2022
50d2154
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
AndreasArvidsson May 27, 2022
637ec30
Highlight updates on continuous range target
AndreasArvidsson May 27, 2022
2031899
Moved edit decorations into graph
AndreasArvidsson May 27, 2022
49eb90b
Added decorations to test recorder and runner
AndreasArvidsson May 27, 2022
0b280bc
Updated to highlight recorder test
AndreasArvidsson May 28, 2022
f5d37fb
Added decorations test
AndreasArvidsson May 28, 2022
46390c0
Added decorations test
AndreasArvidsson May 28, 2022
fdbc9a5
Added leading and trailing delimiters as separate stage and target
AndreasArvidsson May 29, 2022
a815abf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 29, 2022
35f06f6
Create edits in actual targets
AndreasArvidsson May 29, 2022
20468e7
Merge branch 'pokey/issue69-Support-fully-compositional-modifiers' of…
AndreasArvidsson May 29, 2022
3fc9dec
Use object oriented targets to construct edits
AndreasArvidsson May 29, 2022
4e08c90
Enabled bring before and after without to
AndreasArvidsson May 29, 2022
65bf87f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 29, 2022
b689146
Fix
AndreasArvidsson May 29, 2022
cd651ec
Support fully compositional modifiers
pokey May 29, 2022
3bb0939
Getting started
pokey May 29, 2022
6a3b208
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 29, 2022
36c9f5f
Start using InsertionRemovalBehavior
pokey May 30, 2022
ccd03d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 30, 2022
a2cce40
Cleanup
pokey May 30, 2022
98ff662
Tweak
pokey May 30, 2022
3906456
More cleanup
pokey May 30, 2022
ee95e0f
More tweaks
pokey May 31, 2022
58a78dd
Tweaks
pokey May 31, 2022
da08ed2
More cleanup
pokey May 31, 2022
4301836
Cleanup
AndreasArvidsson Jun 1, 2022
7c1d122
Removed padding from float and drop
AndreasArvidsson Jun 1, 2022
1d3f0c9
Updated that mark on pour action
AndreasArvidsson Jun 1, 2022
b9749c1
Lots of stuff
pokey Jun 1, 2022
50031db
Fixed removal behavior on scope type target
AndreasArvidsson Jun 1, 2022
3686199
Hide panel on recorded test sweet startup
AndreasArvidsson Jun 1, 2022
567210a
More stuff
pokey Jun 1, 2022
ab699b2
More stuff
pokey Jun 1, 2022
8c35a53
Cleanup
AndreasArvidsson Jun 1, 2022
2d627a6
Some stuff clean up whatever don't care
AndreasArvidsson Jun 1, 2022
7e5278c
Committed some stuff
AndreasArvidsson Jun 1, 2022
dbe081e
Stuff
AndreasArvidsson Jun 1, 2022
e9403a2
Updated tests
AndreasArvidsson Jun 1, 2022
fa61373
Support chuck after and chuck before
pokey Jun 1, 2022
67bf607
Add hack for "paste to to"
pokey Jun 1, 2022
51abd44
Add run single test launch config
pokey Jun 1, 2022
e6a1f5f
Add comment about running a single test to contributing docs
pokey Jun 1, 2022
9f86eab
Update cursorless-talon/src/csv_overrides.py
pokey Jun 2, 2022
94fc0aa
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
AndreasArvidsson Jun 2, 2022
4568442
Update cursorless-talon/src/positional_target.py
AndreasArvidsson Jun 2, 2022
eba5a1c
Update cursorless-talon/src/positional_target.py
AndreasArvidsson Jun 2, 2022
4e78c28
Use plain target in clear action
AndreasArvidsson Jun 2, 2022
d4183a2
Initial modifier unification work
pokey Jun 2, 2022
3fd0c18
Unify simple modifiers
pokey Jun 2, 2022
9497e51
docstring
pokey Jun 2, 2022
47dbb58
Clean up position code
pokey Jun 2, 2022
4e084a8
At a couple comments
pokey Jun 2, 2022
ae1b1e2
Creates separate file for target descriptor types
pokey Jun 2, 2022
9eb2010
Separate notebook cell edit new from regular edit new
pokey Jun 2, 2022
e4ee36f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 2, 2022
02294fa
Fixed that mark on notebook cells
AndreasArvidsson Jun 2, 2022
24f71a1
Cleanup
AndreasArvidsson Jun 2, 2022
1c3b391
More positional tweaks on talon side
pokey Jun 3, 2022
6e308ce
Removes support for chuck after and chuck before
pokey Jun 3, 2022
1119fba
Clean up names
pokey Jun 3, 2022
518838e
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
pokey Jun 3, 2022
852345a
Use proper error for syntax scope not found
pokey Jun 3, 2022
61f2045
Record tests for leading trailing before and after
pokey Jun 3, 2022
223517b
Add chuck before after to upgrade
AndreasArvidsson Jun 3, 2022
52193ae
Failed attempt at trying to simplify edit new
pokey Jun 3, 2022
c92e6f8
Revert "Failed attempt at trying to simplify edit new"
pokey Jun 3, 2022
dce732d
Cleanup vscode ignore
pokey Jun 3, 2022
8639b56
Fixed regression in vertical range target (#735)
AndreasArvidsson Jun 5, 2022
2e88e20
Revert generic insert empty lines code
pokey Jun 6, 2022
3a70fce
Add broken float and puff tests
pokey Jun 6, 2022
7781afa
Add working puff float drop tests
pokey Jun 6, 2022
11054b1
Switch to mocha grep syntax for running subset of tests
pokey Jun 6, 2022
cb9f322
Make subdir for insert empty lines tests
pokey Jun 6, 2022
445cc6a
Support updating fixture decorations
pokey Jun 6, 2022
6665f7d
Add decorations to float drop puff tests
pokey Jun 6, 2022
a0bd2c5
Cleanup test case recorder docs
pokey Jun 6, 2022
6066ce0
Add bunch of clone tests
pokey Jun 6, 2022
d12fd41
Move files
pokey Jun 6, 2022
6ee45f5
More cleanup
pokey Jun 6, 2022
3ed14d7
`PartialTargetDesc` => `PartialTargetDescriptor`
pokey Jun 6, 2022
cc6e673
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 6, 2022
aed4480
Re-add provenance file
pokey Jun 6, 2022
de8f5a9
Comments
pokey Jun 6, 2022
0b774d3
Bump package version
pokey Jun 6, 2022
744c4d4
Attempt to fix docs link
pokey Jun 6, 2022
e890da3
Merge branch 'main' into pokey/issue69-Support-fully-compositional-mo…
pokey Jun 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 43 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@
"!**/node_modules/**"
]
},
{
"name": "Run Test Subset",
"type": "extensionHost",
"request": "launch",
"env": {
"CURSORLESS_TEST": "true",
"CURSORLESS_RUN_TEST_SUBSET": "true"
},
"args": [
"--extensions-dir=${workspaceFolder}/.vscode-sandbox/extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!${workspaceFolder}/.vscode-sandbox/**",
"!**/node_modules/**"
]
},
{
"name": "Update fixtures",
"type": "extensionHost",
Expand All @@ -62,6 +83,28 @@
"!**/node_modules/**"
]
},
{
"name": "Update fixtures subset",
"type": "extensionHost",
"request": "launch",
"env": {
"CURSORLESS_TEST": "true",
"CURSORLESS_TEST_UPDATE_FIXTURES": "true",
"CURSORLESS_RUN_TEST_SUBSET": "true"
},
"args": [
"--extensions-dir=${workspaceFolder}/.vscode-sandbox/extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!${workspaceFolder}/.vscode-sandbox/**",
"!**/node_modules/**"
]
},
{
"name": "Docusaurus Start (Debug)",
"type": "node",
Expand Down
27 changes: 12 additions & 15 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
node_modules/**
.vscode-sandbox/**
out/**
dist/**
**
!CHANGELOG.md
!cursorless-snippets/**
!dist/extension.js
website/**
!images/hats/**
!images/icon.png
!LICENSE
!NOTICE.md
!package.json
!README.md
!schemas/**
!third-party-licenses.csv
!build-info.json
3 changes: 2 additions & 1 deletion cursorless-talon/src/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .actions_callback import callback_action_defaults, callback_action_map
from .actions_custom import custom_action_defaults
from .actions_makeshift import makeshift_action_defaults, makeshift_action_map
from .actions_simple import simple_action_defaults
from .actions_simple import positional_action_defaults, simple_action_defaults

mod = Module()

Expand Down Expand Up @@ -79,6 +79,7 @@ def vscode_command_no_wait(command_id: str, target: dict, command_options: dict

default_values = {
"simple_action": simple_action_defaults,
"positional_action": positional_action_defaults,
"callback_action": callback_action_defaults,
"makeshift_action": makeshift_action_defaults,
"custom_action": custom_action_defaults,
Expand Down
2 changes: 1 addition & 1 deletion cursorless-talon/src/actions/actions_makeshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MakeshiftAction:
"editor.action.rename",
restore_selection=True,
await_command=False,
post_command_sleep_ms=150,
post_command_sleep_ms=200,
pokey marked this conversation as resolved.
Show resolved Hide resolved
),
]

Expand Down
11 changes: 10 additions & 1 deletion cursorless-talon/src/actions/actions_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"give": "deselect",
"highlight": "highlight",
"indent": "indentLine",
"paste to": "pasteFromClipboard",
"post": "setSelectionAfter",
"pour": "editNewLineAfter",
"pre": "setSelectionBefore",
Expand All @@ -37,8 +36,18 @@
"unfold": "unfoldRegion",
}

# NOTE: Please do not change these dicts. Use the CSVs for customization.
# See https://www.cursorless.org/docs/user/customization/
positional_action_defaults = {
"paste": "pasteFromClipboard",
}

mod = Module()
mod.list(
"cursorless_simple_action",
desc="Supported simple actions for cursorless navigation",
)
mod.list(
"cursorless_positional_action",
desc="Supported actions for cursorless that expect a positional target",
)
2 changes: 1 addition & 1 deletion cursorless-talon/src/actions/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@


def run_call_action(target: dict):
targets = [target, IMPLICIT_TARGET]
targets = [target, IMPLICIT_TARGET.copy()]
AndreasArvidsson marked this conversation as resolved.
Show resolved Hide resolved
actions.user.cursorless_multiple_target_command("callAsFunction", targets)
16 changes: 5 additions & 11 deletions cursorless-talon/src/actions/move_bring.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,18 @@
from ..primitive_target import IMPLICIT_TARGET

mod = Module()
mod.list(
"cursorless_source_destination_connective",
desc="The connective used to separate source and destination targets",
)


mod.list("cursorless_move_bring_action", desc="Cursorless move or bring actions")


@mod.capture(
rule=(
"<user.cursorless_target> [{user.cursorless_source_destination_connective} <user.cursorless_target>]"
)
)
@mod.capture(rule="<user.cursorless_target> [<user.cursorless_positional_target>]")
def cursorless_move_bring_targets(m) -> list[dict]:
target_list = m.cursorless_target_list

if len(target_list) == 1:
target_list = target_list + [IMPLICIT_TARGET]
try:
target_list += [m.cursorless_positional_target]
except AttributeError:
target_list += [IMPLICIT_TARGET.copy()]

return target_list
2 changes: 1 addition & 1 deletion cursorless-talon/src/cheatsheet/sections/scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def get_scopes():
return {
**get_lists(
["scope_type", "selection_type", "subtoken_scope_type"],
["scope_type", "subtoken_scope_type"],
{"argumentOrParameter": "Argument"},
),
"<P>": "Paired delimiter",
Expand Down
8 changes: 5 additions & 3 deletions cursorless-talon/src/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ def construct_cursorless_command_argument(
use_pre_phrase_snapshot = False

return {
"version": 1,
"version": 2,
"spokenForm": get_spoken_form(),
"action": action,
"action": {
"name": action,
"args": args,
},
"targets": targets,
"extraArgs": args,
"usePrePhraseSnapshot": use_pre_phrase_snapshot,
}

Expand Down
17 changes: 10 additions & 7 deletions cursorless-talon/src/compound_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ def cursorless_range(m) -> str:
return primitive_targets[0]

if len(primitive_targets) == 1:
start = BASE_TARGET.copy()
anchor = BASE_TARGET.copy()
AndreasArvidsson marked this conversation as resolved.
Show resolved Hide resolved
else:
start = primitive_targets[0]
anchor = primitive_targets[0]

range_connective = range_connective_with_type["connective"]
range_type = range_connective_with_type["type"]

range = {
"type": "range",
"start": start,
"end": primitive_targets[-1],
"excludeStart": not is_anchor_included(range_connective),
"excludeEnd": not is_active_included(range_connective),
"anchor": anchor,
"active": primitive_targets[-1],
"excludeAnchor": not is_anchor_included(range_connective),
"excludeActive": not is_active_included(range_connective),
}

if range_type:
Expand All @@ -79,4 +79,7 @@ def is_active_included(range_connective: str):
def cursorless_target(m) -> dict:
if len(m.cursorless_range_list) == 1:
return m.cursorless_range
return {"type": "list", "elements": m.cursorless_range_list}
return {
"type": "list",
"elements": m.cursorless_range_list,
}
11 changes: 10 additions & 1 deletion cursorless-talon/src/connective.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
from talon import app
from talon import Module, app

from .csv_overrides import init_csv_and_watch_changes

mod = Module()

mod.list(
"cursorless_source_destination_connective",
desc="The connective used to separate source and destination targets",
)


# NOTE: Please do not change these dicts. Use the CSVs for customization.
# See https://www.cursorless.org/docs/user/customization/
range_connectives = {
Expand All @@ -11,6 +19,7 @@
"until": "rangeExcludingEnd",
}


default_range_connective = "rangeInclusive"


Expand Down
8 changes: 8 additions & 0 deletions cursorless-talon/src/csv_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ def update_dicts(
key = obj["key"]
if not is_removed(key):
for k in key.split("|"):
if value == "pasteFromClipboard" and k.endswith(" to"):
# FIXME: This is a hack to work around the fact that the
# spoken form of the `pasteFromClipboard` action used to be
# "paste to", but now the spoken form is just "paste" and
# the "to" is part of the positional target. Users who had
# cursorless before this change would have "paste to" as
# their spoken form and so would need to say "paste to to".
k = k[:-3]
results[obj["list"]][k.strip()] = value

# Assign result to talon context list
Expand Down
3 changes: 3 additions & 0 deletions cursorless-talon/src/cursorless.talon
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ app: vscode
<user.cursorless_action_or_vscode_command> <user.cursorless_target>:
user.cursorless_action_or_vscode_command(cursorless_action_or_vscode_command, cursorless_target)

{user.cursorless_positional_action} <user.cursorless_positional_target>:
user.cursorless_single_target_command(cursorless_positional_action, cursorless_positional_target)

{user.cursorless_swap_action} <user.cursorless_swap_targets>:
user.cursorless_multiple_target_command(cursorless_swap_action, cursorless_swap_targets)

Expand Down
14 changes: 6 additions & 8 deletions cursorless-talon/src/marks/lines_number.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass
from typing import Any, Callable

from talon import Context, Module

Expand All @@ -13,7 +14,7 @@ class CustomizableTerm:
defaultSpokenForm: str
cursorlessIdentifier: str
type: str
formatter: callable
formatter: Callable


# NOTE: Please do not change these dicts. Use the CSVs for customization.
Expand All @@ -33,18 +34,15 @@ class CustomizableTerm:


@mod.capture(rule="{user.cursorless_line_direction} <number_small>")
def cursorless_line_number(m) -> str:
def cursorless_line_number(m) -> dict[str, Any]:
direction = directions_map[m.cursorless_line_direction]
line_number = m.number_small
line = {
"lineNumber": direction.formatter(line_number),
"type": direction.type,
}
return {
"selectionType": "line",
"mark": {
"type": "lineNumber",
"anchor": line,
"active": line,
},
"type": "lineNumber",
"anchor": line,
"active": line,
}
20 changes: 9 additions & 11 deletions cursorless-talon/src/marks/mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,17 @@
@mod.capture(
rule="[{user.cursorless_hat_color}] [{user.cursorless_hat_shape}] <user.any_alphanumeric_key>"
)
def cursorless_decorated_symbol(m) -> dict[str, dict[str, Any]]:
def cursorless_decorated_symbol(m) -> dict[str, Any]:
"""A decorated symbol"""
hat_color = getattr(m, "cursorless_hat_color", "default")
try:
hat_style_name = f"{hat_color}-{m.cursorless_hat_shape}"
except AttributeError:
hat_style_name = hat_color
return {
"mark": {
"type": "decoratedSymbol",
"symbolColor": hat_style_name,
"character": m.any_alphanumeric_key,
}
"type": "decoratedSymbol",
"symbolColor": hat_style_name,
"character": m.any_alphanumeric_key,
}


Expand All @@ -69,10 +67,10 @@ class CustomizableTerm:
# NOTE: Please do not change these dicts. Use the CSVs for customization.
# See https://www.cursorless.org/docs/user/customization/
special_marks = [
CustomizableTerm("this", "currentSelection", {"mark": {"type": "cursor"}}),
CustomizableTerm("that", "previousTarget", {"mark": {"type": "that"}}),
CustomizableTerm("source", "previousSource", {"mark": {"type": "source"}}),
CustomizableTerm("nothing", "nothing", {"mark": {"type": "nothing"}}),
CustomizableTerm("this", "currentSelection", {"type": "cursor"}),
CustomizableTerm("that", "previousTarget", {"type": "that"}),
CustomizableTerm("source", "previousSource", {"type": "source"}),
CustomizableTerm("nothing", "nothing", {"type": "nothing"}),
# "last cursor": {"mark": {"type": "lastCursorPosition"}} # Not implemented
]

Expand All @@ -93,7 +91,7 @@ class CustomizableTerm:
"<user.cursorless_line_number>" # row (ie absolute mod 100), up, down
)
)
def cursorless_mark(m) -> str:
def cursorless_mark(m) -> dict[str, Any]:
try:
return m.cursorless_decorated_symbol
except AttributeError:
Expand Down
Loading