Skip to content

Commit 9b6324e

Browse files
Use scope instead of modifier
1 parent 415ecb4 commit 9b6324e

File tree

16 files changed

+151
-62
lines changed

16 files changed

+151
-62
lines changed

cursorless-talon/src/spoken_forms.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
"trailing": "trailing",
9090
"content": "keepContentFilter",
9191
"empty": "keepEmptyFilter",
92-
"expand": "expandToFullLine",
9392
"its": "inferPreviousMark",
9493
"visible": "visible"
9594
},
@@ -175,6 +174,7 @@
175174
"token": "token",
176175
"identifier": "identifier",
177176
"line": "line",
177+
"full line": "fullLine",
178178
"sentence": "sentence",
179179
"block": "paragraph",
180180
"file": "document",

data/fixtures/recorded/modifiers/changeExpand.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Hello world
2+
---
3+
4+
[Content] =
5+
[Removal] =
6+
[Domain] = 0:0-0:17
7+
>-----------------<
8+
0| Hello world
9+
10+
[Insertion delimiter] = "\n"
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
Hello
3+
world
4+
5+
---
6+
7+
[#1 Content] =
8+
[#1 Domain] = 0:0-0:0
9+
><
10+
0|
11+
12+
[#1 Removal] = 0:0-1:0
13+
>
14+
0|
15+
1| Hello
16+
<
17+
18+
[#1 Trailing delimiter] = 0:0-1:0
19+
>
20+
0|
21+
1| Hello
22+
<
23+
24+
[#1 Insertion delimiter] = "\n"
25+
26+
27+
[#2 Content] =
28+
[#2 Domain] = 1:0-1:5
29+
>-----<
30+
1| Hello
31+
32+
[#2 Removal] = 1:0-2:0
33+
>-----
34+
1| Hello
35+
2| world
36+
<
37+
38+
[#2 Leading delimiter] = 0:0-1:0
39+
>
40+
0|
41+
1| Hello
42+
<
43+
44+
[#2 Trailing delimiter] = 1:5-2:0
45+
>
46+
1| Hello
47+
2| world
48+
<
49+
50+
[#2 Insertion delimiter] = "\n"
51+
52+
53+
[#3 Content] =
54+
[#3 Domain] = 2:0-2:7
55+
>-------<
56+
2| world
57+
58+
[#3 Removal] = 2:0-3:0
59+
>-------
60+
2| world
61+
3|
62+
<
63+
64+
[#3 Leading delimiter] = 1:5-2:0
65+
>
66+
1| Hello
67+
2| world
68+
<
69+
70+
[#3 Trailing delimiter] = 2:7-3:0
71+
>
72+
2| world
73+
3|
74+
<
75+
76+
[#3 Insertion delimiter] = "\n"
77+
78+
79+
[#4 Content] =
80+
[#4 Domain] = 3:0-3:2
81+
>--<
82+
3|
83+
84+
[#4 Removal] = 2:7-3:2
85+
>
86+
2| world
87+
3|
88+
--<
89+
90+
[#4 Leading delimiter] = 2:7-3:0
91+
>
92+
2| world
93+
3|
94+
<
95+
96+
[#4 Insertion delimiter] = "\n"

data/scopeSupportFacetInfos.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@
141141

142142
- `fieldAccess` A field access
143143

144+
### fullLine
145+
146+
- `fullLine` A single full line in the document. Includes leading and trailing whitespace.
147+
144148
### functionCall
145149

146150
- `functionCall` A function call
@@ -196,7 +200,7 @@
196200

197201
### line
198202

199-
- `line` A single line in the document
203+
- `line` A single line in the document. Excludes leading and trailing whitespace.
200204

201205
### list
202206

packages/common/src/scopeSupportFacets/PlaintextScopeSupportFacetInfos.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ export const plaintextScopeSupportFacetInfos: Record<
2424
scopeType: "identifier",
2525
},
2626
line: {
27-
description: "A single line in the document",
27+
description:
28+
"A single line in the document. Excludes leading and trailing whitespace.",
2829
scopeType: "line",
2930
},
31+
fullLine: {
32+
description:
33+
"A single full line in the document. Includes leading and trailing whitespace.",
34+
scopeType: "fullLine",
35+
},
3036
sentence: {
3137
description: "A single sentence in the document",
3238
scopeType: "sentence",

packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ export type PlaintextScopeSupportFacet =
303303
| "token"
304304
| "identifier"
305305
| "line"
306+
| "fullLine"
306307
| "sentence"
307308
| "paragraph"
308309
| "boundedParagraph"

packages/common/src/types/command/PartialTargetDescriptor.types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export const simpleScopeTypeTypes = [
193193
"token",
194194
"identifier",
195195
"line",
196+
"fullLine",
196197
"sentence",
197198
"paragraph",
198199
"boundedParagraph",
@@ -397,10 +398,6 @@ export interface TrailingModifier {
397398
type: "trailing";
398399
}
399400

400-
export interface ExpandToFullLineModifier {
401-
type: "expandToFullLine";
402-
}
403-
404401
export interface KeepContentFilterModifier {
405402
type: "keepContentFilter";
406403
}
@@ -486,7 +483,6 @@ export type Modifier =
486483
| LeadingModifier
487484
| TrailingModifier
488485
| RawSelectionModifier
489-
| ExpandToFullLineModifier
490486
| ModifyIfUntypedModifier
491487
| FallbackModifier
492488
| RangeModifier

packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ClassFunctionNameStage } from "./modifiers/ClassFunctionNameStage";
77
import { ModifyIfUntypedStage } from "./modifiers/ConditionalModifierStages";
88
import { ContainingScopeStage } from "./modifiers/ContainingScopeStage";
99
import { EveryScopeStage } from "./modifiers/EveryScopeStage";
10-
import { ExpandToFullLineStage } from "./modifiers/ExpandToFullLineStage";
1110
import { FallbackStage } from "./modifiers/FallbackStage";
1211
import {
1312
KeepContentFilterStage,
@@ -58,8 +57,6 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory {
5857
return new LeadingStage(this, modifier);
5958
case "trailing":
6059
return new TrailingStage(this, modifier);
61-
case "expandToFullLine":
62-
return new ExpandToFullLineStage(modifier);
6360
case "visible":
6461
return new VisibleStage(modifier);
6562

packages/cursorless-engine/src/processTargets/modifiers/ExpandToFullLineStage.ts

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

0 commit comments

Comments
 (0)