Skip to content

Commit 5644d6e

Browse files
Make paragraph line iteration scope
1 parent 41cf78d commit 5644d6e

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

packages/common/src/ide/types/Configuration.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ export type CursorlessConfiguration = {
99
experimental: { snippetsDir: string | undefined; hatStability: HatStability };
1010
decorationDebounceDelayMs: number;
1111
debug: boolean;
12-
private: {
13-
lineParagraphIterationScope: boolean;
14-
};
1512
};
1613

1714
export type CursorlessConfigKey = keyof CursorlessConfiguration;
@@ -30,9 +27,6 @@ export const CONFIGURATION_DEFAULTS: CursorlessConfiguration = {
3027
hatStability: HatStability.balanced,
3128
},
3229
debug: false,
33-
private: {
34-
lineParagraphIterationScope: false,
35-
},
3630
};
3731

3832
export interface Configuration {

packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/LineScopeHandler.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@ import {
33
Position,
44
Range,
55
ScopeType,
6-
SimpleScopeTypeType,
76
TextEditor,
87
} from "@cursorless/common";
9-
import { ide } from "../../../singletons/ide.singleton";
108
import { LineTarget } from "../../targets";
119
import { BaseScopeHandler } from "./BaseScopeHandler";
1210
import type { TargetScope } from "./scope.types";
1311

1412
export class LineScopeHandler extends BaseScopeHandler {
1513
public readonly scopeType = { type: "line" } as const;
16-
public readonly iterationScopeType: ScopeType;
14+
public readonly iterationScopeType: ScopeType = {
15+
type: "paragraph",
16+
} as const;
1717
protected readonly isHierarchical = false;
1818
public readonly includeAdjacentInEvery: boolean = true;
1919

2020
constructor(_scopeType: ScopeType, _languageId: string) {
2121
super();
22-
this.iterationScopeType = { type: getIterationScopeTypeType() };
2322
}
2423

2524
*generateScopeCandidates(
@@ -75,10 +74,3 @@ export function fitRangeToLineContent(editor: TextEditor, range: Range) {
7574
endLine.lastNonWhitespaceCharacterIndex,
7675
);
7776
}
78-
79-
function getIterationScopeTypeType(): SimpleScopeTypeType {
80-
const useParagraph = ide().configuration.getOwnConfiguration(
81-
"private.lineParagraphIterationScope",
82-
);
83-
return useParagraph ? "paragraph" : "document";
84-
}

packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/modifiers/everyScope/clearEveryLine.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,3 @@ finalState:
2626
active: {line: 0, character: 0}
2727
- anchor: {line: 1, character: 0}
2828
active: {line: 1, character: 0}
29-
- anchor: {line: 2, character: 0}
30-
active: {line: 2, character: 0}

packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/selectionTypes/takeEveryLine.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ initialState:
1818
d e
1919
f g
2020
selections:
21-
- anchor: {line: 6, character: 0}
22-
active: {line: 6, character: 0}
21+
- anchor: {line: 5, character: 0}
22+
active: {line: 5, character: 0}
2323
marks: {}
2424
finalState:
2525
documentContents: |
@@ -30,17 +30,9 @@ finalState:
3030
d e
3131
f g
3232
selections:
33-
- anchor: {line: 0, character: 0}
34-
active: {line: 0, character: 0}
35-
- anchor: {line: 1, character: 0}
36-
active: {line: 1, character: 1}
37-
- anchor: {line: 2, character: 0}
38-
active: {line: 2, character: 0}
3933
- anchor: {line: 3, character: 0}
4034
active: {line: 3, character: 5}
4135
- anchor: {line: 4, character: 0}
4236
active: {line: 4, character: 5}
4337
- anchor: {line: 5, character: 0}
4438
active: {line: 5, character: 5}
45-
- anchor: {line: 6, character: 0}
46-
active: {line: 6, character: 0}

0 commit comments

Comments
 (0)