Skip to content

Commit 37d9eca

Browse files
Remove surrounding pairs force direction
1 parent b248af6 commit 37d9eca

File tree

5 files changed

+5
-36
lines changed

5 files changed

+5
-36
lines changed

packages/common/src/types/SpokenFormType.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export interface SpokenFormMapKeyTypes {
1616
pairedDelimiter: SpeakableSurroundingPairName;
1717
simpleScopeTypeType: SimpleScopeTypeType;
1818
complexScopeTypeType: "glyph";
19-
surroundingPairForceDirection: "left" | "right";
2019

2120
/**
2221
* These modifier types are spoken by directly saying the spoken form for the

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@ export interface SurroundingPairScopeType {
232232
type: "surroundingPair";
233233
delimiter: SurroundingPairName;
234234

235-
/**
236-
* @deprecated Not supported by next-gen surrounding pairs; we don't believe
237-
* anyone uses this
238-
*/
239-
forceDirection?: SurroundingPairDirection;
240-
241235
/**
242236
* If `true`, then only accept pairs where the pair completely contains the
243237
* selection, ie without the edges touching.

packages/cursorless-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ export class PrimitiveTargetSpokenFormGenerator {
232232
case "oneOf":
233233
case "surroundingPairInterior":
234234
throw new NoSpokenFormError(`Scope type '${scopeType.type}'`);
235+
235236
case "glyph":
236237
return [
237238
this.spokenFormMap.complexScopeTypeType.glyph,
@@ -241,18 +242,9 @@ export class PrimitiveTargetSpokenFormGenerator {
241242
scopeType.character,
242243
),
243244
];
244-
case "surroundingPair": {
245-
const pair = this.spokenFormMap.pairedDelimiter[scopeType.delimiter];
246-
if (scopeType.forceDirection != null) {
247-
return [
248-
this.spokenFormMap.surroundingPairForceDirection[
249-
scopeType.forceDirection
250-
],
251-
pair,
252-
];
253-
}
254-
return pair;
255-
}
245+
246+
case "surroundingPair":
247+
return this.spokenFormMap.pairedDelimiter[scopeType.delimiter];
256248

257249
case "customRegex":
258250
return (

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import type {
44
SurroundingPairScopeType,
55
TextEditor,
66
} from "@cursorless/common";
7-
import { showError, type ScopeType } from "@cursorless/common";
7+
import { type ScopeType } from "@cursorless/common";
88
import type { LanguageDefinitions } from "../../../../languages/LanguageDefinitions";
9-
import { ide } from "../../../../singletons/ide.singleton";
109
import { BaseScopeHandler } from "../BaseScopeHandler";
1110
import { compareTargetScopes } from "../compareTargetScopes";
1211
import type { TargetScope } from "../scope.types";
@@ -35,16 +34,6 @@ export class SurroundingPairScopeHandler extends BaseScopeHandler {
3534
direction: Direction,
3635
hints: ScopeIteratorRequirements,
3736
): Iterable<TargetScope> {
38-
if (this.scopeType.forceDirection != null) {
39-
// DEPRECATED @ 2024-07-01
40-
void showError(
41-
ide().messages,
42-
"deprecatedForceDirection",
43-
"forceDirection is deprecated. If this is important to you please file an issue on the cursorless repo.",
44-
);
45-
return;
46-
}
47-
4837
const delimiterOccurrences = getDelimiterOccurrences(
4938
this.languageDefinitions.get(this.languageId),
5039
editor.document,

packages/cursorless-engine/src/spokenForms/defaultSpokenFormMapCore.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ export const defaultSpokenFormMapCore: DefaultSpokenFormMapDefinition = {
111111
glyph: "glyph",
112112
},
113113

114-
surroundingPairForceDirection: {
115-
left: "left",
116-
right: "right",
117-
},
118-
119114
simpleModifier: {
120115
excludeInterior: "bounds",
121116
toRawSelection: "just",

0 commit comments

Comments
 (0)