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
33 changes: 33 additions & 0 deletions data/fixtures/recorded/relativeScopes/changeNextPair.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: plaintext
command:
version: 7
spokenForm: change next pair
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: surroundingPair, delimiter: any}
offset: 1
length: 1
direction: forward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
(
()
)
()
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: |
(
()
)
selections:
- anchor: {line: 3, character: 0}
active: {line: 3, character: 0}
34 changes: 34 additions & 0 deletions data/fixtures/recorded/relativeScopes/changeNextPair2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
languageId: plaintext
command:
version: 7
spokenForm: change next pair
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: surroundingPair, delimiter: any}
offset: 1
length: 1
direction: forward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
(

()
)
selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
marks: {}
finalState:
documentContents: |-
(


)
selections:
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
33 changes: 33 additions & 0 deletions data/fixtures/recorded/relativeScopes/changeNextState.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: typescript
command:
version: 7
spokenForm: change next state
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: statement}
offset: 1
length: 1
direction: forward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
if (true) {
const a = 1;
}
const b = 2;
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: |
if (true) {
const a = 1;
}
selections:
- anchor: {line: 3, character: 0}
active: {line: 3, character: 0}
34 changes: 34 additions & 0 deletions data/fixtures/recorded/relativeScopes/changeNextState2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
languageId: typescript
command:
version: 7
spokenForm: change next state
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: statement}
offset: 1
length: 1
direction: forward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
if (true) {

const a = 1;
}
selections:
- anchor: {line: 1, character: 3}
active: {line: 1, character: 3}
marks: {}
finalState:
documentContents: |-
if (true) {


}
selections:
- anchor: {line: 2, character: 3}
active: {line: 2, character: 3}
39 changes: 39 additions & 0 deletions data/fixtures/recorded/relativeScopes/changeNextState3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
languageId: typescript
command:
version: 7
spokenForm: change next state
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: statement}
offset: 1
length: 1
direction: forward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
if (true) {
}
else if (false) {
const a = 1;
}
const b = 2;
selections:
- anchor: {line: 1, character: 3}
active: {line: 1, character: 3}
marks: {}
finalState:
documentContents: |
if (true) {
}
else if (false) {
const a = 1;
}
selections:
- anchor: {line: 6, character: 0}
active: {line: 6, character: 0}
34 changes: 34 additions & 0 deletions data/fixtures/recorded/relativeScopes/changePreviousPair.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
languageId: plaintext
command:
version: 7
spokenForm: change previous pair
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: surroundingPair, delimiter: any}
offset: 1
length: 1
direction: backward
usePrePhraseSnapshot: false
initialState:
documentContents: |
()
(
()
)
selections:
- anchor: {line: 3, character: 1}
active: {line: 3, character: 1}
marks: {}
finalState:
documentContents: |

(
()
)
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
34 changes: 34 additions & 0 deletions data/fixtures/recorded/relativeScopes/changePreviousPair2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
languageId: plaintext
command:
version: 7
spokenForm: change previous pair
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: surroundingPair, delimiter: any}
offset: 1
length: 1
direction: backward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
(
()

)
selections:
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
marks: {}
finalState:
documentContents: |-
(


)
selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
34 changes: 34 additions & 0 deletions data/fixtures/recorded/relativeScopes/changePreviousState.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
languageId: typescript
command:
version: 7
spokenForm: change previous state
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: statement}
offset: 1
length: 1
direction: backward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
const b = 2;
if (true) {
const a = 1;
}
selections:
- anchor: {line: 3, character: 1}
active: {line: 3, character: 1}
marks: {}
finalState:
documentContents: |-

if (true) {
const a = 1;
}
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
34 changes: 34 additions & 0 deletions data/fixtures/recorded/relativeScopes/changePreviousState2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
languageId: typescript
command:
version: 7
spokenForm: change previous state
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: statement}
offset: 1
length: 1
direction: backward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
if (true) {
const a = 1;

}
selections:
- anchor: {line: 2, character: 3}
active: {line: 2, character: 3}
marks: {}
finalState:
documentContents: |-
if (true) {


}
selections:
- anchor: {line: 1, character: 3}
active: {line: 1, character: 3}
40 changes: 40 additions & 0 deletions data/fixtures/recorded/relativeScopes/changePreviousState3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
languageId: typescript
command:
version: 7
spokenForm: change previous state
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: relativeScope
scopeType: {type: statement}
offset: 1
length: 1
direction: backward
usePrePhraseSnapshot: false
initialState:
documentContents: |-
const b = 2;
if (true) {
const a = 1;
}
else if (false) {

}
selections:
- anchor: {line: 5, character: 3}
active: {line: 5, character: 3}
marks: {}
finalState:
documentContents: |-

if (true) {
const a = 1;
}
else if (false) {

}
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
6 changes: 3 additions & 3 deletions data/fixtures/recorded/surroundingPair/changeNextRound4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ initialState:
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: () ()
documentContents: "(()) "
selections:
- anchor: {line: 0, character: 1}
active: {line: 0, character: 1}
- anchor: {line: 0, character: 5}
active: {line: 0, character: 5}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
processModifierStages,
} from "../TargetPipelineRunner";
import { HeadTailTarget, PlainTarget } from "../targets";
import { createContainingInteriorStage } from "./InteriorStage";
import { compoundInteriorScopeType } from "./InteriorStage";

class HeadTailStage implements ModifierStage {
constructor(
Expand Down Expand Up @@ -99,10 +99,12 @@ class BoundedLineStage implements ModifierStage {
options: ModifierStateOptions,
): Target | undefined {
try {
return createContainingInteriorStage(this.modifierStageFactory).run(
target,
options,
)[0];
return this.modifierStageFactory
.create({
type: "containingScope",
scopeType: compoundInteriorScopeType,
})
.run(target, options)[0];
} catch (error) {
if (error instanceof NoContainingScopeError) {
return undefined;
Expand Down
Loading
Loading