Skip to content

Commit a6baaf3

Browse files
committed
Major actions refactor
1 parent 58b40a0 commit a6baaf3

20 files changed

+690
-352
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ This extension contributes the following settings:
2828

2929
## Release Notes
3030

31+
### 0.8.0
32+
- Support "fold" and "unfold" actions
33+
3134
### 0.7.0
3235
- Support "cut" action (default term in vscode-talon is "carve")
3336

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cursorless",
33
"displayName": "Cursorless",
44
"description": "Don't let the cursor slow you down",
5-
"version": "0.7.0",
5+
"version": "0.8.0",
66
"publisher": "pokey",
77
"license": "MIT",
88
"repository": {

src/Types.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SyntaxNode } from "tree-sitter";
22
import * as vscode from "vscode";
33
import { Location } from "vscode";
44
import { SymbolColor } from "./constants";
5+
import EditStyles from "./editStyles";
56
import NavigationMap from "./NavigationMap";
67

78
/**
@@ -199,3 +200,35 @@ export interface SelectionWithContext {
199200
selection: vscode.Selection;
200201
context: SelectionContext;
201202
}
203+
204+
export interface ActionReturnValue {
205+
returnValue: any;
206+
thatMark: SelectionWithEditor[];
207+
}
208+
209+
export interface Action {
210+
run(targets: TypedSelection[][], ...args: any[]): Promise<ActionReturnValue>;
211+
targetPreferences: ActionPreferences[];
212+
}
213+
214+
export type ActionType =
215+
| "clear"
216+
| "copy"
217+
| "cut"
218+
| "delete"
219+
| "extractVariable"
220+
| "fold"
221+
| "paste"
222+
| "setSelection"
223+
| "setSelectionAfter"
224+
| "setSelectionBefore"
225+
| "swap"
226+
| "unfold"
227+
| "wrap";
228+
229+
export type ActionRecord = Record<ActionType, Action>;
230+
231+
export interface Graph {
232+
readonly actions: ActionRecord;
233+
readonly editStyles: EditStyles;
234+
}

src/actions.ts

Lines changed: 0 additions & 328 deletions
This file was deleted.

0 commit comments

Comments
 (0)