Skip to content

Commit 9824d14

Browse files
Remove join as attribute
1 parent 9afcd17 commit 9824d14

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

packages/cursorless-engine/src/actions/JoinLines.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ function getEdits(editor: TextEditor, targets: Target[]): Edit[] {
6161

6262
for (const target of targets) {
6363
const targetsEdits =
64-
target.joinAs === "line"
65-
? getLineTargetEdits(target)
66-
: getTokenTargetEdits(target);
64+
target.textualType === "token"
65+
? getTokenTargetEdits(target)
66+
: getLineTargetEdits(target);
6767

6868
edits.push(...targetsEdits);
6969
}

packages/cursorless-engine/src/processTargets/targets/BaseTarget.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { isEqual } from "lodash-es";
1212
import type { EditWithRangeUpdater } from "../../typings/Types";
1313
import type {
1414
Destination,
15-
JoinAsType,
1615
Target,
1716
TextualType,
1817
} from "../../typings/target.types";
@@ -54,7 +53,6 @@ export abstract class BaseTarget<
5453
isImplicit = false;
5554
isNotebookCell = false;
5655
textualType: TextualType = "token";
57-
joinAs: JoinAsType = "line";
5856

5957
constructor(parameters: TParameters & CommonTargetParameters) {
6058
this.state = {

packages/cursorless-engine/src/processTargets/targets/TokenTarget.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import type { Range } from "@cursorless/common";
2-
import type {
3-
JoinAsType,
4-
Target,
5-
TextualType,
6-
} from "../../typings/target.types";
2+
import type { Target, TextualType } from "../../typings/target.types";
73
import type { CommonTargetParameters } from "./BaseTarget";
84
import { BaseTarget } from "./BaseTarget";
95
import {
@@ -15,7 +11,6 @@ import {
1511
export class TokenTarget extends BaseTarget<CommonTargetParameters> {
1612
type = "TokenTarget";
1713
textualType: TextualType = "token";
18-
joinAs: JoinAsType = "token";
1914
insertionDelimiter = " ";
2015

2116
getLeadingDelimiterTarget(): Target | undefined {

packages/cursorless-engine/src/typings/target.types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import type {
2929
import type { EditWithRangeUpdater } from "./Types";
3030

3131
export type EditNewActionType = "edit" | "insertLineAfter";
32-
export type JoinAsType = "line" | "token";
3332

3433
export type TextualType = "character" | "word" | "token" | "line";
3534

@@ -52,9 +51,6 @@ export interface Target {
5251
/** Targets textual type. Is this target a line, a token, etc... */
5352
readonly textualType: TextualType;
5453

55-
/** Specifies how a target should be joined */
56-
readonly joinAs: JoinAsType;
57-
5854
/**
5955
* If `true`, then this target has an explicit scope type, and so should never
6056
* be automatically expanded to a containing scope.

0 commit comments

Comments
 (0)