Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/common/src/ide/types/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export type CursorlessConfiguration = {
experimental: { snippetsDir: string | undefined; hatStability: HatStability };
decorationDebounceDelayMs: number;
debug: boolean;
private: {
lineParagraphIterationScope: boolean;
};
};

export type CursorlessConfigKey = keyof CursorlessConfiguration;
Expand All @@ -30,9 +27,6 @@ export const CONFIGURATION_DEFAULTS: CursorlessConfiguration = {
hatStability: HatStability.balanced,
},
debug: false,
private: {
lineParagraphIterationScope: false,
},
};

export interface Configuration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ import {
Position,
Range,
ScopeType,
SimpleScopeTypeType,
TextEditor,
} from "@cursorless/common";
import { ide } from "../../../singletons/ide.singleton";
import { LineTarget } from "../../targets";
import { BaseScopeHandler } from "./BaseScopeHandler";
import type { TargetScope } from "./scope.types";

export class LineScopeHandler extends BaseScopeHandler {
public readonly scopeType = { type: "line" } as const;
public readonly iterationScopeType: ScopeType;
public readonly iterationScopeType: ScopeType = {
type: "paragraph",
} as const;
protected readonly isHierarchical = false;
public readonly includeAdjacentInEvery: boolean = true;

constructor(_scopeType: ScopeType, _languageId: string) {
super();
this.iterationScopeType = { type: getIterationScopeTypeType() };
}

*generateScopeCandidates(
Expand Down Expand Up @@ -75,10 +74,3 @@ export function fitRangeToLineContent(editor: TextEditor, range: Range) {
endLine.lastNonWhitespaceCharacterIndex,
);
}

function getIterationScopeTypeType(): SimpleScopeTypeType {
const useParagraph = ide().configuration.getOwnConfiguration(
"private.lineParagraphIterationScope",
);
return useParagraph ? "paragraph" : "document";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
languageId: plaintext
command:
version: 6
spokenForm: change every line
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: everyScope
scopeType: {type: line}
usePrePhraseSnapshot: true
initialState:
documentContents: |

a

b c
d e
f g
selections:
- anchor: {line: 3, character: 0}
active: {line: 3, character: 0}
marks: {}
finalState:
documentContents: |+

a




selections:
- anchor: {line: 3, character: 0}
active: {line: 3, character: 0}
- anchor: {line: 4, character: 0}
active: {line: 4, character: 0}
- anchor: {line: 5, character: 0}
active: {line: 5, character: 0}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
languageId: plaintext
command:
spokenForm: change every line
spokenForm: change every line file
version: 3
targets:
- type: primitive
modifiers:
- type: everyScope
scopeType: {type: line}
- type: containingScope
scopeType: {type: document}
usePrePhraseSnapshot: true
action: {name: clearAndSetSelection}
initialState:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
languageId: plaintext
command:
spokenForm: take every line
spokenForm: take every line file
version: 2
action: {name: setSelection}
targets:
- type: primitive
modifiers:
- type: everyScope
scopeType: {type: line}
- type: containingScope
scopeType: {type: document}
usePrePhraseSnapshot: true
initialState:
documentContents: |
Expand Down