File tree Expand file tree Collapse file tree 5 files changed +8
-3
lines changed
packages/cursorless-engine/src Expand file tree Collapse file tree 5 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export abstract class BaseTarget<
5151 isRaw = false ;
5252 isImplicit = false ;
5353 joinAs : JoinAsType = "line" ;
54- type : TargetType | undefined = undefined ;
54+ type : TargetType = "token" ;
5555
5656 constructor ( parameters : TParameters & CommonTargetParameters ) {
5757 this . state = {
Original file line number Diff line number Diff line change 11import type { EnforceUndefined } from "@cursorless/common" ;
2+ import type { TargetType } from "../../typings/target.types" ;
23import type { CommonTargetParameters } from "./BaseTarget" ;
34import { BaseTarget } from "./BaseTarget" ;
45
@@ -10,6 +11,7 @@ import { BaseTarget } from "./BaseTarget";
1011 */
1112export class ImplicitTarget extends BaseTarget < CommonTargetParameters > {
1213 instanceType = "ImplicitTarget" ;
14+ type : TargetType = "character" ;
1315 insertionDelimiter = "" ;
1416 isRaw = true ;
1517 hasExplicitScopeType = false ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class PlainTarget extends BaseTarget<PlainTargetParameters> {
2020
2121 constructor ( parameters : PlainTargetParameters ) {
2222 super ( parameters ) ;
23- this . type = parameters . type ;
23+ this . type = parameters . type ?? "token" ;
2424 this . insertionDelimiter = parameters . insertionDelimiter ?? "" ;
2525 }
2626
Original file line number Diff line number Diff line change 11import type { EnforceUndefined } from "@cursorless/common" ;
2+ import type { TargetType } from "../../typings/target.types" ;
23import type { CommonTargetParameters } from "./BaseTarget" ;
34import { BaseTarget } from "./BaseTarget" ;
45
@@ -9,6 +10,7 @@ import { BaseTarget } from "./BaseTarget";
910 */
1011export class RawSelectionTarget extends BaseTarget < CommonTargetParameters > {
1112 instanceType = "RawSelectionTarget" ;
13+ type : TargetType = "character" ;
1214 insertionDelimiter = "" ;
1315 isRaw = true ;
1416
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ export interface Target {
5555 /** Optional prefix. For example, dash or asterisk for a markdown item */
5656 readonly prefixRange ?: Range ;
5757
58- readonly type : TargetType | undefined ;
58+ /** Target type. Is this target a line, a token, etc... */
59+ readonly type : TargetType ;
5960
6061 /** Specifies how a target should be joined */
6162 readonly joinAs : JoinAsType ;
You can’t perform that action at this time.
0 commit comments