From ea8475477b001da6a775a22d4952114bc6c2f25d Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Sat, 11 Sep 2021 14:34:26 +0100 Subject: [PATCH 01/48] Initial work --- src/actions/BringMoveSwap.ts | 13 +- src/actions/Wrap.ts | 16 ++- .../recorded/updateSelections/commentTrap.yml | 30 ++++ src/typings/Types.ts | 2 - src/util/updateRangeInfos.ts | 87 ++++++++++++ src/util/updateSelections.ts | 130 +++++++----------- 6 files changed, 182 insertions(+), 96 deletions(-) create mode 100644 src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml create mode 100644 src/util/updateRangeInfos.ts diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index 52023d07aa..86296af0ab 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -11,7 +11,7 @@ import update from "immutability-helper"; import displayPendingEditDecorations from "../util/editDisplayUtils"; import { performOutsideAdjustment } from "../util/performInsideOutsideAdjustment"; import { flatten, zip } from "lodash"; -import { Selection, TextEditor, Range } from "vscode"; +import { Selection, TextEditor, Range, DecorationRangeBehavior } from "vscode"; import { performEditsAndUpdateSelections } from "../util/updateSelections"; import { getTextWithPossibleDelimiter } from "../util/getTextWithPossibleDelimiter"; @@ -104,7 +104,6 @@ class BringMoveSwap implements Action { editor: destination.selection.editor, originalSelection: destination, isSource: false, - extendOnEqualEmptyRange: true, }, ]; @@ -134,7 +133,6 @@ class BringMoveSwap implements Action { editor: source.selection.editor, originalSelection: source, isSource: true, - extendOnEqualEmptyRange: true, }); } @@ -157,9 +155,12 @@ class BringMoveSwap implements Action { : edits.filter(({ isSource }) => !isSource); const [updatedSelections]: Selection[][] = - await performEditsAndUpdateSelections(editor, filteredEdits, [ - edits.map((edit) => edit.originalSelection.selection.selection), - ]); + await performEditsAndUpdateSelections( + editor, + filteredEdits, + [edits.map((edit) => edit.originalSelection.selection.selection)], + DecorationRangeBehavior.OpenOpen + ); return edits.map((edit, index) => { const selection = updatedSelections[index]; diff --git a/src/actions/Wrap.ts b/src/actions/Wrap.ts index a062bc53db..c932f340de 100644 --- a/src/actions/Wrap.ts +++ b/src/actions/Wrap.ts @@ -1,4 +1,4 @@ -import { Selection } from "vscode"; +import { DecorationRangeBehavior, Selection } from "vscode"; import { flatten } from "lodash"; import { Action, @@ -41,7 +41,6 @@ export default class Wrap implements Action { }, { text: right, - dontMoveOnEqualStart: true, range: new Selection( target.selection.selection.end, target.selection.selection.end @@ -50,10 +49,15 @@ export default class Wrap implements Action { ]); const [updatedOriginalSelections, updatedTargetsSelections] = - await performEditsAndUpdateSelections(editor, edits, [ - editor.selections, - targets.map((target) => target.selection.selection), - ]); + await performEditsAndUpdateSelections( + editor, + edits, + [ + editor.selections, + targets.map((target) => target.selection.selection), + ], + DecorationRangeBehavior.ClosedClosed + ); editor.selections = updatedOriginalSelections; diff --git a/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml b/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml new file mode 100644 index 0000000000..cfaec135cc --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml @@ -0,0 +1,30 @@ +spokenForm: comment trap +languageId: typescript +command: + actionName: toggleLineComment + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: t} + extraArgs: [] +marks: + default.t: + start: {line: 1, character: 1} + end: {line: 1, character: 6} +initialState: + documentContents: |- + 'hello' + 'there' + selections: + - anchor: {line: 0, character: 1} + active: {line: 1, character: 6} +finalState: + documentContents: |- + 'hello' + // 'there' + selections: + - anchor: {line: 0, character: 1} + active: {line: 1, character: 9} + thatMark: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 9} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: t}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 7715fb28ef..5548dc0d22 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -362,6 +362,4 @@ export type SelectionExtractor = ( export interface Edit { range: vscode.Range; text: string; - dontMoveOnEqualStart?: boolean; - extendOnEqualEmptyRange?: boolean; } diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts new file mode 100644 index 0000000000..412c77fc26 --- /dev/null +++ b/src/util/updateRangeInfos.ts @@ -0,0 +1,87 @@ +import { + DecorationRangeBehavior, + Range, + TextDocument, + TextDocumentChangeEvent, + TextDocumentContentChangeEvent, +} from "vscode"; + +export interface RangeInfo { + document: TextDocument; + range: Range; + startOffset: number; + endOffset: number; +} + +export function updateRangeInfos( + changeEvent: TextDocumentChangeEvent, + rangeInfos: RangeInfo[], + rangeBehavior: DecorationRangeBehavior = DecorationRangeBehavior.ClosedClosed +) { + const { document, contentChanges } = changeEvent; + + contentChanges.forEach((change) => { + const changeDisplacement = change.text.length - change.rangeLength; + const changeStartOffset = change.rangeOffset; + const changeEndOffset = changeStartOffset + change.rangeLength; + + rangeInfos.forEach((selectionInfo) => { + if (selectionInfo.document !== document) { + return; + } + + let newSelectionInfoStartOffset = computeNewOffset( + selectionInfo.startOffset, + changeStartOffset, + changeEndOffset, + changeDisplacement, + rangeBehavior === DecorationRangeBehavior.OpenClosed || + rangeBehavior === DecorationRangeBehavior.OpenOpen + ); + + const newSelectionInfoEndOffset = computeNewOffset( + selectionInfo.endOffset, + changeStartOffset, + changeEndOffset, + changeDisplacement, + rangeBehavior === DecorationRangeBehavior.OpenClosed || + rangeBehavior === DecorationRangeBehavior.ClosedClosed + ); + + // Handle the case where we're ClosedClosed and change intersects both + // start and end + newSelectionInfoStartOffset = Math.min( + newSelectionInfoStartOffset, + newSelectionInfoEndOffset + ); + + selectionInfo.range = selectionInfo.range.with( + document.positionAt(newSelectionInfoStartOffset), + document.positionAt(newSelectionInfoEndOffset) + ); + selectionInfo.startOffset = newSelectionInfoStartOffset; + selectionInfo.endOffset = newSelectionInfoEndOffset; + }); + }); +} + +function computeNewOffset( + originalOffset: number, + changeStartOffset: number, + changeEndOffset: number, + changeDisplacement: number, + moveLeftOnConflict: boolean +) { + if (changeEndOffset < originalOffset) { + return originalOffset + changeDisplacement; + } + + if (changeStartOffset > originalOffset) { + return originalOffset; + } + + // todo handle fancy case with regex + return moveLeftOnConflict + ? changeStartOffset + : changeEndOffset + changeDisplacement; +} diff --git a/src/util/updateSelections.ts b/src/util/updateSelections.ts index 14309d6066..c6d55dd6fe 100644 --- a/src/util/updateSelections.ts +++ b/src/util/updateSelections.ts @@ -1,27 +1,23 @@ import { Selection, - Range, TextEditor, workspace, TextDocument, TextDocumentChangeEvent, - TextDocumentContentChangeEvent, Disposable, EndOfLine, + DecorationRangeBehavior, } from "vscode"; import { performDocumentEdits } from "./performDocumentEdits"; import { Edit } from "../typings/Types"; +import { flatten } from "lodash"; +import { + RangeInfo, + updateRangeInfos, +} from "./updateRangeInfos"; -interface TextDocumentContentChange extends TextDocumentContentChangeEvent { - dontMoveOnEqualStart?: boolean; - extendOnEqualEmptyRange?: boolean; -} - -interface SelectionInfo { - range: Range; - isReversed: boolean; - startOffset: number; - endOffset: number; +export interface SelectionInfo extends RangeInfo { + range: Selection; } function selectionsToSelectionInfos( @@ -30,66 +26,24 @@ function selectionsToSelectionInfos( ): SelectionInfo[][] { return selectionMatrix.map((selections) => selections.map((selection) => ({ + document, range: selection, - // The built in isReversed is bugged on empty selection. don't use - isReversed: selection.active.isBefore(selection.anchor), startOffset: document.offsetAt(selection.start), endOffset: document.offsetAt(selection.end), })) ); } -function selectionInfosToSelections( - document: TextDocument, - selectionInfoMatrix: SelectionInfo[][] -): Selection[][] { - return selectionInfoMatrix.map((selectionInfos) => - selectionInfos.map( - (selectionInfo) => - new Selection( - document.positionAt( - selectionInfo.isReversed - ? selectionInfo.endOffset - : selectionInfo.startOffset - ), - document.positionAt( - selectionInfo.isReversed - ? selectionInfo.startOffset - : selectionInfo.endOffset - ) - ) - ) - ); -} - function updateSelectionInfoMatrix( - contentChanges: readonly TextDocumentContentChange[], - selectionInfoMatrix: SelectionInfo[][] + changeEvent: TextDocumentChangeEvent, + selectionInfoMatrix: SelectionInfo[][], + rangeBehavior?: DecorationRangeBehavior ) { - contentChanges.forEach((change) => { - const offsetDelta = change.text.length - change.rangeLength; - - selectionInfoMatrix.forEach((selectionInfos) => { - selectionInfos.forEach((selectionInfo) => { - // Change is selection. Move just end to match. - if ( - change.range.isEqual(selectionInfo.range) && - (!selectionInfo.range.isEmpty || change.extendOnEqualEmptyRange) - ) { - selectionInfo.endOffset += offsetDelta; - } - // Change is before selection. Move entire selection. - else if ( - change.range.start.isBefore(selectionInfo.range.start) || - (change.range.start.isEqual(selectionInfo.range.start) && - !change.dontMoveOnEqualStart) - ) { - selectionInfo.startOffset += offsetDelta; - selectionInfo.endOffset += offsetDelta; - } - }); - }); - }); + updateRangeInfos( + changeEvent, + flatten(selectionInfoMatrix), + rangeBehavior + ); } class SelectionUpdater { @@ -97,7 +51,11 @@ class SelectionUpdater { private selectionInfoMatrix: SelectionInfo[][]; private disposable!: Disposable; - constructor(editor: TextEditor, originalSelections: Selection[][]) { + constructor( + editor: TextEditor, + originalSelections: Selection[][], + private rangeBehavior?: DecorationRangeBehavior + ) { this.document = editor.document; this.selectionInfoMatrix = selectionsToSelectionInfos( this.document, @@ -117,8 +75,9 @@ class SelectionUpdater { } updateSelectionInfoMatrix( - event.contentChanges, - this.selectionInfoMatrix + event, + this.selectionInfoMatrix, + this.rangeBehavior ); } ); @@ -135,7 +94,9 @@ class SelectionUpdater { * @returns Original selections updated to take into account the given changes */ get updatedSelections() { - return selectionInfosToSelections(this.document, this.selectionInfoMatrix); + return this.selectionInfoMatrix.map((selectionInfos) => + selectionInfos.map(({ range }) => range) + ); } } @@ -150,9 +111,14 @@ class SelectionUpdater { export async function callFunctionAndUpdateSelections( func: () => Thenable, editor: TextEditor, - selectionMatrix: Selection[][] + selectionMatrix: Selection[][], + rangeBehavior?: DecorationRangeBehavior ): Promise { - const selectionUpdater = new SelectionUpdater(editor, selectionMatrix); + const selectionUpdater = new SelectionUpdater( + editor, + selectionMatrix, + rangeBehavior + ); await func(); @@ -172,7 +138,8 @@ export async function callFunctionAndUpdateSelections( export async function performEditsAndUpdateSelections( editor: TextEditor, edits: Edit[], - originalSelections: Selection[][] + originalSelections: Selection[][], + rangeBehavior?: DecorationRangeBehavior ) { const document = editor.document; const selectionInfoMatrix = selectionsToSelectionInfos( @@ -180,17 +147,12 @@ export async function performEditsAndUpdateSelections( originalSelections ); - const contentChanges = edits.map( - ({ range, text, dontMoveOnEqualStart, extendOnEqualEmptyRange }) => ({ - range, - text, - dontMoveOnEqualStart, - extendOnEqualEmptyRange, - rangeOffset: document.offsetAt(range.start), - rangeLength: - document.offsetAt(range.end) - document.offsetAt(range.start), - }) - ); + const contentChanges = edits.map(({ range, text }) => ({ + range, + text, + rangeOffset: document.offsetAt(range.start), + rangeLength: document.offsetAt(range.end) - document.offsetAt(range.start), + })); // Replace \n with \r\n. Vscode does this internally and it's // important that our calculated changes reflect the actual changes @@ -206,7 +168,11 @@ export async function performEditsAndUpdateSelections( throw new Error("Could not apply edits"); } - updateSelectionInfoMatrix(contentChanges, selectionInfoMatrix); + updateSelectionInfoMatrix( + { document, contentChanges }, + selectionInfoMatrix, + rangeBehavior + ); return selectionInfosToSelections(document, selectionInfoMatrix); } From 82620c0b0cbd188092a3e6b88f79f4127a53c7f9 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 21 Sep 2021 15:47:51 +0100 Subject: [PATCH 02/48] Initial new vesrion --- src/util/updateRangeInfos.ts | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 412c77fc26..3ab01884e9 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -13,6 +13,46 @@ export interface RangeInfo { endOffset: number; } +interface BehaviorDefinition { + isReplace?: boolean; + + isLeftOpen?: boolean; + isRightOpen?: boolean; + captureRegex?: RegExp; + + behavior: ( + changeEvent: TextDocumentChangeEvent, + rangeInfo: RangeInfo + ) => void; +} + +interface InsertBehavior extends BehaviorDefinition { + isReplace: boolean; +} + +const insertBehaviors: InsertBehavior[] = [ + { + isReplace: false, + isLeftOpen: false, + behavior: () => {}, + }, + { + isReplace: false, + isLeftOpen: true, + behavior: () => {}, + }, + { + isReplace: true, + isRightOpen: false, + behavior: () => {}, + }, + { + isReplace: true, + isRightOpen: true, + behavior: () => {}, + }, +]; + export function updateRangeInfos( changeEvent: TextDocumentChangeEvent, rangeInfos: RangeInfo[], From e5661eb61b29100af1c080d86d955a71f92544f1 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 22 Sep 2021 15:14:23 +0100 Subject: [PATCH 03/48] Tweaks --- src/util/updateRangeInfos.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 3ab01884e9..3cb1207b84 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -18,7 +18,7 @@ interface BehaviorDefinition { isLeftOpen?: boolean; isRightOpen?: boolean; - captureRegex?: RegExp; + hasCaptureRegex?: boolean; behavior: ( changeEvent: TextDocumentChangeEvent, @@ -34,11 +34,18 @@ const insertBehaviors: InsertBehavior[] = [ { isReplace: false, isLeftOpen: false, + hasCaptureRegex: false, behavior: () => {}, }, { isReplace: false, isLeftOpen: true, + hasCaptureRegex: false, + behavior: () => {}, + }, + { + isReplace: false, + hasCaptureRegex: true, behavior: () => {}, }, { From 1f64fd63f20abd12d0af74de1948f9bd23d93b5b Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 23 Sep 2021 15:02:12 +0100 Subject: [PATCH 04/48] More work --- src/util/updateRangeInfos.ts | 124 ++++++++++++++++++++++++++++------- 1 file changed, 99 insertions(+), 25 deletions(-) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 3cb1207b84..0bbf9a2078 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -13,50 +13,121 @@ export interface RangeInfo { endOffset: number; } -interface BehaviorDefinition { +interface ChangeEventInfo { + event: TextDocumentContentChangeEvent; + originalStartOffset: number; + originalEndOffset: number; + finalStartOffset: number; + finalEndOffset: number; + displacement: number; +} + +interface RangeOffsets { + startOffset: number; + endOffset: number; +} + +interface BehaviorCondition { isReplace?: boolean; isLeftOpen?: boolean; isRightOpen?: boolean; hasCaptureRegex?: boolean; +} + +interface BehaviorDefinition { + condition: BehaviorCondition; behavior: ( - changeEvent: TextDocumentChangeEvent, - rangeInfo: RangeInfo - ) => void; + changeEventInfo: ChangeEventInfo, + rangeInfo: RangeInfo, + options: { captureRegex: RegExp } + ) => RangeOffsets; } -interface InsertBehavior extends BehaviorDefinition { +interface InsertBehaviorCondition extends BehaviorCondition { isReplace: boolean; } +interface InsertBehaviorDefinition extends BehaviorDefinition { + condition: InsertBehaviorCondition; +} -const insertBehaviors: InsertBehavior[] = [ +const emptyRangeInsertBehaviors: InsertBehaviorDefinition[] = [ + { + condition: { isReplace: false, isLeftOpen: false }, + behavior: ({ finalEndOffset }) => ({ + startOffset: finalEndOffset, + endOffset: finalEndOffset, + }), + }, { - isReplace: false, - isLeftOpen: false, - hasCaptureRegex: false, - behavior: () => {}, + condition: { isReplace: false, isLeftOpen: true }, + behavior: ({ finalStartOffset, finalEndOffset }) => ({ + startOffset: finalStartOffset, + endOffset: finalEndOffset, + }), }, { - isReplace: false, - isLeftOpen: true, - hasCaptureRegex: false, - behavior: () => {}, + condition: { isReplace: false, hasCaptureRegex: true }, + behavior: ( + { finalStartOffset, finalEndOffset, event: { text } }, + _, + { captureRegex } + ) => { + const { source, flags } = captureRegex; + const newRegex = new RegExp( + source.endsWith("$") ? source : source + "$", + flags.replace("m", "") + ); + + const index = text.search(newRegex); + + return index === -1 + ? { + startOffset: finalEndOffset, + endOffset: finalEndOffset, + } + : { + startOffset: finalStartOffset + index, + endOffset: finalEndOffset, + }; + }, }, { - isReplace: false, - hasCaptureRegex: true, - behavior: () => {}, + condition: { isReplace: true, isRightOpen: false }, + behavior: ({ finalStartOffset }) => ({ + startOffset: finalStartOffset, + endOffset: finalStartOffset, + }), }, { - isReplace: true, - isRightOpen: false, - behavior: () => {}, + condition: { isReplace: true, isRightOpen: true }, + behavior: ({ finalStartOffset, finalEndOffset }) => ({ + startOffset: finalStartOffset, + endOffset: finalEndOffset, + }), }, { - isReplace: true, - isRightOpen: true, - behavior: () => {}, + condition: { isReplace: false, hasCaptureRegex: true }, + behavior: ({ finalStartOffset, event: { text } }, _, { captureRegex }) => { + const { source, flags } = captureRegex; + const newRegex = new RegExp( + source.startsWith("^") ? source : "^" + source, + flags.replace("m", "") + ); + + const matches = text.match(newRegex); + + return matches == null + ? { + startOffset: finalStartOffset, + endOffset: finalStartOffset, + } + : { + startOffset: finalStartOffset, + endOffset: finalStartOffset + matches[0].length, + }; + }, }, ]; @@ -69,8 +140,11 @@ export function updateRangeInfos( contentChanges.forEach((change) => { const changeDisplacement = change.text.length - change.rangeLength; - const changeStartOffset = change.rangeOffset; - const changeEndOffset = changeStartOffset + change.rangeLength; + const changeOriginalStartOffset = change.rangeOffset; + const changeOriginalEndOffset = + changeOriginalStartOffset + change.rangeLength; + const changeFinalStartOffset = changeOriginalStartOffset; + const changeFinalEndOffset = changeOriginalEndOffset + changeDisplacement; rangeInfos.forEach((selectionInfo) => { if (selectionInfo.document !== document) { From f90f0daf89073182a8864db2153f3776f216087c Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 24 Sep 2021 13:37:46 +0100 Subject: [PATCH 05/48] More implementation --- src/util/regex.ts | 17 +++++++ src/util/updateRangeInfos.ts | 95 +++++++++++++++--------------------- 2 files changed, 57 insertions(+), 55 deletions(-) create mode 100644 src/util/regex.ts diff --git a/src/util/regex.ts b/src/util/regex.ts new file mode 100644 index 0000000000..180caf7eab --- /dev/null +++ b/src/util/regex.ts @@ -0,0 +1,17 @@ +export function rightAnchored(regex: RegExp) { + const { source, flags } = regex; + + return new RegExp( + source.endsWith("$") ? source : source + "$", + flags.replace("m", "") + ); +} + +export function leftAnchored(regex: RegExp) { + const { source, flags } = regex; + + return new RegExp( + source.startsWith("^") ? source : "^" + source, + flags.replace("m", "") + ); +} diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 0bbf9a2078..8ee4b7a84b 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -5,34 +5,33 @@ import { TextDocumentChangeEvent, TextDocumentContentChangeEvent, } from "vscode"; +import { leftAnchored, rightAnchored } from "./regex"; export interface RangeInfo { document: TextDocument; range: Range; - startOffset: number; - endOffset: number; + offsets: RangeOffsets; } interface ChangeEventInfo { event: TextDocumentContentChangeEvent; - originalStartOffset: number; - originalEndOffset: number; - finalStartOffset: number; - finalEndOffset: number; + originalOffsets: RangeOffsets; + finalOffsets: RangeOffsets; displacement: number; } interface RangeOffsets { - startOffset: number; - endOffset: number; + start: number; + end: number; } +type ExpansionBehavior = "open" | "closed" | "regex"; + interface BehaviorCondition { isReplace?: boolean; - isLeftOpen?: boolean; - isRightOpen?: boolean; - hasCaptureRegex?: boolean; + leftExpansionBehavior?: ExpansionBehavior; + rightExpansionBehavior?: ExpansionBehavior; } interface BehaviorDefinition { @@ -54,78 +53,64 @@ interface InsertBehaviorDefinition extends BehaviorDefinition { const emptyRangeInsertBehaviors: InsertBehaviorDefinition[] = [ { - condition: { isReplace: false, isLeftOpen: false }, - behavior: ({ finalEndOffset }) => ({ - startOffset: finalEndOffset, - endOffset: finalEndOffset, + condition: { isReplace: false, leftExpansionBehavior: "closed" }, + behavior: ({ finalOffsets: { end } }) => ({ + start: end, + end, }), }, { - condition: { isReplace: false, isLeftOpen: true }, - behavior: ({ finalStartOffset, finalEndOffset }) => ({ - startOffset: finalStartOffset, - endOffset: finalEndOffset, - }), + condition: { isReplace: false, leftExpansionBehavior: "open" }, + behavior: ({ finalOffsets }) => finalOffsets, }, { - condition: { isReplace: false, hasCaptureRegex: true }, + condition: { isReplace: false, leftExpansionBehavior: "regex" }, behavior: ( - { finalStartOffset, finalEndOffset, event: { text } }, + { finalOffsets: { start, end }, event: { text } }, _, { captureRegex } ) => { - const { source, flags } = captureRegex; - const newRegex = new RegExp( - source.endsWith("$") ? source : source + "$", - flags.replace("m", "") - ); - - const index = text.search(newRegex); + const index = text.search(rightAnchored(captureRegex)); return index === -1 ? { - startOffset: finalEndOffset, - endOffset: finalEndOffset, + start: end, + end, } : { - startOffset: finalStartOffset + index, - endOffset: finalEndOffset, + start: start + index, + end, }; }, }, { - condition: { isReplace: true, isRightOpen: false }, - behavior: ({ finalStartOffset }) => ({ - startOffset: finalStartOffset, - endOffset: finalStartOffset, + condition: { isReplace: true, rightExpansionBehavior: "closed" }, + behavior: ({ finalOffsets: { start } }) => ({ + start, + end: start, }), }, { - condition: { isReplace: true, isRightOpen: true }, - behavior: ({ finalStartOffset, finalEndOffset }) => ({ - startOffset: finalStartOffset, - endOffset: finalEndOffset, - }), + condition: { isReplace: true, rightExpansionBehavior: "open" }, + behavior: ({ finalOffsets }) => finalOffsets, }, { - condition: { isReplace: false, hasCaptureRegex: true }, - behavior: ({ finalStartOffset, event: { text } }, _, { captureRegex }) => { - const { source, flags } = captureRegex; - const newRegex = new RegExp( - source.startsWith("^") ? source : "^" + source, - flags.replace("m", "") - ); - - const matches = text.match(newRegex); + condition: { isReplace: true, rightExpansionBehavior: "regex" }, + behavior: ( + { finalOffsets: { start }, event: { text } }, + _, + { captureRegex } + ) => { + const matches = text.match(leftAnchored(captureRegex)); return matches == null ? { - startOffset: finalStartOffset, - endOffset: finalStartOffset, + start, + end: start, } : { - startOffset: finalStartOffset, - endOffset: finalStartOffset + matches[0].length, + start, + end: start + matches[0].length, }; }, }, From 12c71b5f86dc13213b402a51fb07b82777befbfb Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 24 Sep 2021 16:25:41 +0100 Subject: [PATCH 06/48] MOre stuff --- src/util/updateRangeInfos.ts | 248 +++++++++++++++++++++++------------ 1 file changed, 164 insertions(+), 84 deletions(-) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 8ee4b7a84b..3a7a29838c 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -7,14 +7,46 @@ import { } from "vscode"; import { leftAnchored, rightAnchored } from "./regex"; +interface RangeOffsets { + start: number; + end: number; +} + +type SingleEdgeExpansionBehavior = + | SimpleExpansionBehavior + | RegexExpansionBehavior; + +interface SimpleExpansionBehavior { + type: "open" | "closed"; +} + +interface RegexExpansionBehavior { + type: "regex"; + regex: RegExp; +} + +interface ExpansionBehavior { + start: SingleEdgeExpansionBehavior; + end: SingleEdgeExpansionBehavior; +} + export interface RangeInfo { document: TextDocument; range: Range; offsets: RangeOffsets; + expansionBehavior: ExpansionBehavior; +} + +interface ExtendedTextDocumentContentChangeEvent + extends TextDocumentContentChangeEvent { + /** + * If this is true then we should not shift an empty selection to the right + */ + isReplace?: boolean; } interface ChangeEventInfo { - event: TextDocumentContentChangeEvent; + event: ExtendedTextDocumentContentChangeEvent; originalOffsets: RangeOffsets; finalOffsets: RangeOffsets; displacement: number; @@ -25,96 +57,144 @@ interface RangeOffsets { end: number; } -type ExpansionBehavior = "open" | "closed" | "regex"; +function getOffsetsForEmptyRangeInsert( + changeEventInfo: ChangeEventInfo, + rangeInfo: RangeInfo +): RangeOffsets { + const { + event: { text, isReplace }, + finalOffsets: { start, end }, + } = changeEventInfo; -interface BehaviorCondition { - isReplace?: boolean; + if (isReplace) { + const expansionBehavior = rangeInfo.expansionBehavior.start; - leftExpansionBehavior?: ExpansionBehavior; - rightExpansionBehavior?: ExpansionBehavior; -} + switch (expansionBehavior.type) { + case "closed": + return { + start: end, + end, + }; -interface BehaviorDefinition { - condition: BehaviorCondition; + case "open": + return { start, end }; - behavior: ( - changeEventInfo: ChangeEventInfo, - rangeInfo: RangeInfo, - options: { captureRegex: RegExp } - ) => RangeOffsets; -} + case "regex": + const index = text.search(rightAnchored(expansionBehavior.regex)); -interface InsertBehaviorCondition extends BehaviorCondition { - isReplace: boolean; -} -interface InsertBehaviorDefinition extends BehaviorDefinition { - condition: InsertBehaviorCondition; + return index === -1 + ? { + start: end, + end, + } + : { + start: start + index, + end, + }; + } + } else { + const expansionBehavior = rangeInfo.expansionBehavior.end; + + switch (expansionBehavior.type) { + case "closed": + return { + start, + end: start, + }; + + case "open": + return { start, end }; + + case "regex": + const matches = text.match(leftAnchored(expansionBehavior.regex)); + + return matches == null + ? { + start, + end: start, + } + : { + start, + end: start + matches[0].length, + }; + } + } } -const emptyRangeInsertBehaviors: InsertBehaviorDefinition[] = [ - { - condition: { isReplace: false, leftExpansionBehavior: "closed" }, - behavior: ({ finalOffsets: { end } }) => ({ - start: end, - end, - }), - }, - { - condition: { isReplace: false, leftExpansionBehavior: "open" }, - behavior: ({ finalOffsets }) => finalOffsets, - }, - { - condition: { isReplace: false, leftExpansionBehavior: "regex" }, - behavior: ( - { finalOffsets: { start, end }, event: { text } }, - _, - { captureRegex } - ) => { - const index = text.search(rightAnchored(captureRegex)); - - return index === -1 - ? { - start: end, - end, - } - : { - start: start + index, - end, - }; - }, - }, - { - condition: { isReplace: true, rightExpansionBehavior: "closed" }, - behavior: ({ finalOffsets: { start } }) => ({ - start, - end: start, - }), - }, - { - condition: { isReplace: true, rightExpansionBehavior: "open" }, - behavior: ({ finalOffsets }) => finalOffsets, - }, - { - condition: { isReplace: true, rightExpansionBehavior: "regex" }, - behavior: ( - { finalOffsets: { start }, event: { text } }, - _, - { captureRegex } - ) => { - const matches = text.match(leftAnchored(captureRegex)); - - return matches == null - ? { - start, - end: start, - } - : { - start, - end: start + matches[0].length, - }; - }, - }, -]; +function getOffsetsForNonEmptyRangeInsert( + changeEventInfo: ChangeEventInfo, + rangeInfo: RangeInfo +): RangeOffsets { + const { + event: { text, isReplace }, + originalOffsets: { start: insertOffset }, + displacement, + } = changeEventInfo; + const { + offsets: { start: rangeStart, end: rangeEnd }, + } = rangeInfo; + + if (insertOffset > rangeStart && insertOffset < rangeEnd) { + return { start: rangeStart, end: rangeEnd + displacement }; + } + + if (insertOffset === rangeStart) { + const expansionBehavior = rangeInfo.expansionBehavior.start; + + switch (expansionBehavior.type) { + case "closed": + return { + start: rangeStart + displacement, + end: rangeEnd + displacement, + }; + + case "open": + return { + start: rangeStart, + end: rangeEnd + displacement, + }; + + case "regex": + const index = text.search(rightAnchored(expansionBehavior.regex)); + + return index === -1 + ? { + start: end, + end, + } + : { + start: start + index, + end, + }; + } + } else { + const expansionBehavior = rangeInfo.expansionBehavior.end; + + switch (expansionBehavior.type) { + case "closed": + return { + start, + end: start, + }; + + case "open": + return { start, end }; + + case "regex": + const matches = text.match(leftAnchored(expansionBehavior.regex)); + + return matches == null + ? { + start, + end: start, + } + : { + start, + end: start + matches[0].length, + }; + } + } +} export function updateRangeInfos( changeEvent: TextDocumentChangeEvent, From 3b39f22deef1ba64460b080cc7359fe15fd15c99 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 8 Oct 2021 10:53:50 +0100 Subject: [PATCH 07/48] Some stuff --- src/util/updateRangeInfos.ts | 42 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 3a7a29838c..c489c6cbca 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -1,3 +1,4 @@ +import { invariant } from "immutability-helper"; import { DecorationRangeBehavior, Range, @@ -35,6 +36,7 @@ export interface RangeInfo { range: Range; offsets: RangeOffsets; expansionBehavior: ExpansionBehavior; + text: string; } interface ExtendedTextDocumentContentChangeEvent @@ -66,7 +68,15 @@ function getOffsetsForEmptyRangeInsert( finalOffsets: { start, end }, } = changeEventInfo; + invariant( + start === end && + start === rangeInfo.offsets.start && + start === rangeInfo.offsets.end, + () => "Selection range and change range expected to be same empty range" + ); + if (isReplace) { + // In this case the cursor stays to the left so we care about the start of the range const expansionBehavior = rangeInfo.expansionBehavior.start; switch (expansionBehavior.type) { @@ -93,6 +103,7 @@ function getOffsetsForEmptyRangeInsert( }; } } else { + // In this case the cursor moves to the right so we care about the end of the range const expansionBehavior = rangeInfo.expansionBehavior.end; switch (expansionBehavior.type) { @@ -126,15 +137,26 @@ function getOffsetsForNonEmptyRangeInsert( rangeInfo: RangeInfo ): RangeOffsets { const { - event: { text, isReplace }, + event: { text: insertedText, isReplace }, originalOffsets: { start: insertOffset }, displacement, } = changeEventInfo; const { offsets: { start: rangeStart, end: rangeEnd }, + text: originalRangeText, } = rangeInfo; + invariant( + rangeEnd > rangeStart, + () => "Selection range expected to be nonempty" + ); + invariant( + insertOffset >= rangeStart && insertOffset <= rangeEnd, + () => "Insertion offset expected to intersect with selection range" + ); + if (insertOffset > rangeStart && insertOffset < rangeEnd) { + // If containment is strict just move end of range to accommodate the internal change return { start: rangeStart, end: rangeEnd + displacement }; } @@ -155,15 +177,21 @@ function getOffsetsForNonEmptyRangeInsert( }; case "regex": - const index = text.search(rightAnchored(expansionBehavior.regex)); + let text = insertedText + originalRangeText; + let index = text.search(rightAnchored(expansionBehavior.regex)); + while (index > insertedText.length) { + // If the original range contains multiple matching instances of the regex use the leftmost one + text = insertedText + originalRangeText.slice(index); + index = text.search(rightAnchored(expansionBehavior.regex)); + } return index === -1 ? { - start: end, - end, + start: rangeStart, + end: rangeEnd + displacement, } : { - start: start + index, + start: rangeStart + index, end, }; } @@ -181,7 +209,9 @@ function getOffsetsForNonEmptyRangeInsert( return { start, end }; case "regex": - const matches = text.match(leftAnchored(expansionBehavior.regex)); + const matches = insertedText.match( + leftAnchored(expansionBehavior.regex) + ); return matches == null ? { From 8a28109fdcae9c978cb6050505bbe71cfe0c586f Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 8 Oct 2021 10:53:54 +0100 Subject: [PATCH 08/48] More stuff --- src/util/updateRangeInfos.ts | 49 +++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index c489c6cbca..75cc5c107f 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -162,65 +162,78 @@ function getOffsetsForNonEmptyRangeInsert( if (insertOffset === rangeStart) { const expansionBehavior = rangeInfo.expansionBehavior.start; + const newRangeEnd = rangeEnd + displacement; switch (expansionBehavior.type) { case "closed": return { start: rangeStart + displacement, - end: rangeEnd + displacement, + end: newRangeEnd, }; case "open": return { start: rangeStart, - end: rangeEnd + displacement, + end: newRangeEnd, }; case "regex": let text = insertedText + originalRangeText; - let index = text.search(rightAnchored(expansionBehavior.regex)); + const regex = rightAnchored(expansionBehavior.regex); + let index = text.search(regex); while (index > insertedText.length) { // If the original range contains multiple matching instances of the regex use the leftmost one - text = insertedText + originalRangeText.slice(index); - index = text.search(rightAnchored(expansionBehavior.regex)); + text = text.slice(0, index); + index = text.search(regex); } return index === -1 ? { start: rangeStart, - end: rangeEnd + displacement, + end: newRangeEnd, } : { start: rangeStart + index, - end, + end: newRangeEnd, }; } } else { const expansionBehavior = rangeInfo.expansionBehavior.end; + const newRangeStart = rangeStart; switch (expansionBehavior.type) { case "closed": return { - start, - end: start, + start: newRangeStart, + end: rangeEnd, }; case "open": - return { start, end }; + return { + start: newRangeStart, + end: rangeEnd + displacement, + }; case "regex": - const matches = insertedText.match( - leftAnchored(expansionBehavior.regex) - ); + let text = originalRangeText + insertedText; + const regex = leftAnchored(expansionBehavior.regex); + let matches = text.match(regex); + let matchLength = matches == null ? 0 : matches[0].length; + while (matchLength !== 0 && matchLength < originalRangeText.length) { + // If the original range contains multiple matching instances of the regex use the leftmost one + text = originalRangeText.slice(matchLength) + insertedText; + matches = text.match(regex); + matchLength = matches == null ? 0 : matchLength + matches[0].length; + } - return matches == null + return matchLength === 0 ? { - start, - end: start, + start: newRangeStart, + end: rangeEnd, } : { - start, - end: start + matches[0].length, + start: newRangeStart, + end: rangeStart + matchLength, }; } } From e73911ac2c4f48f55e557f5c1f097c6a70d10d0d Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 13 Oct 2021 15:14:14 +0100 Subject: [PATCH 09/48] Add get offsets for delete or replace --- src/util/updateRangeInfos.ts | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index 75cc5c107f..d00259b369 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -51,6 +51,10 @@ interface ChangeEventInfo { event: ExtendedTextDocumentContentChangeEvent; originalOffsets: RangeOffsets; finalOffsets: RangeOffsets; + + /** + * Indicates the difference between the final token length and the original token length + */ displacement: number; } @@ -239,6 +243,41 @@ function getOffsetsForNonEmptyRangeInsert( } } +function getOffsetsForDeleteOrReplace( + changeEventInfo: ChangeEventInfo, + rangeInfo: RangeInfo +): RangeOffsets { + const { + originalOffsets: { + start: changeOriginalStartOffset, + end: changeOriginalEndOffset, + }, + finalOffsets: { end: changeFinalEndOffset }, + displacement, + } = changeEventInfo; + const { + offsets: { start: rangeStart, end: rangeEnd }, + } = rangeInfo; + + invariant( + changeOriginalEndOffset > changeOriginalStartOffset, + () => "Change range expected to be nonempty" + ); + invariant( + changeOriginalEndOffset >= rangeStart && + changeOriginalStartOffset <= rangeEnd, + () => "Change range expected to intersect with selection range" + ); + + return { + start: Math.min(rangeStart, changeFinalEndOffset), + end: + changeOriginalStartOffset < rangeEnd + ? rangeEnd + displacement + : Math.min(rangeEnd, changeFinalEndOffset), + }; +} + export function updateRangeInfos( changeEvent: TextDocumentChangeEvent, rangeInfos: RangeInfo[], From 3af341938b0d62bb595cab717a41648f7b646603 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Mon, 18 Oct 2021 21:55:11 +0100 Subject: [PATCH 10/48] Fixes --- src/actions/Wrap.ts | 32 ++++++++---- src/typings/Types.ts | 1 + src/util/selectionUtils.ts | 10 ++-- src/util/updateRangeInfos.ts | 99 ++++++++++++++++-------------------- src/util/updateSelections.ts | 54 ++++++++++++-------- 5 files changed, 108 insertions(+), 88 deletions(-) diff --git a/src/actions/Wrap.ts b/src/actions/Wrap.ts index c932f340de..7f239d213d 100644 --- a/src/actions/Wrap.ts +++ b/src/actions/Wrap.ts @@ -4,13 +4,17 @@ import { Action, ActionPreferences, ActionReturnValue, + Edit, Graph, SelectionWithEditor, TypedSelection, } from "../typings/Types"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; import { decorationSleep } from "../util/editDisplayUtils"; -import { performEditsAndUpdateSelections } from "../util/updateSelections"; +import { + performEditsAndUpdateSelectionInfos, + performEditsAndUpdateSelections, +} from "../util/updateSelections"; import { selectionWithEditorFromPositions } from "../util/selectionUtils"; export default class Wrap implements Action { @@ -31,25 +35,31 @@ export default class Wrap implements Action { await runOnTargetsForEachEditor( targets, async (editor, targets) => { - const edits = targets.flatMap((target) => [ + const boundaries = targets.map((target) => ({ + start: new Selection( + target.selection.selection.start, + target.selection.selection.start + ), + end: new Selection( + target.selection.selection.end, + target.selection.selection.end + ), + })); + + const edits: Edit[] = boundaries.flatMap(({ start, end }) => [ { text: left, - range: new Selection( - target.selection.selection.start, - target.selection.selection.start - ), + range: start, }, { text: right, - range: new Selection( - target.selection.selection.end, - target.selection.selection.end - ), + range: end, + isReplace: true, }, ]); const [updatedOriginalSelections, updatedTargetsSelections] = - await performEditsAndUpdateSelections( + await performEditsAndUpdateSelectionInfos( editor, edits, [ diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 5548dc0d22..0cd3095427 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -362,4 +362,5 @@ export type SelectionExtractor = ( export interface Edit { range: vscode.Range; text: string; + isReplace?: boolean; } diff --git a/src/util/selectionUtils.ts b/src/util/selectionUtils.ts index 2086267b80..72ca5047ae 100644 --- a/src/util/selectionUtils.ts +++ b/src/util/selectionUtils.ts @@ -15,9 +15,13 @@ export function selectionFromPositions( end: Position ): Selection { // The built in isReversed is bugged on empty selection. don't use - return selection.active.isBefore(selection.anchor) - ? new Selection(end, start) - : new Selection(start, end); + return isForward(selection) + ? new Selection(start, end) + : new Selection(end, start); +} + +export function isForward(selection: Selection) { + return selection.active.isBefore(selection.anchor); } export function selectionWithEditorFromRange( diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index d00259b369..eb1347d5da 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -32,10 +32,12 @@ interface ExpansionBehavior { } export interface RangeInfo { - document: TextDocument; range: Range; - offsets: RangeOffsets; expansionBehavior: ExpansionBehavior; +} + +export interface FullRangeInfo extends RangeInfo { + offsets: RangeOffsets; text: string; } @@ -47,6 +49,11 @@ interface ExtendedTextDocumentContentChangeEvent isReplace?: boolean; } +export interface ExtendedTextDocumentChangeEvent + extends TextDocumentChangeEvent { + readonly contentChanges: ReadonlyArray; +} + interface ChangeEventInfo { event: ExtendedTextDocumentContentChangeEvent; originalOffsets: RangeOffsets; @@ -65,7 +72,7 @@ interface RangeOffsets { function getOffsetsForEmptyRangeInsert( changeEventInfo: ChangeEventInfo, - rangeInfo: RangeInfo + rangeInfo: FullRangeInfo ): RangeOffsets { const { event: { text, isReplace }, @@ -138,7 +145,7 @@ function getOffsetsForEmptyRangeInsert( function getOffsetsForNonEmptyRangeInsert( changeEventInfo: ChangeEventInfo, - rangeInfo: RangeInfo + rangeInfo: FullRangeInfo ): RangeOffsets { const { event: { text: insertedText, isReplace }, @@ -245,7 +252,7 @@ function getOffsetsForNonEmptyRangeInsert( function getOffsetsForDeleteOrReplace( changeEventInfo: ChangeEventInfo, - rangeInfo: RangeInfo + rangeInfo: FullRangeInfo ): RangeOffsets { const { originalOffsets: { @@ -279,8 +286,8 @@ function getOffsetsForDeleteOrReplace( } export function updateRangeInfos( - changeEvent: TextDocumentChangeEvent, - rangeInfos: RangeInfo[], + changeEvent: ExtendedTextDocumentChangeEvent, + rangeInfos: FullRangeInfo[], rangeBehavior: DecorationRangeBehavior = DecorationRangeBehavior.ClosedClosed ) { const { document, contentChanges } = changeEvent; @@ -298,58 +305,42 @@ export function updateRangeInfos( return; } - let newSelectionInfoStartOffset = computeNewOffset( - selectionInfo.startOffset, - changeStartOffset, - changeEndOffset, - changeDisplacement, - rangeBehavior === DecorationRangeBehavior.OpenClosed || - rangeBehavior === DecorationRangeBehavior.OpenOpen - ); + const originalOffsets = selectionInfo.offsets; + let newOffsets: RangeOffsets; - const newSelectionInfoEndOffset = computeNewOffset( - selectionInfo.endOffset, - changeStartOffset, - changeEndOffset, - changeDisplacement, - rangeBehavior === DecorationRangeBehavior.OpenClosed || - rangeBehavior === DecorationRangeBehavior.ClosedClosed - ); + if (changeOriginalEndOffset < originalOffsets.start) { + return; + } - // Handle the case where we're ClosedClosed and change intersects both - // start and end - newSelectionInfoStartOffset = Math.min( - newSelectionInfoStartOffset, - newSelectionInfoEndOffset - ); + if (changeOriginalStartOffset > originalOffsets.end) { + newOffsets = { + start: originalOffsets.start, + end: originalOffsets.end + changeDisplacement, + }; + } else { + const changeEventInfo: ChangeEventInfo = { + displacement: changeDisplacement, + event: "whatever", + }; + + if (change.rangeLength === 0) { + if (selectionInfo.range.isEmpty) { + newOffsets = getOffsetsForEmptyRangeInsert(change); + } else { + newOffsets = getOffsetsForNonEmptyRangeInsert(change); + } + } else { + newOffsets = getOffsetsForDeleteOrReplace(change); + } + + // TODO: Update text if necessary + } selectionInfo.range = selectionInfo.range.with( - document.positionAt(newSelectionInfoStartOffset), - document.positionAt(newSelectionInfoEndOffset) + document.positionAt(newOffsets.start), + document.positionAt(newOffsets.end) ); - selectionInfo.startOffset = newSelectionInfoStartOffset; - selectionInfo.endOffset = newSelectionInfoEndOffset; + selectionInfo.offsets = newOffsets; }); }); } - -function computeNewOffset( - originalOffset: number, - changeStartOffset: number, - changeEndOffset: number, - changeDisplacement: number, - moveLeftOnConflict: boolean -) { - if (changeEndOffset < originalOffset) { - return originalOffset + changeDisplacement; - } - - if (changeStartOffset > originalOffset) { - return originalOffset; - } - - // todo handle fancy case with regex - return moveLeftOnConflict - ? changeStartOffset - : changeEndOffset + changeDisplacement; -} diff --git a/src/util/updateSelections.ts b/src/util/updateSelections.ts index c6d55dd6fe..0fdeb1fba1 100644 --- a/src/util/updateSelections.ts +++ b/src/util/updateSelections.ts @@ -12,12 +12,14 @@ import { performDocumentEdits } from "./performDocumentEdits"; import { Edit } from "../typings/Types"; import { flatten } from "lodash"; import { - RangeInfo, + ExtendedTextDocumentChangeEvent, + FullRangeInfo, updateRangeInfos, } from "./updateRangeInfos"; +import { isForward } from "./selectionUtils"; -export interface SelectionInfo extends RangeInfo { - range: Selection; +export interface SelectionInfo extends FullRangeInfo { + isForward: boolean; } function selectionsToSelectionInfos( @@ -26,24 +28,23 @@ function selectionsToSelectionInfos( ): SelectionInfo[][] { return selectionMatrix.map((selections) => selections.map((selection) => ({ - document, range: selection, - startOffset: document.offsetAt(selection.start), - endOffset: document.offsetAt(selection.end), + isForward: isForward(selection), + expansionBehavior: { start: { type: "closed" }, end: { type: "closed" } }, + offsets: { + start: document.offsetAt(selection.start), + end: document.offsetAt(selection.end), + }, + text: document.getText(selection), })) ); } function updateSelectionInfoMatrix( - changeEvent: TextDocumentChangeEvent, - selectionInfoMatrix: SelectionInfo[][], - rangeBehavior?: DecorationRangeBehavior + changeEvent: ExtendedTextDocumentChangeEvent, + selectionInfoMatrix: SelectionInfo[][] ) { - updateRangeInfos( - changeEvent, - flatten(selectionInfoMatrix), - rangeBehavior - ); + updateRangeInfos(changeEvent, flatten(selectionInfoMatrix)); } class SelectionUpdater { @@ -138,8 +139,7 @@ export async function callFunctionAndUpdateSelections( export async function performEditsAndUpdateSelections( editor: TextEditor, edits: Edit[], - originalSelections: Selection[][], - rangeBehavior?: DecorationRangeBehavior + originalSelections: Selection[][] ) { const document = editor.document; const selectionInfoMatrix = selectionsToSelectionInfos( @@ -147,11 +147,26 @@ export async function performEditsAndUpdateSelections( originalSelections ); - const contentChanges = edits.map(({ range, text }) => ({ + return performEditsAndUpdateSelectionInfos( + editor, + edits, + selectionInfoMatrix + ); +} + +export async function performEditsAndUpdateSelectionInfos( + editor: TextEditor, + edits: Edit[], + originalSelectionInfos: SelectionInfo[][] +) { + const document = editor.document; + + const contentChanges = edits.map(({ range, text, isReplace }) => ({ range, text, rangeOffset: document.offsetAt(range.start), rangeLength: document.offsetAt(range.end) - document.offsetAt(range.start), + isReplace, })); // Replace \n with \r\n. Vscode does this internally and it's @@ -170,9 +185,8 @@ export async function performEditsAndUpdateSelections( updateSelectionInfoMatrix( { document, contentChanges }, - selectionInfoMatrix, - rangeBehavior + originalSelectionInfos ); - return selectionInfosToSelections(document, selectionInfoMatrix); + return selectionInfosToSelections(document, originalSelectionInfos); } From e25f7c99ac47c5166fca73f6cdbc8c37f8a7c5a2 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 28 Oct 2021 15:02:54 +0100 Subject: [PATCH 11/48] Initial running version --- src/actions/BringMoveSwap.ts | 24 +++++-- src/actions/Wrap.ts | 82 +++++++++++++----------- src/util/updateRangeInfos.ts | 87 ++++++++++++++++++------- src/util/updateSelections.ts | 119 ++++++++++++++++++++++++++++------- 4 files changed, 228 insertions(+), 84 deletions(-) diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index 86296af0ab..60c328bbc9 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -12,7 +12,11 @@ import displayPendingEditDecorations from "../util/editDisplayUtils"; import { performOutsideAdjustment } from "../util/performInsideOutsideAdjustment"; import { flatten, zip } from "lodash"; import { Selection, TextEditor, Range, DecorationRangeBehavior } from "vscode"; -import { performEditsAndUpdateSelections } from "../util/updateSelections"; +import { + getSelectionInfo, + performEditsAndUpdateFullSelectionInfos, + performEditsAndUpdateSelections, +} from "../util/updateSelections"; import { getTextWithPossibleDelimiter } from "../util/getTextWithPossibleDelimiter"; type ActionType = "bring" | "move" | "swap"; @@ -154,12 +158,24 @@ class BringMoveSwap implements Action { ? edits : edits.filter(({ isSource }) => !isSource); + const selectionInfos = edits.map( + ({ + originalSelection: { + selection: { selection }, + }, + }) => + getSelectionInfo( + editor.document, + selection, + DecorationRangeBehavior.OpenOpen + ) + ); + const [updatedSelections]: Selection[][] = - await performEditsAndUpdateSelections( + await performEditsAndUpdateFullSelectionInfos( editor, filteredEdits, - [edits.map((edit) => edit.originalSelection.selection.selection)], - DecorationRangeBehavior.OpenOpen + [selectionInfos] ); return edits.map((edit, index) => { diff --git a/src/actions/Wrap.ts b/src/actions/Wrap.ts index 7f239d213d..c1dbd35401 100644 --- a/src/actions/Wrap.ts +++ b/src/actions/Wrap.ts @@ -12,10 +12,11 @@ import { import { runOnTargetsForEachEditor } from "../util/targetUtils"; import { decorationSleep } from "../util/editDisplayUtils"; import { + FullSelectionInfo, + getSelectionInfo, + performEditsAndUpdateFullSelectionInfos, performEditsAndUpdateSelectionInfos, - performEditsAndUpdateSelections, } from "../util/updateSelections"; -import { selectionWithEditorFromPositions } from "../util/selectionUtils"; export default class Wrap implements Action { getTargetPreferences: () => ActionPreferences[] = () => [ @@ -35,6 +36,7 @@ export default class Wrap implements Action { await runOnTargetsForEachEditor( targets, async (editor, targets) => { + const { document } = editor; const boundaries = targets.map((target) => ({ start: new Selection( target.selection.selection.start, @@ -58,49 +60,59 @@ export default class Wrap implements Action { }, ]); - const [updatedOriginalSelections, updatedTargetsSelections] = - await performEditsAndUpdateSelectionInfos( - editor, - edits, - [ - editor.selections, - targets.map((target) => target.selection.selection), - ], - DecorationRangeBehavior.ClosedClosed - ); + const delimiterSelectionInfos: FullSelectionInfo[] = + boundaries.flatMap(({ start, end }) => { + return [ + getSelectionInfo( + document, + start, + DecorationRangeBehavior.OpenClosed + ), + getSelectionInfo( + document, + end, + DecorationRangeBehavior.ClosedOpen + ), + ]; + }); - editor.selections = updatedOriginalSelections; + const cursorSelectionInfos = editor.selections.map((selection) => + getSelectionInfo( + document, + selection, + DecorationRangeBehavior.ClosedClosed + ) + ); - const updatedSelections = updatedTargetsSelections.flatMap( - ({ start, end }) => [ - new Selection( - start.translate({ characterDelta: -left.length }), - start - ), - new Selection( - end, - end.translate({ characterDelta: right.length }) - ), - ] + const thatMarkSelectionInfos = targets.map( + ({ selection: { selection } }) => + getSelectionInfo( + document, + selection, + DecorationRangeBehavior.OpenOpen + ) ); + const [delimiterSelections, cursorSelections, thatMarkSelections] = + await performEditsAndUpdateFullSelectionInfos(editor, edits, [ + delimiterSelectionInfos, + cursorSelectionInfos, + thatMarkSelectionInfos, + ]); + + editor.selections = cursorSelections; + editor.setDecorations( this.graph.editStyles.justAdded.token, - updatedSelections + delimiterSelections ); await decorationSleep(); - editor.setDecorations(this.graph.editStyles.justAdded.token, []); - return targets.map((target, index) => { - const start = updatedSelections[index * 2].start; - const end = updatedSelections[index * 2 + 1].end; - return selectionWithEditorFromPositions( - target.selection, - start, - end - ); - }); + return thatMarkSelections.map((selection) => ({ + editor, + selection, + })); } ) ); diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts index eb1347d5da..52f015a8c0 100644 --- a/src/util/updateRangeInfos.ts +++ b/src/util/updateRangeInfos.ts @@ -80,7 +80,7 @@ function getOffsetsForEmptyRangeInsert( } = changeEventInfo; invariant( - start === end && + start === changeEventInfo.originalOffsets.end && start === rangeInfo.offsets.start && start === rangeInfo.offsets.end, () => "Selection range and change range expected to be same empty range" @@ -287,8 +287,7 @@ function getOffsetsForDeleteOrReplace( export function updateRangeInfos( changeEvent: ExtendedTextDocumentChangeEvent, - rangeInfos: FullRangeInfo[], - rangeBehavior: DecorationRangeBehavior = DecorationRangeBehavior.ClosedClosed + rangeInfos: FullRangeInfo[] ) { const { document, contentChanges } = changeEvent; @@ -300,12 +299,21 @@ export function updateRangeInfos( const changeFinalStartOffset = changeOriginalStartOffset; const changeFinalEndOffset = changeOriginalEndOffset + changeDisplacement; - rangeInfos.forEach((selectionInfo) => { - if (selectionInfo.document !== document) { - return; - } - - const originalOffsets = selectionInfo.offsets; + const changeEventInfo: ChangeEventInfo = { + displacement: changeDisplacement, + event: change, + originalOffsets: { + start: changeOriginalStartOffset, + end: changeOriginalEndOffset, + }, + finalOffsets: { + start: changeFinalStartOffset, + end: changeFinalEndOffset, + }, + }; + + rangeInfos.forEach((rangeInfo) => { + const originalOffsets = rangeInfo.offsets; let newOffsets: RangeOffsets; if (changeOriginalEndOffset < originalOffsets.start) { @@ -318,29 +326,66 @@ export function updateRangeInfos( end: originalOffsets.end + changeDisplacement, }; } else { - const changeEventInfo: ChangeEventInfo = { - displacement: changeDisplacement, - event: "whatever", - }; - if (change.rangeLength === 0) { - if (selectionInfo.range.isEmpty) { - newOffsets = getOffsetsForEmptyRangeInsert(change); + if (rangeInfo.range.isEmpty) { + newOffsets = getOffsetsForEmptyRangeInsert( + changeEventInfo, + rangeInfo + ); } else { - newOffsets = getOffsetsForNonEmptyRangeInsert(change); + newOffsets = getOffsetsForNonEmptyRangeInsert( + changeEventInfo, + rangeInfo + ); } } else { - newOffsets = getOffsetsForDeleteOrReplace(change); + newOffsets = getOffsetsForDeleteOrReplace(changeEventInfo, rangeInfo); } - // TODO: Update text if necessary + rangeInfo.text = getUpdatedText(changeEventInfo, rangeInfo, newOffsets); } - selectionInfo.range = selectionInfo.range.with( + rangeInfo.range = rangeInfo.range.with( document.positionAt(newOffsets.start), document.positionAt(newOffsets.end) ); - selectionInfo.offsets = newOffsets; + rangeInfo.offsets = newOffsets; }); }); } +function getUpdatedText( + changeEventInfo: ChangeEventInfo, + rangeInfo: FullRangeInfo, + newOffsets: RangeOffsets +): string { + const { start: changeOriginalOffsetsStart, end: changeOriginalOffsetsEnd } = + changeEventInfo.originalOffsets; + const { start: rangeOriginalOffsetsStart, end: rangeOriginalOffsetsEnd } = + rangeInfo.offsets; + const newTextStartOffset = Math.min( + changeOriginalOffsetsStart, + rangeOriginalOffsetsStart + ); + + let result = ""; + + if (rangeOriginalOffsetsStart < changeOriginalOffsetsStart) { + result += rangeInfo.text.substring( + changeOriginalOffsetsStart - rangeOriginalOffsetsStart + ); + } + + result += changeEventInfo.event.text; + + if (changeOriginalOffsetsEnd < rangeOriginalOffsetsEnd) { + result += rangeInfo.text.substring( + rangeOriginalOffsetsEnd - changeOriginalOffsetsEnd, + rangeInfo.text.length + ); + } + + return result.substring( + newOffsets.start - newTextStartOffset, + newOffsets.end - newTextStartOffset + ); +} diff --git a/src/util/updateSelections.ts b/src/util/updateSelections.ts index 0fdeb1fba1..61d0e7fd05 100644 --- a/src/util/updateSelections.ts +++ b/src/util/updateSelections.ts @@ -14,42 +14,103 @@ import { flatten } from "lodash"; import { ExtendedTextDocumentChangeEvent, FullRangeInfo, + RangeInfo, updateRangeInfos, } from "./updateRangeInfos"; import { isForward } from "./selectionUtils"; -export interface SelectionInfo extends FullRangeInfo { +export interface SelectionInfo extends RangeInfo { isForward: boolean; } +export interface FullSelectionInfo extends FullRangeInfo, SelectionInfo {} + +export function getSelectionInfo( + document: TextDocument, + selection: Selection, + rangeBehavior: DecorationRangeBehavior +): FullSelectionInfo { + return { + range: selection, + isForward: isForward(selection), + expansionBehavior: { + start: { + type: + rangeBehavior === DecorationRangeBehavior.ClosedClosed || + rangeBehavior === DecorationRangeBehavior.ClosedOpen + ? "closed" + : "open", + }, + end: { + type: + rangeBehavior === DecorationRangeBehavior.ClosedClosed || + rangeBehavior === DecorationRangeBehavior.OpenClosed + ? "closed" + : "open", + }, + }, + offsets: { + start: document.offsetAt(selection.start), + end: document.offsetAt(selection.end), + }, + text: document.getText(selection), + }; +} + function selectionsToSelectionInfos( document: TextDocument, selectionMatrix: Selection[][] -): SelectionInfo[][] { +): FullSelectionInfo[][] { return selectionMatrix.map((selections) => - selections.map((selection) => ({ - range: selection, - isForward: isForward(selection), - expansionBehavior: { start: { type: "closed" }, end: { type: "closed" } }, - offsets: { - start: document.offsetAt(selection.start), - end: document.offsetAt(selection.end), - }, - text: document.getText(selection), - })) + selections.map((selection) => + getSelectionInfo( + document, + selection, + DecorationRangeBehavior.ClosedClosed + ) + ) + ); +} + +function fillOutSelectionInfos( + document: TextDocument, + selectionInfoMatrix: SelectionInfo[][] +): selectionInfoMatrix is FullSelectionInfo[][] { + selectionInfoMatrix.forEach((selectionInfos) => + selectionInfos.map((selectionInfo) => { + const { range } = selectionInfo; + Object.assign(selectionInfo, { + offsets: { + start: document.offsetAt(range.start), + end: document.offsetAt(range.end), + }, + text: document.getText(range), + }); + }) + ); + return true; +} + +function selectionInfosToSelections( + selectionInfoMatrix: SelectionInfo[][] +): Selection[][] { + return selectionInfoMatrix.map((selectionInfos) => + selectionInfos.map(({ range: { start, end }, isForward }) => + isForward ? new Selection(start, end) : new Selection(end, start) + ) ); } function updateSelectionInfoMatrix( changeEvent: ExtendedTextDocumentChangeEvent, - selectionInfoMatrix: SelectionInfo[][] + selectionInfoMatrix: FullSelectionInfo[][] ) { updateRangeInfos(changeEvent, flatten(selectionInfoMatrix)); } class SelectionUpdater { private document: TextDocument; - private selectionInfoMatrix: SelectionInfo[][]; + private selectionInfoMatrix: FullSelectionInfo[][]; private disposable!: Disposable; constructor( @@ -75,11 +136,7 @@ class SelectionUpdater { return; } - updateSelectionInfoMatrix( - event, - this.selectionInfoMatrix, - this.rangeBehavior - ); + updateSelectionInfoMatrix(event, this.selectionInfoMatrix); } ); } @@ -95,9 +152,7 @@ class SelectionUpdater { * @returns Original selections updated to take into account the given changes */ get updatedSelections() { - return this.selectionInfoMatrix.map((selectionInfos) => - selectionInfos.map(({ range }) => range) - ); + return selectionInfosToSelections(this.selectionInfoMatrix); } } @@ -147,17 +202,33 @@ export async function performEditsAndUpdateSelections( originalSelections ); - return performEditsAndUpdateSelectionInfos( + await performEditsAndUpdateFullSelectionInfos( editor, edits, selectionInfoMatrix ); + + return selectionInfosToSelections(selectionInfoMatrix); } export async function performEditsAndUpdateSelectionInfos( editor: TextEditor, edits: Edit[], originalSelectionInfos: SelectionInfo[][] +) { + fillOutSelectionInfos(editor.document, originalSelectionInfos); + + return await performEditsAndUpdateFullSelectionInfos( + editor, + edits, + originalSelectionInfos as FullSelectionInfo[][] + ); +} + +export async function performEditsAndUpdateFullSelectionInfos( + editor: TextEditor, + edits: Edit[], + originalSelectionInfos: FullSelectionInfo[][] ) { const document = editor.document; @@ -188,5 +259,5 @@ export async function performEditsAndUpdateSelectionInfos( originalSelectionInfos ); - return selectionInfosToSelections(document, originalSelectionInfos); + return selectionInfosToSelections(originalSelectionInfos); } From d3e12da40e2e1208ade19937584f62fcd57ae5f1 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 28 Oct 2021 17:00:43 +0100 Subject: [PATCH 12/48] Big refactor --- src/actions/BringMoveSwap.ts | 7 +- src/actions/CommandAction.ts | 3 +- src/actions/CopyLines.ts | 2 +- src/actions/Delete.ts | 2 +- src/actions/InsertEmptyLines.ts | 2 +- src/actions/Replace.ts | 2 +- src/actions/Wrap.ts | 3 +- .../getOffsetsForDeleteOrReplace.ts | 41 ++ .../getOffsetsForEmptyRangeInsert.ts | 80 ++++ .../getOffsetsForNonEmptyRangeInsert.ts | 114 +++++ src/core/updateSelections/getUpdatedText.ts | 42 ++ src/core/updateSelections/updateRangeInfos.ts | 95 +++++ .../updateSelections}/updateSelections.ts | 10 +- src/processTargets/index.ts | 5 +- src/typings/updateSelections.ts | 62 +++ src/util/selectionUtils.ts | 2 +- src/util/updateRangeInfos.ts | 391 ------------------ 17 files changed, 451 insertions(+), 412 deletions(-) create mode 100644 src/core/updateSelections/getOffsetsForDeleteOrReplace.ts create mode 100644 src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts create mode 100644 src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts create mode 100644 src/core/updateSelections/getUpdatedText.ts create mode 100644 src/core/updateSelections/updateRangeInfos.ts rename src/{util => core/updateSelections}/updateSelections.ts (96%) create mode 100644 src/typings/updateSelections.ts delete mode 100644 src/util/updateRangeInfos.ts diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index 60c328bbc9..1b3eeed1aa 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -12,12 +12,9 @@ import displayPendingEditDecorations from "../util/editDisplayUtils"; import { performOutsideAdjustment } from "../util/performInsideOutsideAdjustment"; import { flatten, zip } from "lodash"; import { Selection, TextEditor, Range, DecorationRangeBehavior } from "vscode"; -import { - getSelectionInfo, - performEditsAndUpdateFullSelectionInfos, - performEditsAndUpdateSelections, -} from "../util/updateSelections"; + import { getTextWithPossibleDelimiter } from "../util/getTextWithPossibleDelimiter"; +import { getSelectionInfo, performEditsAndUpdateFullSelectionInfos } from "../core/updateSelections/updateSelections"; type ActionType = "bring" | "move" | "swap"; diff --git a/src/actions/CommandAction.ts b/src/actions/CommandAction.ts index 42aa2ca2e3..550f627ec1 100644 --- a/src/actions/CommandAction.ts +++ b/src/actions/CommandAction.ts @@ -14,8 +14,9 @@ import { setSelectionsAndFocusEditor, } from "../util/setSelectionsAndFocusEditor"; import { flatten } from "lodash"; -import { callFunctionAndUpdateSelections } from "../util/updateSelections"; + import { ensureSingleEditor } from "../util/targetUtils"; +import { callFunctionAndUpdateSelections } from "../core/updateSelections/updateSelections"; export default class CommandAction implements Action { getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }]; diff --git a/src/actions/CopyLines.ts b/src/actions/CopyLines.ts index 82d39e9cb8..26f40757a1 100644 --- a/src/actions/CopyLines.ts +++ b/src/actions/CopyLines.ts @@ -6,12 +6,12 @@ import { TypedSelection, } from "../typings/Types"; import { Range, Selection, TextEditor } from "vscode"; -import { performEditsAndUpdateSelections } from "../util/updateSelections"; import { displayPendingEditDecorationsForSelection } from "../util/editDisplayUtils"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; import { flatten } from "lodash"; import unifyRanges from "../util/unifyRanges"; import expandToContainingLine from "../util/expandToContainingLine"; +import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; class CopyLines implements Action { getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }]; diff --git a/src/actions/Delete.ts b/src/actions/Delete.ts index cd02f2b61e..1a4832b35d 100644 --- a/src/actions/Delete.ts +++ b/src/actions/Delete.ts @@ -8,7 +8,7 @@ import { import { runOnTargetsForEachEditor } from "../util/targetUtils"; import displayPendingEditDecorations from "../util/editDisplayUtils"; import { flatten } from "lodash"; -import { performEditsAndUpdateSelections } from "../util/updateSelections"; +import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; export default class Delete implements Action { getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "outside" }]; diff --git a/src/actions/InsertEmptyLines.ts b/src/actions/InsertEmptyLines.ts index 248088edba..6d68a9a74c 100644 --- a/src/actions/InsertEmptyLines.ts +++ b/src/actions/InsertEmptyLines.ts @@ -8,8 +8,8 @@ import { import { Selection, Range } from "vscode"; import { displayPendingEditDecorationsForSelection } from "../util/editDisplayUtils"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; -import { performEditsAndUpdateSelections } from "../util/updateSelections"; import { flatten } from "lodash"; +import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; class InsertEmptyLines implements Action { getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }]; diff --git a/src/actions/Replace.ts b/src/actions/Replace.ts index 95a3490cb5..40a0c7193c 100644 --- a/src/actions/Replace.ts +++ b/src/actions/Replace.ts @@ -9,7 +9,7 @@ import displayPendingEditDecorations from "../util/editDisplayUtils"; import { runForEachEditor } from "../util/targetUtils"; import { flatten, zip } from "lodash"; import { maybeAddDelimiter } from "../util/getTextWithPossibleDelimiter"; -import { performEditsAndUpdateSelections } from "../util/updateSelections"; +import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; type RangeGenerator = { start: number }; diff --git a/src/actions/Wrap.ts b/src/actions/Wrap.ts index c1dbd35401..068926baec 100644 --- a/src/actions/Wrap.ts +++ b/src/actions/Wrap.ts @@ -15,8 +15,7 @@ import { FullSelectionInfo, getSelectionInfo, performEditsAndUpdateFullSelectionInfos, - performEditsAndUpdateSelectionInfos, -} from "../util/updateSelections"; +} from "../core/updateSelections/updateSelections"; export default class Wrap implements Action { getTargetPreferences: () => ActionPreferences[] = () => [ diff --git a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts new file mode 100644 index 0000000000..d73af02d75 --- /dev/null +++ b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -0,0 +1,41 @@ +import { invariant } from "immutability-helper"; +import { + ChangeEventInfo, + FullRangeInfo, + RangeOffsets, +} from "../../typings/updateSelections"; + +export function getOffsetsForDeleteOrReplace( + changeEventInfo: ChangeEventInfo, + rangeInfo: FullRangeInfo +): RangeOffsets { + const { + originalOffsets: { + start: changeOriginalStartOffset, + end: changeOriginalEndOffset, + }, + finalOffsets: { end: changeFinalEndOffset }, + displacement, + } = changeEventInfo; + const { + offsets: { start: rangeStart, end: rangeEnd }, + } = rangeInfo; + + invariant( + changeOriginalEndOffset > changeOriginalStartOffset, + () => "Change range expected to be nonempty" + ); + invariant( + changeOriginalEndOffset >= rangeStart && + changeOriginalStartOffset <= rangeEnd, + () => "Change range expected to intersect with selection range" + ); + + return { + start: Math.min(rangeStart, changeFinalEndOffset), + end: + changeOriginalStartOffset < rangeEnd + ? rangeEnd + displacement + : Math.min(rangeEnd, changeFinalEndOffset), + }; +} diff --git a/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts b/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts new file mode 100644 index 0000000000..4f581179db --- /dev/null +++ b/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts @@ -0,0 +1,80 @@ +import { invariant } from "immutability-helper"; +import { leftAnchored, rightAnchored } from "../../util/regex"; +import { + ChangeEventInfo, + FullRangeInfo, + RangeOffsets, +} from "../../typings/updateSelections"; + +export function getOffsetsForEmptyRangeInsert( + changeEventInfo: ChangeEventInfo, + rangeInfo: FullRangeInfo +): RangeOffsets { + const { + event: { text, isReplace }, + finalOffsets: { start, end }, + } = changeEventInfo; + + invariant( + start === changeEventInfo.originalOffsets.end && + start === rangeInfo.offsets.start && + start === rangeInfo.offsets.end, + () => "Selection range and change range expected to be same empty range" + ); + + if (isReplace) { + // In this case the cursor stays to the left so we care about the start of the range + const expansionBehavior = rangeInfo.expansionBehavior.start; + + switch (expansionBehavior.type) { + case "closed": + return { + start: end, + end, + }; + + case "open": + return { start, end }; + + case "regex": + const index = text.search(rightAnchored(expansionBehavior.regex)); + + return index === -1 + ? { + start: end, + end, + } + : { + start: start + index, + end, + }; + } + } else { + // In this case the cursor moves to the right so we care about the end of the range + const expansionBehavior = rangeInfo.expansionBehavior.end; + + switch (expansionBehavior.type) { + case "closed": + return { + start, + end: start, + }; + + case "open": + return { start, end }; + + case "regex": + const matches = text.match(leftAnchored(expansionBehavior.regex)); + + return matches == null + ? { + start, + end: start, + } + : { + start, + end: start + matches[0].length, + }; + } + } +} diff --git a/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts b/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts new file mode 100644 index 0000000000..8370e192b0 --- /dev/null +++ b/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts @@ -0,0 +1,114 @@ +import { invariant } from "immutability-helper"; +import { leftAnchored, rightAnchored } from "../../util/regex"; +import { + ChangeEventInfo, + FullRangeInfo, + RangeOffsets, +} from "../../typings/updateSelections"; + +export function getOffsetsForNonEmptyRangeInsert( + changeEventInfo: ChangeEventInfo, + rangeInfo: FullRangeInfo +): RangeOffsets { + const { + event: { text: insertedText, isReplace }, + originalOffsets: { start: insertOffset }, + displacement, + } = changeEventInfo; + const { + offsets: { start: rangeStart, end: rangeEnd }, + text: originalRangeText, + } = rangeInfo; + + invariant( + rangeEnd > rangeStart, + () => "Selection range expected to be nonempty" + ); + invariant( + insertOffset >= rangeStart && insertOffset <= rangeEnd, + () => "Insertion offset expected to intersect with selection range" + ); + + if (insertOffset > rangeStart && insertOffset < rangeEnd) { + // If containment is strict just move end of range to accommodate the internal change + return { start: rangeStart, end: rangeEnd + displacement }; + } + + if (insertOffset === rangeStart) { + const expansionBehavior = rangeInfo.expansionBehavior.start; + const newRangeEnd = rangeEnd + displacement; + + switch (expansionBehavior.type) { + case "closed": + return { + start: rangeStart + displacement, + end: newRangeEnd, + }; + + case "open": + return { + start: rangeStart, + end: newRangeEnd, + }; + + case "regex": + let text = insertedText + originalRangeText; + const regex = rightAnchored(expansionBehavior.regex); + let index = text.search(regex); + while (index > insertedText.length) { + // If the original range contains multiple matching instances of the regex use the leftmost one + text = text.slice(0, index); + index = text.search(regex); + } + + return index === -1 + ? { + start: rangeStart, + end: newRangeEnd, + } + : { + start: rangeStart + index, + end: newRangeEnd, + }; + } + } else { + const expansionBehavior = rangeInfo.expansionBehavior.end; + const newRangeStart = rangeStart; + + switch (expansionBehavior.type) { + case "closed": + return { + start: newRangeStart, + end: rangeEnd, + }; + + case "open": + return { + start: newRangeStart, + end: rangeEnd + displacement, + }; + + case "regex": + let text = originalRangeText + insertedText; + const regex = leftAnchored(expansionBehavior.regex); + let matches = text.match(regex); + let matchLength = matches == null ? 0 : matches[0].length; + while (matchLength !== 0 && matchLength < originalRangeText.length) { + // If the original range contains multiple matching instances of the regex use the leftmost one + text = originalRangeText.slice(matchLength) + insertedText; + matches = text.match(regex); + matchLength = matches == null ? 0 : matchLength + matches[0].length; + } + + return matchLength === 0 + ? { + start: newRangeStart, + end: rangeEnd, + } + : { + start: newRangeStart, + end: rangeStart + matchLength, + }; + } + } +} diff --git a/src/core/updateSelections/getUpdatedText.ts b/src/core/updateSelections/getUpdatedText.ts new file mode 100644 index 0000000000..98a0e6f9e4 --- /dev/null +++ b/src/core/updateSelections/getUpdatedText.ts @@ -0,0 +1,42 @@ +import { + ChangeEventInfo, + FullRangeInfo, + RangeOffsets, +} from "../../typings/updateSelections"; + +function getUpdatedText( + changeEventInfo: ChangeEventInfo, + rangeInfo: FullRangeInfo, + newOffsets: RangeOffsets +): string { + const { start: changeOriginalOffsetsStart, end: changeOriginalOffsetsEnd } = + changeEventInfo.originalOffsets; + const { start: rangeOriginalOffsetsStart, end: rangeOriginalOffsetsEnd } = + rangeInfo.offsets; + const newTextStartOffset = Math.min( + changeOriginalOffsetsStart, + rangeOriginalOffsetsStart + ); + + let result = ""; + + if (rangeOriginalOffsetsStart < changeOriginalOffsetsStart) { + result += rangeInfo.text.substring( + changeOriginalOffsetsStart - rangeOriginalOffsetsStart + ); + } + + result += changeEventInfo.event.text; + + if (changeOriginalOffsetsEnd < rangeOriginalOffsetsEnd) { + result += rangeInfo.text.substring( + rangeOriginalOffsetsEnd - changeOriginalOffsetsEnd, + rangeInfo.text.length + ); + } + + return result.substring( + newOffsets.start - newTextStartOffset, + newOffsets.end - newTextStartOffset + ); +} diff --git a/src/core/updateSelections/updateRangeInfos.ts b/src/core/updateSelections/updateRangeInfos.ts new file mode 100644 index 0000000000..44e01c7c96 --- /dev/null +++ b/src/core/updateSelections/updateRangeInfos.ts @@ -0,0 +1,95 @@ +import { sumBy } from "lodash"; +import { getOffsetsForDeleteOrReplace } from "./getOffsetsForDeleteOrReplace"; +import { getOffsetsForEmptyRangeInsert } from "./getOffsetsForEmptyRangeInsert"; +import { getOffsetsForNonEmptyRangeInsert } from "./getOffsetsForNonEmptyRangeInsert"; +import { + ExtendedTextDocumentChangeEvent, + FullRangeInfo, + ChangeEventInfo, + RangeOffsets, +} from "../../typings/updateSelections"; + +export function updateRangeInfos( + changeEvent: ExtendedTextDocumentChangeEvent, + rangeInfos: FullRangeInfo[] +) { + const { document, contentChanges } = changeEvent; + + const changeEventInfos: ChangeEventInfo[] = contentChanges.map((change) => { + const changeDisplacement = change.text.length - change.rangeLength; + const changeOriginalStartOffset = change.rangeOffset; + const changeOriginalEndOffset = + changeOriginalStartOffset + change.rangeLength; + const changeFinalStartOffset = changeOriginalStartOffset; + const changeFinalEndOffset = changeOriginalEndOffset + changeDisplacement; + return { + displacement: changeDisplacement, + event: change, + originalOffsets: { + start: changeOriginalStartOffset, + end: changeOriginalEndOffset, + }, + finalOffsets: { + start: changeFinalStartOffset, + end: changeFinalEndOffset, + }, + }; + }); + + rangeInfos.forEach((rangeInfo) => { + const originalOffsets = rangeInfo.offsets; + + const displacements = changeEventInfos.map((changeEventInfo) => { + let newOffsets: RangeOffsets; + + if (changeEventInfo.originalOffsets.start > originalOffsets.end) { + return { + start: 0, + end: 0, + }; + } + + if (changeEventInfo.originalOffsets.end < originalOffsets.start) { + return { + start: changeEventInfo.displacement, + end: changeEventInfo.displacement, + }; + } + + if (changeEventInfo.event.rangeLength === 0) { + if (rangeInfo.range.isEmpty) { + newOffsets = getOffsetsForEmptyRangeInsert( + changeEventInfo, + rangeInfo + ); + } else { + newOffsets = getOffsetsForNonEmptyRangeInsert( + changeEventInfo, + rangeInfo + ); + } + } else { + newOffsets = getOffsetsForDeleteOrReplace(changeEventInfo, rangeInfo); + } + + // NB: We don't update text for now because we're not entirely sure it's necessary + // rangeInfo.text = getUpdatedText(changeEventInfo, rangeInfo, newOffsets); + + return { + start: newOffsets.start - originalOffsets.start, + end: newOffsets.end - originalOffsets.end, + }; + }); + + const newOffsets = { + start: originalOffsets.start + sumBy(displacements, ({ start }) => start), + end: originalOffsets.end + sumBy(displacements, ({ end }) => end), + }; + + rangeInfo.range = rangeInfo.range.with( + document.positionAt(newOffsets.start), + document.positionAt(newOffsets.end) + ); + rangeInfo.offsets = newOffsets; + }); +} diff --git a/src/util/updateSelections.ts b/src/core/updateSelections/updateSelections.ts similarity index 96% rename from src/util/updateSelections.ts rename to src/core/updateSelections/updateSelections.ts index 61d0e7fd05..460e264b69 100644 --- a/src/util/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -8,16 +8,16 @@ import { EndOfLine, DecorationRangeBehavior, } from "vscode"; -import { performDocumentEdits } from "./performDocumentEdits"; -import { Edit } from "../typings/Types"; import { flatten } from "lodash"; +import { updateRangeInfos } from "./updateRangeInfos"; import { ExtendedTextDocumentChangeEvent, FullRangeInfo, RangeInfo, - updateRangeInfos, -} from "./updateRangeInfos"; -import { isForward } from "./selectionUtils"; +} from "../../typings/updateSelections"; +import { performDocumentEdits } from "../../util/performDocumentEdits"; +import { isForward } from "../../util/selectionUtils"; +import { Edit } from "../../typings/Types"; export interface SelectionInfo extends RangeInfo { isForward: boolean; diff --git a/src/processTargets/index.ts b/src/processTargets/index.ts index 7ec4db4a35..21aeaf4746 100644 --- a/src/processTargets/index.ts +++ b/src/processTargets/index.ts @@ -12,6 +12,7 @@ import processMark from "./processMark"; import processModifier from "./processModifier"; import processPosition from "./processPosition"; import processSelectionType from "./processSelectionType"; +import { isForward as getIsForward } from "../util/selectionUtils"; export default function ( context: ProcessedTargetsContext, @@ -77,9 +78,7 @@ function processRangeTarget( const anchorSelection = anchorTarget.selection.selection; const activeSelection = activeTarget.selection.selection; - const isForward = anchorSelection.start.isBeforeOrEqual( - activeSelection.start - ); + const isForward = getIsForward(anchorSelection); const anchor = targetToRangeLimitPosition( anchorTarget, diff --git a/src/typings/updateSelections.ts b/src/typings/updateSelections.ts new file mode 100644 index 0000000000..d7db050175 --- /dev/null +++ b/src/typings/updateSelections.ts @@ -0,0 +1,62 @@ +import { + Range, + TextDocumentChangeEvent, + TextDocumentContentChangeEvent, +} from "vscode"; + +export interface RangeOffsets { + start: number; + end: number; +} +type SingleEdgeExpansionBehavior = + | SimpleExpansionBehavior + | RegexExpansionBehavior; +interface SimpleExpansionBehavior { + type: "open" | "closed"; +} +interface RegexExpansionBehavior { + type: "regex"; + regex: RegExp; +} +interface ExpansionBehavior { + start: SingleEdgeExpansionBehavior; + end: SingleEdgeExpansionBehavior; +} + +export interface RangeInfo { + range: Range; + expansionBehavior: ExpansionBehavior; +} + +export interface FullRangeInfo extends RangeInfo { + offsets: RangeOffsets; + text: string; +} +interface ExtendedTextDocumentContentChangeEvent + extends TextDocumentContentChangeEvent { + /** + * If this is true then we should not shift an empty selection to the right + */ + isReplace?: boolean; +} + +export interface ExtendedTextDocumentChangeEvent + extends TextDocumentChangeEvent { + readonly contentChanges: ReadonlyArray; +} + +export interface ChangeEventInfo { + event: ExtendedTextDocumentContentChangeEvent; + originalOffsets: RangeOffsets; + finalOffsets: RangeOffsets; + + /** + * Indicates the difference between the final token length and the original token length + */ + displacement: number; +} + +export interface RangeOffsets { + start: number; + end: number; +} diff --git a/src/util/selectionUtils.ts b/src/util/selectionUtils.ts index 72ca5047ae..6ce7e891fb 100644 --- a/src/util/selectionUtils.ts +++ b/src/util/selectionUtils.ts @@ -21,7 +21,7 @@ export function selectionFromPositions( } export function isForward(selection: Selection) { - return selection.active.isBefore(selection.anchor); + return selection.active.isAfterOrEqual(selection.anchor); } export function selectionWithEditorFromRange( diff --git a/src/util/updateRangeInfos.ts b/src/util/updateRangeInfos.ts deleted file mode 100644 index 52f015a8c0..0000000000 --- a/src/util/updateRangeInfos.ts +++ /dev/null @@ -1,391 +0,0 @@ -import { invariant } from "immutability-helper"; -import { - DecorationRangeBehavior, - Range, - TextDocument, - TextDocumentChangeEvent, - TextDocumentContentChangeEvent, -} from "vscode"; -import { leftAnchored, rightAnchored } from "./regex"; - -interface RangeOffsets { - start: number; - end: number; -} - -type SingleEdgeExpansionBehavior = - | SimpleExpansionBehavior - | RegexExpansionBehavior; - -interface SimpleExpansionBehavior { - type: "open" | "closed"; -} - -interface RegexExpansionBehavior { - type: "regex"; - regex: RegExp; -} - -interface ExpansionBehavior { - start: SingleEdgeExpansionBehavior; - end: SingleEdgeExpansionBehavior; -} - -export interface RangeInfo { - range: Range; - expansionBehavior: ExpansionBehavior; -} - -export interface FullRangeInfo extends RangeInfo { - offsets: RangeOffsets; - text: string; -} - -interface ExtendedTextDocumentContentChangeEvent - extends TextDocumentContentChangeEvent { - /** - * If this is true then we should not shift an empty selection to the right - */ - isReplace?: boolean; -} - -export interface ExtendedTextDocumentChangeEvent - extends TextDocumentChangeEvent { - readonly contentChanges: ReadonlyArray; -} - -interface ChangeEventInfo { - event: ExtendedTextDocumentContentChangeEvent; - originalOffsets: RangeOffsets; - finalOffsets: RangeOffsets; - - /** - * Indicates the difference between the final token length and the original token length - */ - displacement: number; -} - -interface RangeOffsets { - start: number; - end: number; -} - -function getOffsetsForEmptyRangeInsert( - changeEventInfo: ChangeEventInfo, - rangeInfo: FullRangeInfo -): RangeOffsets { - const { - event: { text, isReplace }, - finalOffsets: { start, end }, - } = changeEventInfo; - - invariant( - start === changeEventInfo.originalOffsets.end && - start === rangeInfo.offsets.start && - start === rangeInfo.offsets.end, - () => "Selection range and change range expected to be same empty range" - ); - - if (isReplace) { - // In this case the cursor stays to the left so we care about the start of the range - const expansionBehavior = rangeInfo.expansionBehavior.start; - - switch (expansionBehavior.type) { - case "closed": - return { - start: end, - end, - }; - - case "open": - return { start, end }; - - case "regex": - const index = text.search(rightAnchored(expansionBehavior.regex)); - - return index === -1 - ? { - start: end, - end, - } - : { - start: start + index, - end, - }; - } - } else { - // In this case the cursor moves to the right so we care about the end of the range - const expansionBehavior = rangeInfo.expansionBehavior.end; - - switch (expansionBehavior.type) { - case "closed": - return { - start, - end: start, - }; - - case "open": - return { start, end }; - - case "regex": - const matches = text.match(leftAnchored(expansionBehavior.regex)); - - return matches == null - ? { - start, - end: start, - } - : { - start, - end: start + matches[0].length, - }; - } - } -} - -function getOffsetsForNonEmptyRangeInsert( - changeEventInfo: ChangeEventInfo, - rangeInfo: FullRangeInfo -): RangeOffsets { - const { - event: { text: insertedText, isReplace }, - originalOffsets: { start: insertOffset }, - displacement, - } = changeEventInfo; - const { - offsets: { start: rangeStart, end: rangeEnd }, - text: originalRangeText, - } = rangeInfo; - - invariant( - rangeEnd > rangeStart, - () => "Selection range expected to be nonempty" - ); - invariant( - insertOffset >= rangeStart && insertOffset <= rangeEnd, - () => "Insertion offset expected to intersect with selection range" - ); - - if (insertOffset > rangeStart && insertOffset < rangeEnd) { - // If containment is strict just move end of range to accommodate the internal change - return { start: rangeStart, end: rangeEnd + displacement }; - } - - if (insertOffset === rangeStart) { - const expansionBehavior = rangeInfo.expansionBehavior.start; - const newRangeEnd = rangeEnd + displacement; - - switch (expansionBehavior.type) { - case "closed": - return { - start: rangeStart + displacement, - end: newRangeEnd, - }; - - case "open": - return { - start: rangeStart, - end: newRangeEnd, - }; - - case "regex": - let text = insertedText + originalRangeText; - const regex = rightAnchored(expansionBehavior.regex); - let index = text.search(regex); - while (index > insertedText.length) { - // If the original range contains multiple matching instances of the regex use the leftmost one - text = text.slice(0, index); - index = text.search(regex); - } - - return index === -1 - ? { - start: rangeStart, - end: newRangeEnd, - } - : { - start: rangeStart + index, - end: newRangeEnd, - }; - } - } else { - const expansionBehavior = rangeInfo.expansionBehavior.end; - const newRangeStart = rangeStart; - - switch (expansionBehavior.type) { - case "closed": - return { - start: newRangeStart, - end: rangeEnd, - }; - - case "open": - return { - start: newRangeStart, - end: rangeEnd + displacement, - }; - - case "regex": - let text = originalRangeText + insertedText; - const regex = leftAnchored(expansionBehavior.regex); - let matches = text.match(regex); - let matchLength = matches == null ? 0 : matches[0].length; - while (matchLength !== 0 && matchLength < originalRangeText.length) { - // If the original range contains multiple matching instances of the regex use the leftmost one - text = originalRangeText.slice(matchLength) + insertedText; - matches = text.match(regex); - matchLength = matches == null ? 0 : matchLength + matches[0].length; - } - - return matchLength === 0 - ? { - start: newRangeStart, - end: rangeEnd, - } - : { - start: newRangeStart, - end: rangeStart + matchLength, - }; - } - } -} - -function getOffsetsForDeleteOrReplace( - changeEventInfo: ChangeEventInfo, - rangeInfo: FullRangeInfo -): RangeOffsets { - const { - originalOffsets: { - start: changeOriginalStartOffset, - end: changeOriginalEndOffset, - }, - finalOffsets: { end: changeFinalEndOffset }, - displacement, - } = changeEventInfo; - const { - offsets: { start: rangeStart, end: rangeEnd }, - } = rangeInfo; - - invariant( - changeOriginalEndOffset > changeOriginalStartOffset, - () => "Change range expected to be nonempty" - ); - invariant( - changeOriginalEndOffset >= rangeStart && - changeOriginalStartOffset <= rangeEnd, - () => "Change range expected to intersect with selection range" - ); - - return { - start: Math.min(rangeStart, changeFinalEndOffset), - end: - changeOriginalStartOffset < rangeEnd - ? rangeEnd + displacement - : Math.min(rangeEnd, changeFinalEndOffset), - }; -} - -export function updateRangeInfos( - changeEvent: ExtendedTextDocumentChangeEvent, - rangeInfos: FullRangeInfo[] -) { - const { document, contentChanges } = changeEvent; - - contentChanges.forEach((change) => { - const changeDisplacement = change.text.length - change.rangeLength; - const changeOriginalStartOffset = change.rangeOffset; - const changeOriginalEndOffset = - changeOriginalStartOffset + change.rangeLength; - const changeFinalStartOffset = changeOriginalStartOffset; - const changeFinalEndOffset = changeOriginalEndOffset + changeDisplacement; - - const changeEventInfo: ChangeEventInfo = { - displacement: changeDisplacement, - event: change, - originalOffsets: { - start: changeOriginalStartOffset, - end: changeOriginalEndOffset, - }, - finalOffsets: { - start: changeFinalStartOffset, - end: changeFinalEndOffset, - }, - }; - - rangeInfos.forEach((rangeInfo) => { - const originalOffsets = rangeInfo.offsets; - let newOffsets: RangeOffsets; - - if (changeOriginalEndOffset < originalOffsets.start) { - return; - } - - if (changeOriginalStartOffset > originalOffsets.end) { - newOffsets = { - start: originalOffsets.start, - end: originalOffsets.end + changeDisplacement, - }; - } else { - if (change.rangeLength === 0) { - if (rangeInfo.range.isEmpty) { - newOffsets = getOffsetsForEmptyRangeInsert( - changeEventInfo, - rangeInfo - ); - } else { - newOffsets = getOffsetsForNonEmptyRangeInsert( - changeEventInfo, - rangeInfo - ); - } - } else { - newOffsets = getOffsetsForDeleteOrReplace(changeEventInfo, rangeInfo); - } - - rangeInfo.text = getUpdatedText(changeEventInfo, rangeInfo, newOffsets); - } - - rangeInfo.range = rangeInfo.range.with( - document.positionAt(newOffsets.start), - document.positionAt(newOffsets.end) - ); - rangeInfo.offsets = newOffsets; - }); - }); -} -function getUpdatedText( - changeEventInfo: ChangeEventInfo, - rangeInfo: FullRangeInfo, - newOffsets: RangeOffsets -): string { - const { start: changeOriginalOffsetsStart, end: changeOriginalOffsetsEnd } = - changeEventInfo.originalOffsets; - const { start: rangeOriginalOffsetsStart, end: rangeOriginalOffsetsEnd } = - rangeInfo.offsets; - const newTextStartOffset = Math.min( - changeOriginalOffsetsStart, - rangeOriginalOffsetsStart - ); - - let result = ""; - - if (rangeOriginalOffsetsStart < changeOriginalOffsetsStart) { - result += rangeInfo.text.substring( - changeOriginalOffsetsStart - rangeOriginalOffsetsStart - ); - } - - result += changeEventInfo.event.text; - - if (changeOriginalOffsetsEnd < rangeOriginalOffsetsEnd) { - result += rangeInfo.text.substring( - rangeOriginalOffsetsEnd - changeOriginalOffsetsEnd, - rangeInfo.text.length - ); - } - - return result.substring( - newOffsets.start - newTextStartOffset, - newOffsets.end - newTextStartOffset - ); -} From 758af7e4a3a8cb53088dc3a73b5037fee6cd0773 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 28 Oct 2021 20:20:57 +0100 Subject: [PATCH 13/48] Move to graph-based approach --- src/core/updateSelections/SelectionUpdater.ts | 91 ++++++++++++++ src/core/updateSelections/updateSelections.ts | 116 +++++++----------- src/typings/updateSelections.ts | 13 +- src/util/map.ts | 10 ++ 4 files changed, 160 insertions(+), 70 deletions(-) create mode 100644 src/core/updateSelections/SelectionUpdater.ts create mode 100644 src/util/map.ts diff --git a/src/core/updateSelections/SelectionUpdater.ts b/src/core/updateSelections/SelectionUpdater.ts new file mode 100644 index 0000000000..9dd2ddce7d --- /dev/null +++ b/src/core/updateSelections/SelectionUpdater.ts @@ -0,0 +1,91 @@ +import { flatten, pull, pullAll, some } from "lodash"; +import { + workspace, + TextDocument, + TextDocumentChangeEvent, + Disposable, +} from "vscode"; +import { Edit } from "../../typings/Types"; +import { + ExtendedTextDocumentContentChangeEvent, + FullSelectionInfo, +} from "../../typings/updateSelections"; +import { getDefault } from "../../util/map"; +import { updateRangeInfos } from "./updateRangeInfos"; + +export class SelectionUpdater { + private selectionInfos: Map = new Map(); + private replaceEdits: Map = new Map(); + private disposable!: Disposable; + + constructor() { + this.listenForDocumentChanges(); + } + + private getDocumentSelectionInfoMatrix(document: TextDocument) { + return getDefault(this.selectionInfos, document, () => []); + } + + private getDocumentReplaceEditMatrix(document: TextDocument) { + return getDefault(this.replaceEdits, document, () => []); + } + + registerSelectionInfos( + document: TextDocument, + selectionInfoMatrix: FullSelectionInfo[][] + ): () => void { + const currentSelectionInfoMatrix = + this.getDocumentSelectionInfoMatrix(document); + + currentSelectionInfoMatrix.push(...selectionInfoMatrix); + + return () => pullAll(currentSelectionInfoMatrix, selectionInfoMatrix); + } + + registerReplaceEdits( + document: TextDocument, + replaceEdits: Edit[] + ): () => void { + const currentReplaceEditMatrix = + this.getDocumentReplaceEditMatrix(document); + + currentReplaceEditMatrix.push(replaceEdits); + + return () => pull(currentReplaceEditMatrix, replaceEdits); + } + + private listenForDocumentChanges() { + this.disposable = workspace.onDidChangeTextDocument( + (event: TextDocumentChangeEvent) => { + const documentReplaceEditMatrix = this.getDocumentReplaceEditMatrix( + event.document + ); + + const documentSelectionInfoMatrix = this.getDocumentSelectionInfoMatrix( + event.document + ); + + event.contentChanges.forEach((change) => { + if ( + some(documentReplaceEditMatrix, (replaceEditList) => + some( + replaceEditList, + (replaceEdit) => + replaceEdit.range.isEqual(change.range) && + replaceEdit.text === change.text + ) + ) + ) { + (change as ExtendedTextDocumentContentChangeEvent).isReplace = true; + } + }); + + updateRangeInfos(event, flatten(documentSelectionInfoMatrix)); + } + ); + } + + dispose() { + this.disposable.dispose(); + } +} diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index 460e264b69..73ebfaf44e 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -1,10 +1,7 @@ import { Selection, TextEditor, - workspace, TextDocument, - TextDocumentChangeEvent, - Disposable, EndOfLine, DecorationRangeBehavior, } from "vscode"; @@ -13,17 +10,14 @@ import { updateRangeInfos } from "./updateRangeInfos"; import { ExtendedTextDocumentChangeEvent, FullRangeInfo, + FullSelectionInfo, RangeInfo, + SelectionInfo, } from "../../typings/updateSelections"; import { performDocumentEdits } from "../../util/performDocumentEdits"; import { isForward } from "../../util/selectionUtils"; import { Edit } from "../../typings/Types"; - -export interface SelectionInfo extends RangeInfo { - isForward: boolean; -} - -export interface FullSelectionInfo extends FullRangeInfo, SelectionInfo {} +import { SelectionUpdater } from "./SelectionUpdater"; export function getSelectionInfo( document: TextDocument, @@ -57,7 +51,7 @@ export function getSelectionInfo( }; } -function selectionsToSelectionInfos( +export function selectionsToSelectionInfos( document: TextDocument, selectionMatrix: Selection[][] ): FullSelectionInfo[][] { @@ -91,7 +85,7 @@ function fillOutSelectionInfos( return true; } -function selectionInfosToSelections( +export function selectionInfosToSelections( selectionInfoMatrix: SelectionInfo[][] ): Selection[][] { return selectionInfoMatrix.map((selectionInfos) => @@ -101,61 +95,13 @@ function selectionInfosToSelections( ); } -function updateSelectionInfoMatrix( +export function updateSelectionInfoMatrix( changeEvent: ExtendedTextDocumentChangeEvent, selectionInfoMatrix: FullSelectionInfo[][] ) { updateRangeInfos(changeEvent, flatten(selectionInfoMatrix)); } -class SelectionUpdater { - private document: TextDocument; - private selectionInfoMatrix: FullSelectionInfo[][]; - private disposable!: Disposable; - - constructor( - editor: TextEditor, - originalSelections: Selection[][], - private rangeBehavior?: DecorationRangeBehavior - ) { - this.document = editor.document; - this.selectionInfoMatrix = selectionsToSelectionInfos( - this.document, - originalSelections - ); - this.listenForDocumentChanges(); - } - - private listenForDocumentChanges() { - this.disposable = workspace.onDidChangeTextDocument( - (event: TextDocumentChangeEvent) => { - if ( - event.document !== this.document || - event.contentChanges.length === 0 - ) { - return; - } - - updateSelectionInfoMatrix(event, this.selectionInfoMatrix); - } - ); - } - - dispose() { - this.disposable.dispose(); - } - - /** - * Call this function after applying the document edits to get the updated - * selection ranges. - * - * @returns Original selections updated to take into account the given changes - */ - get updatedSelections() { - return selectionInfosToSelections(this.selectionInfoMatrix); - } -} - /** * Calls the given function and updates the given selections based on the * changes that occurred as a result of calling function. @@ -165,22 +111,26 @@ class SelectionUpdater { * @returns The initial selections updated based upon what happened in the function */ export async function callFunctionAndUpdateSelections( + selectionUpdater: SelectionUpdater, func: () => Thenable, - editor: TextEditor, - selectionMatrix: Selection[][], - rangeBehavior?: DecorationRangeBehavior + document: TextDocument, + selectionMatrix: Selection[][] ): Promise { - const selectionUpdater = new SelectionUpdater( - editor, - selectionMatrix, - rangeBehavior + const selectionInfoMatrix = selectionsToSelectionInfos( + document, + selectionMatrix + ); + + const unsubscribe = selectionUpdater.registerSelectionInfos( + document, + selectionInfoMatrix ); await func(); - selectionUpdater.dispose(); + unsubscribe(); - return selectionUpdater.updatedSelections; + return selectionInfosToSelections(selectionInfoMatrix); } /** @@ -230,6 +180,34 @@ export async function performEditsAndUpdateFullSelectionInfos( edits: Edit[], originalSelectionInfos: FullSelectionInfo[][] ) { + // TODO: Do everything using VSCode listeners. We can associate changes with + // our changes just by looking at their offets / text in order to recover + // isReplace. We need to do this because VSCode does some fancy stuff, and + // returns the changes in a nice order + // So this function would prob mostly go away, and everything would basically + // just be a version of callFunctionAndUpdateSelections, or just call that + // directly + // Note that some additional weird edits like whitespace things can be + // created by VSCode I believe, and they change order, so we can't just zip + // their changes with ours. + // Their ordering basically is reverse document order, unless edits are at + // the same location, in which case they're in reverse order of the changes + // as you created them. + // See + // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/core/range.ts#L430-L440 + // and + // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts#L598-L604 + // See also + // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts#L464 + // - We should have a component on the graph called graph.selectionUpdater + // - It will support registering a list of selections to keep up-to-date, and + // it returns a dispose function. + // - It also has a function that allows callers to register isReplace edits, + // and it will look those up when it receives edits in order to set that + // field. + // - It should probably just store a list of lists of selectionInfos, and + // just remove the corresponding list when it gets deregistered + // - Should clients register one list at a time or a list of lists? const document = editor.document; const contentChanges = edits.map(({ range, text, isReplace }) => ({ diff --git a/src/typings/updateSelections.ts b/src/typings/updateSelections.ts index d7db050175..d5df1afebd 100644 --- a/src/typings/updateSelections.ts +++ b/src/typings/updateSelections.ts @@ -8,16 +8,20 @@ export interface RangeOffsets { start: number; end: number; } + type SingleEdgeExpansionBehavior = | SimpleExpansionBehavior | RegexExpansionBehavior; + interface SimpleExpansionBehavior { type: "open" | "closed"; } + interface RegexExpansionBehavior { type: "regex"; regex: RegExp; } + interface ExpansionBehavior { start: SingleEdgeExpansionBehavior; end: SingleEdgeExpansionBehavior; @@ -32,7 +36,8 @@ export interface FullRangeInfo extends RangeInfo { offsets: RangeOffsets; text: string; } -interface ExtendedTextDocumentContentChangeEvent + +export interface ExtendedTextDocumentContentChangeEvent extends TextDocumentContentChangeEvent { /** * If this is true then we should not shift an empty selection to the right @@ -60,3 +65,9 @@ export interface RangeOffsets { start: number; end: number; } + +export interface SelectionInfo extends RangeInfo { + isForward: boolean; +} + +export interface FullSelectionInfo extends FullRangeInfo, SelectionInfo {} diff --git a/src/util/map.ts b/src/util/map.ts new file mode 100644 index 0000000000..3deb17d836 --- /dev/null +++ b/src/util/map.ts @@ -0,0 +1,10 @@ +export function getDefault(map: Map, key: K, factory: () => V): V { + let currentValue = map.get(key); + + if (currentValue == null) { + currentValue = factory(); + map.set(key, currentValue); + } + + return currentValue; +} From a32e74b3a7c8567b56642d8aeb790fc4643de9f1 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 29 Oct 2021 13:28:41 +0100 Subject: [PATCH 14/48] Initial working version --- src/actions/BringMoveSwap.ts | 6 +- src/actions/CommandAction.ts | 7 +- src/actions/CopyLines.ts | 17 ++-- src/actions/Delete.ts | 5 +- src/actions/InsertEmptyLines.ts | 19 ++-- src/actions/Replace.ts | 5 +- src/actions/Wrap.ts | 17 ++-- src/actions/WrapWithSnippet.ts | 5 +- src/core/updateSelections/SelectionUpdater.ts | 78 +++++++++-------- .../getOffsetsForEmptyRangeInsert.ts | 40 ++++----- src/core/updateSelections/updateSelections.ts | 86 ++++++++++--------- src/extension.ts | 3 +- src/typings/Types.ts | 2 + src/util/graphFactories.ts | 2 + src/util/performDocumentEdits.ts | 18 +++- 15 files changed, 186 insertions(+), 124 deletions(-) diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index 1b3eeed1aa..5698f04b32 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -14,7 +14,10 @@ import { flatten, zip } from "lodash"; import { Selection, TextEditor, Range, DecorationRangeBehavior } from "vscode"; import { getTextWithPossibleDelimiter } from "../util/getTextWithPossibleDelimiter"; -import { getSelectionInfo, performEditsAndUpdateFullSelectionInfos } from "../core/updateSelections/updateSelections"; +import { + getSelectionInfo, + performEditsAndUpdateFullSelectionInfos, +} from "../core/updateSelections/updateSelections"; type ActionType = "bring" | "move" | "swap"; @@ -170,6 +173,7 @@ class BringMoveSwap implements Action { const [updatedSelections]: Selection[][] = await performEditsAndUpdateFullSelectionInfos( + this.graph.selectionUpdater, editor, filteredEdits, [selectionInfos] diff --git a/src/actions/CommandAction.ts b/src/actions/CommandAction.ts index 550f627ec1..1d5c3743ea 100644 --- a/src/actions/CommandAction.ts +++ b/src/actions/CommandAction.ts @@ -19,7 +19,9 @@ import { ensureSingleEditor } from "../util/targetUtils"; import { callFunctionAndUpdateSelections } from "../core/updateSelections/updateSelections"; export default class CommandAction implements Action { - getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }]; + getTargetPreferences: () => ActionPreferences[] = () => [ + { insideOutsideType: "inside" }, + ]; private ensureSingleEditor: boolean; constructor( @@ -47,8 +49,9 @@ export default class CommandAction implements Action { const [updatedOriginalSelections, updatedTargetSelections] = await callFunctionAndUpdateSelections( + this.graph.selectionUpdater, () => commands.executeCommand(this.command), - editor, + editor.document, [originalSelections, targetSelections] ); diff --git a/src/actions/CopyLines.ts b/src/actions/CopyLines.ts index 26f40757a1..64840d46cf 100644 --- a/src/actions/CopyLines.ts +++ b/src/actions/CopyLines.ts @@ -14,7 +14,9 @@ import expandToContainingLine from "../util/expandToContainingLine"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; class CopyLines implements Action { - getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }]; + getTargetPreferences: () => ActionPreferences[] = () => [ + { insideOutsideType: "inside" }, + ]; constructor(private graph: Graph, private isUp: boolean) { this.run = this.run.bind(this); @@ -63,10 +65,15 @@ class CopyLines implements Action { const edits = this.getEdits(editor, ranges); const [updatedSelections, copySelections] = - await performEditsAndUpdateSelections(editor, edits, [ - targets.map((target) => target.selection.selection), - ranges.map(({ range }) => new Selection(range.start, range.end)), - ]); + await performEditsAndUpdateSelections( + this.graph.selectionUpdater, + editor, + edits, + [ + targets.map((target) => target.selection.selection), + ranges.map(({ range }) => new Selection(range.start, range.end)), + ] + ); editor.revealRange(updatedSelections[0]); diff --git a/src/actions/Delete.ts b/src/actions/Delete.ts index 1a4832b35d..22f68a4592 100644 --- a/src/actions/Delete.ts +++ b/src/actions/Delete.ts @@ -11,7 +11,9 @@ import { flatten } from "lodash"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; export default class Delete implements Action { - getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "outside" }]; + getTargetPreferences: () => ActionPreferences[] = () => [ + { insideOutsideType: "outside" }, + ]; constructor(private graph: Graph) { this.run = this.run.bind(this); @@ -36,6 +38,7 @@ export default class Delete implements Action { })); const [updatedSelections] = await performEditsAndUpdateSelections( + this.graph.selectionUpdater, editor, edits, [targets.map((target) => target.selection.selection)] diff --git a/src/actions/InsertEmptyLines.ts b/src/actions/InsertEmptyLines.ts index 6d68a9a74c..0739dab243 100644 --- a/src/actions/InsertEmptyLines.ts +++ b/src/actions/InsertEmptyLines.ts @@ -12,7 +12,9 @@ import { flatten } from "lodash"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; class InsertEmptyLines implements Action { - getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: "inside" }]; + getTargetPreferences: () => ActionPreferences[] = () => [ + { insideOutsideType: "inside" }, + ]; constructor( private graph: Graph, @@ -53,11 +55,16 @@ class InsertEmptyLines implements Action { const edits = this.getEdits(ranges); const [updatedSelections, lineSelections, updatedOriginalSelections] = - await performEditsAndUpdateSelections(editor, edits, [ - targets.map((target) => target.selection.selection), - ranges.map((range) => new Selection(range.start, range.end)), - editor.selections, - ]); + await performEditsAndUpdateSelections( + this.graph.selectionUpdater, + editor, + edits, + [ + targets.map((target) => target.selection.selection), + ranges.map((range) => new Selection(range.start, range.end)), + editor.selections, + ] + ); editor.selections = updatedOriginalSelections; diff --git a/src/actions/Replace.ts b/src/actions/Replace.ts index 40a0c7193c..43587d43ec 100644 --- a/src/actions/Replace.ts +++ b/src/actions/Replace.ts @@ -14,7 +14,9 @@ import { performEditsAndUpdateSelections } from "../core/updateSelections/update type RangeGenerator = { start: number }; export default class implements Action { - getTargetPreferences: () => ActionPreferences[] = () => [{ insideOutsideType: null }]; + getTargetPreferences: () => ActionPreferences[] = () => [ + { insideOutsideType: null }, + ]; constructor(private graph: Graph) { this.run = this.run.bind(this); @@ -65,6 +67,7 @@ export default class implements Action { (edit) => edit.editor, async (editor, edits) => { const [updatedSelections] = await performEditsAndUpdateSelections( + this.graph.selectionUpdater, editor, edits, [targets.map((target) => target.selection.selection)] diff --git a/src/actions/Wrap.ts b/src/actions/Wrap.ts index 068926baec..8feeda2fd5 100644 --- a/src/actions/Wrap.ts +++ b/src/actions/Wrap.ts @@ -11,8 +11,8 @@ import { } from "../typings/Types"; import { runOnTargetsForEachEditor } from "../util/targetUtils"; import { decorationSleep } from "../util/editDisplayUtils"; +import { FullSelectionInfo } from "../typings/updateSelections"; import { - FullSelectionInfo, getSelectionInfo, performEditsAndUpdateFullSelectionInfos, } from "../core/updateSelections/updateSelections"; @@ -93,11 +93,16 @@ export default class Wrap implements Action { ); const [delimiterSelections, cursorSelections, thatMarkSelections] = - await performEditsAndUpdateFullSelectionInfos(editor, edits, [ - delimiterSelectionInfos, - cursorSelectionInfos, - thatMarkSelectionInfos, - ]); + await performEditsAndUpdateFullSelectionInfos( + this.graph.selectionUpdater, + editor, + edits, + [ + delimiterSelectionInfos, + cursorSelectionInfos, + thatMarkSelectionInfos, + ] + ); editor.selections = cursorSelections; diff --git a/src/actions/WrapWithSnippet.ts b/src/actions/WrapWithSnippet.ts index 91d366c12f..0737070554 100644 --- a/src/actions/WrapWithSnippet.ts +++ b/src/actions/WrapWithSnippet.ts @@ -1,4 +1,5 @@ import { commands } from "vscode"; +import { callFunctionAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { SnippetDefinition } from "../typings/snippet"; import { Action, @@ -9,7 +10,6 @@ import { } from "../typings/Types"; import displayPendingEditDecorations from "../util/editDisplayUtils"; import { ensureSingleEditor } from "../util/targetUtils"; -import { callFunctionAndUpdateSelections } from "../util/updateSelections"; import { Placeholder, SnippetParser, @@ -98,11 +98,12 @@ export default class WrapWithSnippet implements Action { // NB: We used the command "editor.action.insertSnippet" instead of calling editor.insertSnippet // because the latter doesn't support special variables like CLIPBOARD const [updatedTargetSelections] = await callFunctionAndUpdateSelections( + this.graph.selectionUpdater, () => commands.executeCommand("editor.action.insertSnippet", { snippet: snippetString, }), - editor, + editor.document, [targetSelections] ); diff --git a/src/core/updateSelections/SelectionUpdater.ts b/src/core/updateSelections/SelectionUpdater.ts index 9dd2ddce7d..e6350b842e 100644 --- a/src/core/updateSelections/SelectionUpdater.ts +++ b/src/core/updateSelections/SelectionUpdater.ts @@ -1,86 +1,90 @@ -import { flatten, pull, pullAll, some } from "lodash"; +import { pullAll, some } from "lodash"; import { workspace, TextDocument, TextDocumentChangeEvent, Disposable, + TextDocumentContentChangeEvent, } from "vscode"; -import { Edit } from "../../typings/Types"; +import { Edit, Graph } from "../../typings/Types"; import { - ExtendedTextDocumentContentChangeEvent, + ExtendedTextDocumentChangeEvent, FullSelectionInfo, } from "../../typings/updateSelections"; import { getDefault } from "../../util/map"; import { updateRangeInfos } from "./updateRangeInfos"; export class SelectionUpdater { - private selectionInfos: Map = new Map(); - private replaceEdits: Map = new Map(); + private selectionInfos: Map = new Map(); + private replaceEdits: Map = new Map(); private disposable!: Disposable; - constructor() { + constructor(graph: Graph) { this.listenForDocumentChanges(); } - private getDocumentSelectionInfoMatrix(document: TextDocument) { - return getDefault(this.selectionInfos, document, () => []); + private getDocumentSelectionInfos(document: TextDocument) { + return getDefault(this.selectionInfos, document.uri.toString(), () => []); } - private getDocumentReplaceEditMatrix(document: TextDocument) { - return getDefault(this.replaceEdits, document, () => []); + private getDocumentReplaceEdits(document: TextDocument) { + return getDefault(this.replaceEdits, document.uri.toString(), () => []); } registerSelectionInfos( document: TextDocument, - selectionInfoMatrix: FullSelectionInfo[][] + selectionInfos: FullSelectionInfo[] ): () => void { - const currentSelectionInfoMatrix = - this.getDocumentSelectionInfoMatrix(document); + const currentSelectionInfos = this.getDocumentSelectionInfos(document); - currentSelectionInfoMatrix.push(...selectionInfoMatrix); + currentSelectionInfos.push(...selectionInfos); - return () => pullAll(currentSelectionInfoMatrix, selectionInfoMatrix); + return () => pullAll(currentSelectionInfos, selectionInfos); } registerReplaceEdits( document: TextDocument, replaceEdits: Edit[] ): () => void { - const currentReplaceEditMatrix = - this.getDocumentReplaceEditMatrix(document); + const currentReplaceEdits = this.getDocumentReplaceEdits(document); - currentReplaceEditMatrix.push(replaceEdits); + currentReplaceEdits.push(...replaceEdits); - return () => pull(currentReplaceEditMatrix, replaceEdits); + return () => pullAll(currentReplaceEdits, replaceEdits); } private listenForDocumentChanges() { this.disposable = workspace.onDidChangeTextDocument( (event: TextDocumentChangeEvent) => { - const documentReplaceEditMatrix = this.getDocumentReplaceEditMatrix( + const documentReplaceEdits = this.getDocumentReplaceEdits( event.document ); - const documentSelectionInfoMatrix = this.getDocumentSelectionInfoMatrix( + const isReplace = (change: TextDocumentContentChangeEvent) => + some( + documentReplaceEdits, + (replaceEdit) => + replaceEdit.range.isEqual(change.range) && + replaceEdit.text === change.text + ); + + const documentSelectionInfos = this.getDocumentSelectionInfos( event.document ); - event.contentChanges.forEach((change) => { - if ( - some(documentReplaceEditMatrix, (replaceEditList) => - some( - replaceEditList, - (replaceEdit) => - replaceEdit.range.isEqual(change.range) && - replaceEdit.text === change.text - ) - ) - ) { - (change as ExtendedTextDocumentContentChangeEvent).isReplace = true; - } - }); - - updateRangeInfos(event, flatten(documentSelectionInfoMatrix)); + const extendedEvent: ExtendedTextDocumentChangeEvent = { + ...event, + contentChanges: event.contentChanges.map((change) => + isReplace(change) + ? { + ...change, + isReplace: true, + } + : change + ), + }; + + updateRangeInfos(extendedEvent, documentSelectionInfos); } ); } diff --git a/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts b/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts index 4f581179db..3f232f42cc 100644 --- a/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts +++ b/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts @@ -23,57 +23,57 @@ export function getOffsetsForEmptyRangeInsert( ); if (isReplace) { - // In this case the cursor stays to the left so we care about the start of the range - const expansionBehavior = rangeInfo.expansionBehavior.start; + // In this case the range stays to the left so we care about the end of the range + const expansionBehavior = rangeInfo.expansionBehavior.end; switch (expansionBehavior.type) { case "closed": return { - start: end, - end, + start, + end: start, }; case "open": return { start, end }; case "regex": - const index = text.search(rightAnchored(expansionBehavior.regex)); + const matches = text.match(leftAnchored(expansionBehavior.regex)); - return index === -1 + return matches == null ? { - start: end, - end, + start, + end: start, } : { - start: start + index, - end, + start, + end: start + matches[0].length, }; } } else { - // In this case the cursor moves to the right so we care about the end of the range - const expansionBehavior = rangeInfo.expansionBehavior.end; + // In this case the range moves to the right so we care about the start of the range + const expansionBehavior = rangeInfo.expansionBehavior.start; switch (expansionBehavior.type) { case "closed": return { - start, - end: start, + start: end, + end, }; case "open": return { start, end }; case "regex": - const matches = text.match(leftAnchored(expansionBehavior.regex)); + const index = text.search(rightAnchored(expansionBehavior.regex)); - return matches == null + return index === -1 ? { - start, - end: start, + start: end, + end, } : { - start, - end: start + matches[0].length, + start: start + index, + end, }; } } diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index 73ebfaf44e..b882effc4c 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -2,16 +2,11 @@ import { Selection, TextEditor, TextDocument, - EndOfLine, DecorationRangeBehavior, } from "vscode"; import { flatten } from "lodash"; -import { updateRangeInfos } from "./updateRangeInfos"; import { - ExtendedTextDocumentChangeEvent, - FullRangeInfo, FullSelectionInfo, - RangeInfo, SelectionInfo, } from "../../typings/updateSelections"; import { performDocumentEdits } from "../../util/performDocumentEdits"; @@ -95,13 +90,6 @@ export function selectionInfosToSelections( ); } -export function updateSelectionInfoMatrix( - changeEvent: ExtendedTextDocumentChangeEvent, - selectionInfoMatrix: FullSelectionInfo[][] -) { - updateRangeInfos(changeEvent, flatten(selectionInfoMatrix)); -} - /** * Calls the given function and updates the given selections based on the * changes that occurred as a result of calling function. @@ -121,16 +109,38 @@ export async function callFunctionAndUpdateSelections( selectionMatrix ); - const unsubscribe = selectionUpdater.registerSelectionInfos( + await callFunctionAndUpdateSelectionInfos( + selectionUpdater, + func, document, selectionInfoMatrix ); + return selectionInfosToSelections(selectionInfoMatrix); +} + +/** + * Calls the given function and updates the given selections based on the + * changes that occurred as a result of calling function. + * @param func The function to call + * @param editor The editor containing the selections + * @param selectionMatrix A matrix of selections to update + * @returns The initial selections updated based upon what happened in the function + */ +export async function callFunctionAndUpdateSelectionInfos( + selectionUpdater: SelectionUpdater, + func: () => Thenable, + document: TextDocument, + selectionInfoMatrix: FullSelectionInfo[][] +): Promise { + const unsubscribe = selectionUpdater.registerSelectionInfos( + document, + flatten(selectionInfoMatrix) + ); + await func(); unsubscribe(); - - return selectionInfosToSelections(selectionInfoMatrix); } /** @@ -142,6 +152,7 @@ export async function callFunctionAndUpdateSelections( * @returns The updated selections */ export async function performEditsAndUpdateSelections( + selectionUpdater: SelectionUpdater, editor: TextEditor, edits: Edit[], originalSelections: Selection[][] @@ -153,6 +164,7 @@ export async function performEditsAndUpdateSelections( ); await performEditsAndUpdateFullSelectionInfos( + selectionUpdater, editor, edits, selectionInfoMatrix @@ -162,6 +174,7 @@ export async function performEditsAndUpdateSelections( } export async function performEditsAndUpdateSelectionInfos( + selectionUpdater: SelectionUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: SelectionInfo[][] @@ -169,6 +182,7 @@ export async function performEditsAndUpdateSelectionInfos( fillOutSelectionInfos(editor.document, originalSelectionInfos); return await performEditsAndUpdateFullSelectionInfos( + selectionUpdater, editor, edits, originalSelectionInfos as FullSelectionInfo[][] @@ -176,6 +190,7 @@ export async function performEditsAndUpdateSelectionInfos( } export async function performEditsAndUpdateFullSelectionInfos( + selectionUpdater: SelectionUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: FullSelectionInfo[][] @@ -208,32 +223,23 @@ export async function performEditsAndUpdateFullSelectionInfos( // - It should probably just store a list of lists of selectionInfos, and // just remove the corresponding list when it gets deregistered // - Should clients register one list at a time or a list of lists? - const document = editor.document; - const contentChanges = edits.map(({ range, text, isReplace }) => ({ - range, - text, - rangeOffset: document.offsetAt(range.start), - rangeLength: document.offsetAt(range.end) - document.offsetAt(range.start), - isReplace, - })); - - // Replace \n with \r\n. Vscode does this internally and it's - // important that our calculated changes reflect the actual changes - if (document.eol === EndOfLine.CRLF) { - contentChanges.forEach((change) => { - change.text = change.text.replace(/(? { + const wereEditsApplied = await performDocumentEdits( + selectionUpdater, + editor, + edits + ); + + if (!wereEditsApplied) { + throw new Error("Could not apply edits"); + } + }; + + await callFunctionAndUpdateSelectionInfos( + selectionUpdater, + func, + editor.document, originalSelectionInfos ); diff --git a/src/extension.ts b/src/extension.ts index a7965b94d2..399977e6f5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -206,7 +206,8 @@ export async function activate(context: vscode.ExtensionContext) { } catch (e) { const err = e as Error; vscode.window.showErrorMessage(err.message); - console.trace(err.message); + console.debug(err.message); + console.debug(err.stack); throw err; } } diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 0cd3095427..5b265605ec 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -5,6 +5,7 @@ import { HatStyleName } from "../core/constants"; import { EditStyles } from "../core/editStyles"; import NavigationMap from "../core/NavigationMap"; import { Snippets } from "../core/Snippets"; +import { SelectionUpdater } from "../core/updateSelections/SelectionUpdater"; /** * A token within a text editor, including the current display line of the token @@ -329,6 +330,7 @@ export interface Graph { readonly navigationMap: NavigationMap; readonly extensionContext: ExtensionContext; readonly snippets: Snippets; + readonly selectionUpdater: SelectionUpdater; } export type NodeMatcherValue = { diff --git a/src/util/graphFactories.ts b/src/util/graphFactories.ts index 0781bb69f7..c22a617a7a 100644 --- a/src/util/graphFactories.ts +++ b/src/util/graphFactories.ts @@ -4,12 +4,14 @@ import { Graph } from "../typings/Types"; import { FactoryMap } from "./makeGraph"; import NavigationMap from "../core/NavigationMap"; import { Snippets } from "../core/Snippets"; +import { SelectionUpdater } from "../core/updateSelections/SelectionUpdater"; const graphFactories: Partial> = { actions: (graph: Graph) => new Actions(graph), editStyles: () => new EditStyles(), navigationMap: () => new NavigationMap(), snippets: (graph: Graph) => new Snippets(graph), + selectionUpdater: (graph: Graph) => new SelectionUpdater(graph), }; export default graphFactories; diff --git a/src/util/performDocumentEdits.ts b/src/util/performDocumentEdits.ts index 7356096245..d6c50ecb9f 100644 --- a/src/util/performDocumentEdits.ts +++ b/src/util/performDocumentEdits.ts @@ -1,8 +1,18 @@ import { Edit } from "../typings/Types"; import { TextEditor } from "vscode"; +import { SelectionUpdater } from "../core/updateSelections/SelectionUpdater"; -export async function performDocumentEdits(editor: TextEditor, edits: Edit[]) { - return editor.edit((editBuilder) => { +export async function performDocumentEdits( + selectionUpdater: SelectionUpdater, + editor: TextEditor, + edits: Edit[] +) { + const deregister = selectionUpdater.registerReplaceEdits( + editor.document, + edits.filter((edit) => edit.isReplace) + ); + + const wereEditsApplied = await editor.edit((editBuilder) => { edits.forEach(({ range, text }) => { if (text === "") { editBuilder.delete(range); @@ -13,4 +23,8 @@ export async function performDocumentEdits(editor: TextEditor, edits: Edit[]) { } }); }); + + deregister(); + + return wereEditsApplied; } From fd48593f19ce1a90bb4ac76cbab718a9c1982d1d Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 29 Oct 2021 14:01:52 +0100 Subject: [PATCH 15/48] Minor fixes --- src/processTargets/index.ts | 4 +++- src/util/performDocumentEdits.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/processTargets/index.ts b/src/processTargets/index.ts index 21aeaf4746..f71367b9f7 100644 --- a/src/processTargets/index.ts +++ b/src/processTargets/index.ts @@ -78,7 +78,9 @@ function processRangeTarget( const anchorSelection = anchorTarget.selection.selection; const activeSelection = activeTarget.selection.selection; - const isForward = getIsForward(anchorSelection); + const isForward = anchorSelection.start.isBeforeOrEqual( + activeSelection.start + ); const anchor = targetToRangeLimitPosition( anchorTarget, diff --git a/src/util/performDocumentEdits.ts b/src/util/performDocumentEdits.ts index d6c50ecb9f..e95da41eea 100644 --- a/src/util/performDocumentEdits.ts +++ b/src/util/performDocumentEdits.ts @@ -13,10 +13,10 @@ export async function performDocumentEdits( ); const wereEditsApplied = await editor.edit((editBuilder) => { - edits.forEach(({ range, text }) => { + edits.forEach(({ range, text, isReplace }) => { if (text === "") { editBuilder.delete(range); - } else if (range.isEmpty) { + } else if (range.isEmpty && !isReplace) { editBuilder.insert(range.start, text); } else { editBuilder.replace(range, text); From 244ce5110842f66876c301b9ecf61d64446d60f1 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Sun, 31 Oct 2021 22:37:03 +0000 Subject: [PATCH 16/48] Working selection updater for NavigationMap --- src/core/NavigationMap.ts | 67 ++++------ src/core/tokenizer.ts | 2 +- src/core/updateSelections/RangeUpdater.ts | 122 ++++++++++++++++++ src/core/updateSelections/SelectionUpdater.ts | 95 -------------- .../getOffsetsForDeleteOrReplace.ts | 2 +- src/core/updateSelections/getUpdatedText.ts | 3 +- src/core/updateSelections/updateRangeInfos.ts | 10 +- src/core/updateSelections/updateSelections.ts | 14 +- src/extension.ts | 2 - src/processTargets/processMark.ts | 38 +++++- src/test/suite/processTargets.test.ts | 52 -------- src/typings/Types.ts | 11 +- src/util/addDecorationsToEditor.ts | 13 +- src/util/getTokensInRange.ts | 20 +-- src/util/graphFactories.ts | 6 +- src/util/performDocumentEdits.ts | 4 +- src/util/regex.ts | 34 +++-- 17 files changed, 251 insertions(+), 244 deletions(-) create mode 100644 src/core/updateSelections/RangeUpdater.ts delete mode 100644 src/core/updateSelections/SelectionUpdater.ts delete mode 100644 src/test/suite/processTargets.test.ts diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 0b5688e391..35b4e768d8 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -1,48 +1,36 @@ -import { TextDocumentChangeEvent, Range } from "vscode"; +import { TextDocumentChangeEvent, Range, TextDocument } from "vscode"; import { HatStyleName } from "./constants"; -import { SelectionWithEditor, Token } from "../typings/Types"; +import { Graph, SelectionWithEditor, Token } from "../typings/Types"; +import { getDefault } from "../util/map"; /** * Maps from (hatStyle, character) pairs to tokens */ export default class NavigationMap { - updateTokenRanges(edit: TextDocumentChangeEvent) { - edit.contentChanges.forEach((editComponent) => { - // Amount by which to shift ranges - const shift = editComponent.text.length - editComponent.rangeLength; + private documentTokenLists: Map = new Map(); + private deregisterFunctions: (() => void)[] = []; - Object.entries(this.map).forEach(([decoratedCharacter, token]) => { - if (token.editor.document !== edit.document) { - return; - } + private map: { + [decoratedCharacter: string]: Token; + } = {}; - if (editComponent.range.start.isAfterOrEqual(token.range.end)) { - return; - } + constructor(private graph: Graph) {} - if (editComponent.range.end.isAfter(token.range.start)) { - // If there is overlap, we just delete the token - delete this.map[decoratedCharacter]; - return; - } + private getDocumentTokenList(document: TextDocument) { + const key = document.uri.toString(); + let currentValue = this.documentTokenLists.get(key); - const startOffset = token.startOffset + shift; - const endOffset = token.endOffset + shift; + if (currentValue == null) { + currentValue = []; + this.documentTokenLists.set(key, currentValue); + this.deregisterFunctions.push( + this.graph.selectionUpdater.registerRangeInfos(document, currentValue) + ); + } - token.range = token.range.with( - edit.document.positionAt(startOffset), - edit.document.positionAt(endOffset) - ); - token.startOffset = startOffset; - token.endOffset = endOffset; - }); - }); + return currentValue; } - private map: { - [decoratedCharacter: string]: Token; - } = {}; - static getKey(hatStyle: HatStyleName, character: string) { return `${hatStyle}.${character}`; } @@ -54,6 +42,7 @@ export default class NavigationMap { public addToken(hatStyle: HatStyleName, character: string, token: Token) { this.map[NavigationMap.getKey(hatStyle, character)] = token; + this.getDocumentTokenList(token.editor.document).push(token); } public getToken(hatStyle: HatStyleName, character: string) { @@ -62,18 +51,10 @@ export default class NavigationMap { public clear() { this.map = {}; + this.documentTokenLists.forEach((tokenList) => (tokenList.length = 0)); } - public getTokenIntersectionsForSelection(selection: SelectionWithEditor) { - const tokenIntersections: { token: Token; intersection: Range }[] = []; - Object.values(this.map).forEach((token) => { - if (token.editor.document === selection.editor.document) { - const intersection = token.range.intersection(selection.selection); - if (intersection != null) { - tokenIntersections.push({ token, intersection }); - } - } - }); - return tokenIntersections; + public dispose() { + this.deregisterFunctions.forEach((func) => func()); } } diff --git a/src/core/tokenizer.ts b/src/core/tokenizer.ts index cd1baf9bd0..17b5a21891 100644 --- a/src/core/tokenizer.ts +++ b/src/core/tokenizer.ts @@ -49,7 +49,7 @@ const REGEX = [ SINGLE_SYMBOLS_REGEX, ].join("|"); -const TOKEN_MATCHER = new RegExp(REGEX, "gu"); +export const TOKEN_MATCHER = new RegExp(REGEX, "gu"); export function tokenize( text: string, diff --git a/src/core/updateSelections/RangeUpdater.ts b/src/core/updateSelections/RangeUpdater.ts new file mode 100644 index 0000000000..fffcbf4f2d --- /dev/null +++ b/src/core/updateSelections/RangeUpdater.ts @@ -0,0 +1,122 @@ +import { pull, some } from "lodash"; +import { + workspace, + TextDocument, + TextDocumentChangeEvent, + Disposable, + TextDocumentContentChangeEvent, +} from "vscode"; +import { Edit, Graph } from "../../typings/Types"; +import { + ExtendedTextDocumentChangeEvent, + FullRangeInfo, +} from "../../typings/updateSelections"; +import { getDefault } from "../../util/map"; +import { updateRangeInfos } from "./updateRangeInfos"; + +export class RangeUpdater { + private rangeInfos: Map = new Map(); + private replaceEdits: Map = new Map(); + private disposable!: Disposable; + + constructor(graph: Graph) { + this.listenForDocumentChanges(); + } + + private getDocumentRangeInfos(document: TextDocument) { + return getDefault(this.rangeInfos, document.uri.toString(), () => []); + } + + private getDocumentReplaceEdits(document: TextDocument) { + return getDefault(this.replaceEdits, document.uri.toString(), () => []); + } + + /** + * Registers a list of range infos to be kept up to date. It is ok to + * add to this list after registering it; any items in the list at the time of + * a document change will be kept up to date. Please be sure to call the + * returned deregister function when you no longer need the ranges + * updated. + * @param document The document containing the ranges + * @param rangeInfos The ranges to keep up to date; it is ok to add to this list after the fact + * @returns A function that can be used to deregister the list + */ + registerRangeInfos( + document: TextDocument, + rangeInfos: FullRangeInfo[] + ): () => void { + const currentRangeInfos = this.getDocumentRangeInfos(document); + + currentRangeInfos.push(rangeInfos); + + return () => pull(currentRangeInfos, rangeInfos); + } + + registerReplaceEdits( + document: TextDocument, + replaceEdits: Edit[] + ): () => void { + const currentReplaceEdits = this.getDocumentReplaceEdits(document); + + currentReplaceEdits.push(replaceEdits); + + return () => pull(currentReplaceEdits, replaceEdits); + } + + private *documentRangeInfoGenerator(document: TextDocument) { + const documentRangeInfos = this.getDocumentRangeInfos(document); + + for (const rangeInfos of documentRangeInfos) { + for (const rangeInfo of rangeInfos) { + yield rangeInfo; + } + } + } + + private isReplace( + document: TextDocument, + change: TextDocumentContentChangeEvent + ) { + const documentReplaceEdits = this.getDocumentReplaceEdits(document); + + for (const replaceEdits of documentReplaceEdits) { + for (const replaceEdit of replaceEdits) { + if ( + replaceEdit.range.isEqual(change.range) && + replaceEdit.text === change.text + ) { + return true; + } + } + } + + return false; + } + + private listenForDocumentChanges() { + this.disposable = workspace.onDidChangeTextDocument( + (event: TextDocumentChangeEvent) => { + const extendedEvent: ExtendedTextDocumentChangeEvent = { + ...event, + contentChanges: event.contentChanges.map((change) => + this.isReplace(event.document, change) + ? { + ...change, + isReplace: true, + } + : change + ), + }; + + updateRangeInfos( + extendedEvent, + this.documentRangeInfoGenerator(event.document) + ); + } + ); + } + + dispose() { + this.disposable.dispose(); + } +} diff --git a/src/core/updateSelections/SelectionUpdater.ts b/src/core/updateSelections/SelectionUpdater.ts deleted file mode 100644 index e6350b842e..0000000000 --- a/src/core/updateSelections/SelectionUpdater.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { pullAll, some } from "lodash"; -import { - workspace, - TextDocument, - TextDocumentChangeEvent, - Disposable, - TextDocumentContentChangeEvent, -} from "vscode"; -import { Edit, Graph } from "../../typings/Types"; -import { - ExtendedTextDocumentChangeEvent, - FullSelectionInfo, -} from "../../typings/updateSelections"; -import { getDefault } from "../../util/map"; -import { updateRangeInfos } from "./updateRangeInfos"; - -export class SelectionUpdater { - private selectionInfos: Map = new Map(); - private replaceEdits: Map = new Map(); - private disposable!: Disposable; - - constructor(graph: Graph) { - this.listenForDocumentChanges(); - } - - private getDocumentSelectionInfos(document: TextDocument) { - return getDefault(this.selectionInfos, document.uri.toString(), () => []); - } - - private getDocumentReplaceEdits(document: TextDocument) { - return getDefault(this.replaceEdits, document.uri.toString(), () => []); - } - - registerSelectionInfos( - document: TextDocument, - selectionInfos: FullSelectionInfo[] - ): () => void { - const currentSelectionInfos = this.getDocumentSelectionInfos(document); - - currentSelectionInfos.push(...selectionInfos); - - return () => pullAll(currentSelectionInfos, selectionInfos); - } - - registerReplaceEdits( - document: TextDocument, - replaceEdits: Edit[] - ): () => void { - const currentReplaceEdits = this.getDocumentReplaceEdits(document); - - currentReplaceEdits.push(...replaceEdits); - - return () => pullAll(currentReplaceEdits, replaceEdits); - } - - private listenForDocumentChanges() { - this.disposable = workspace.onDidChangeTextDocument( - (event: TextDocumentChangeEvent) => { - const documentReplaceEdits = this.getDocumentReplaceEdits( - event.document - ); - - const isReplace = (change: TextDocumentContentChangeEvent) => - some( - documentReplaceEdits, - (replaceEdit) => - replaceEdit.range.isEqual(change.range) && - replaceEdit.text === change.text - ); - - const documentSelectionInfos = this.getDocumentSelectionInfos( - event.document - ); - - const extendedEvent: ExtendedTextDocumentChangeEvent = { - ...event, - contentChanges: event.contentChanges.map((change) => - isReplace(change) - ? { - ...change, - isReplace: true, - } - : change - ), - }; - - updateRangeInfos(extendedEvent, documentSelectionInfos); - } - ); - } - - dispose() { - this.disposable.dispose(); - } -} diff --git a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts index d73af02d75..241584c9de 100644 --- a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts +++ b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -34,7 +34,7 @@ export function getOffsetsForDeleteOrReplace( return { start: Math.min(rangeStart, changeFinalEndOffset), end: - changeOriginalStartOffset < rangeEnd + changeOriginalEndOffset < rangeEnd ? rangeEnd + displacement : Math.min(rangeEnd, changeFinalEndOffset), }; diff --git a/src/core/updateSelections/getUpdatedText.ts b/src/core/updateSelections/getUpdatedText.ts index 98a0e6f9e4..e7f03524c5 100644 --- a/src/core/updateSelections/getUpdatedText.ts +++ b/src/core/updateSelections/getUpdatedText.ts @@ -4,7 +4,7 @@ import { RangeOffsets, } from "../../typings/updateSelections"; -function getUpdatedText( +export function getUpdatedText( changeEventInfo: ChangeEventInfo, rangeInfo: FullRangeInfo, newOffsets: RangeOffsets @@ -22,6 +22,7 @@ function getUpdatedText( if (rangeOriginalOffsetsStart < changeOriginalOffsetsStart) { result += rangeInfo.text.substring( + 0, changeOriginalOffsetsStart - rangeOriginalOffsetsStart ); } diff --git a/src/core/updateSelections/updateRangeInfos.ts b/src/core/updateSelections/updateRangeInfos.ts index 44e01c7c96..c4efdfd3bf 100644 --- a/src/core/updateSelections/updateRangeInfos.ts +++ b/src/core/updateSelections/updateRangeInfos.ts @@ -8,10 +8,11 @@ import { ChangeEventInfo, RangeOffsets, } from "../../typings/updateSelections"; +import { getUpdatedText } from "./getUpdatedText"; export function updateRangeInfos( changeEvent: ExtendedTextDocumentChangeEvent, - rangeInfos: FullRangeInfo[] + rangeInfoGenerator: Generator ) { const { document, contentChanges } = changeEvent; @@ -36,7 +37,7 @@ export function updateRangeInfos( }; }); - rangeInfos.forEach((rangeInfo) => { + for (const rangeInfo of rangeInfoGenerator) { const originalOffsets = rangeInfo.offsets; const displacements = changeEventInfos.map((changeEventInfo) => { @@ -72,8 +73,7 @@ export function updateRangeInfos( newOffsets = getOffsetsForDeleteOrReplace(changeEventInfo, rangeInfo); } - // NB: We don't update text for now because we're not entirely sure it's necessary - // rangeInfo.text = getUpdatedText(changeEventInfo, rangeInfo, newOffsets); + rangeInfo.text = getUpdatedText(changeEventInfo, rangeInfo, newOffsets); return { start: newOffsets.start - originalOffsets.start, @@ -91,5 +91,5 @@ export function updateRangeInfos( document.positionAt(newOffsets.end) ); rangeInfo.offsets = newOffsets; - }); + } } diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index b882effc4c..d148c86703 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -12,7 +12,7 @@ import { import { performDocumentEdits } from "../../util/performDocumentEdits"; import { isForward } from "../../util/selectionUtils"; import { Edit } from "../../typings/Types"; -import { SelectionUpdater } from "./SelectionUpdater"; +import { RangeUpdater } from "./RangeUpdater"; export function getSelectionInfo( document: TextDocument, @@ -99,7 +99,7 @@ export function selectionInfosToSelections( * @returns The initial selections updated based upon what happened in the function */ export async function callFunctionAndUpdateSelections( - selectionUpdater: SelectionUpdater, + selectionUpdater: RangeUpdater, func: () => Thenable, document: TextDocument, selectionMatrix: Selection[][] @@ -128,12 +128,12 @@ export async function callFunctionAndUpdateSelections( * @returns The initial selections updated based upon what happened in the function */ export async function callFunctionAndUpdateSelectionInfos( - selectionUpdater: SelectionUpdater, + selectionUpdater: RangeUpdater, func: () => Thenable, document: TextDocument, selectionInfoMatrix: FullSelectionInfo[][] ): Promise { - const unsubscribe = selectionUpdater.registerSelectionInfos( + const unsubscribe = selectionUpdater.registerRangeInfos( document, flatten(selectionInfoMatrix) ); @@ -152,7 +152,7 @@ export async function callFunctionAndUpdateSelectionInfos( * @returns The updated selections */ export async function performEditsAndUpdateSelections( - selectionUpdater: SelectionUpdater, + selectionUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelections: Selection[][] @@ -174,7 +174,7 @@ export async function performEditsAndUpdateSelections( } export async function performEditsAndUpdateSelectionInfos( - selectionUpdater: SelectionUpdater, + selectionUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: SelectionInfo[][] @@ -190,7 +190,7 @@ export async function performEditsAndUpdateSelectionInfos( } export async function performEditsAndUpdateFullSelectionInfos( - selectionUpdater: SelectionUpdater, + selectionUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: FullSelectionInfo[][] diff --git a/src/extension.ts b/src/extension.ts index 399977e6f5..1435eed932 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -242,8 +242,6 @@ export async function activate(context: vscode.ExtensionContext) { } function handleEdit(edit: vscode.TextDocumentChangeEvent) { - graph.navigationMap.updateTokenRanges(edit); - addDecorationsDebounced(); // TODO. Disabled for now because it triggers on undo as well diff --git a/src/processTargets/processMark.ts b/src/processTargets/processMark.ts index 9810df7385..e68a52dfd7 100644 --- a/src/processTargets/processMark.ts +++ b/src/processTargets/processMark.ts @@ -1,4 +1,4 @@ -import { Selection } from "vscode"; +import { Range, Selection } from "vscode"; import { DecoratedSymbol, LineNumber, @@ -7,6 +7,7 @@ import { ProcessedTargetsContext, SelectionWithEditor, } from "../typings/Types"; +import { getTokensInRange, PartialToken } from "../util/getTokensInRange"; import { selectionWithEditorFromPositions } from "../util/selectionUtils"; export default function ( @@ -31,6 +32,34 @@ export default function ( } } +function getTokenIntersectionsForSelection(selection: SelectionWithEditor) { + const startLine = selection.selection.start.line; + const endLine = selection.selection.end.line; + let tokens = getTokensInRange( + selection.editor, + selection.editor.document.lineAt(startLine).range + ); + if (endLine !== startLine) { + tokens.push( + ...getTokensInRange( + selection.editor, + selection.editor.document.lineAt(endLine).range + ) + ); + } + + const tokenIntersections: { token: PartialToken; intersection: Range }[] = []; + + tokens.forEach((token) => { + const intersection = token.range.intersection(selection.selection); + if (intersection != null) { + tokenIntersections.push({ token, intersection }); + } + }); + + return tokenIntersections; +} + /** * Given a selection returns a new selection which contains the tokens * intersecting the given selection. Uses heuristics to tie break when the @@ -42,8 +71,7 @@ function getTokenSelectionForSelection( context: ProcessedTargetsContext, selection: SelectionWithEditor ): SelectionWithEditor { - let tokens = - context.navigationMap.getTokenIntersectionsForSelection(selection); + let tokens = getTokenIntersectionsForSelection(selection); // Use single token for overlapping or adjacent range if (selection.selection.isEmpty) { // If multiple matches sort and take the first @@ -63,14 +91,14 @@ function getTokenSelectionForSelection( return lengthDiff; } // Lastly sort on start position. ie leftmost - return a.startOffset - b.startOffset; + return a.offsets.start - b.offsets.start; }); tokens = tokens.slice(0, 1); } // Use tokens for overlapping ranges else { tokens = tokens.filter((token) => !token.intersection.isEmpty); - tokens.sort((a, b) => a.token.startOffset - b.token.startOffset); + tokens.sort((a, b) => a.token.offsets.start - b.token.offsets.start); } if (tokens.length < 1) { throw new Error("Couldn't find token in selection"); diff --git a/src/test/suite/processTargets.test.ts b/src/test/suite/processTargets.test.ts deleted file mode 100644 index 11b9b556c6..0000000000 --- a/src/test/suite/processTargets.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as assert from "assert"; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -import * as vscode from "vscode"; -import NavigationMap from "../../core/NavigationMap"; -import processTargets from "../../processTargets"; -import { Target, Token } from "../../typings/Types"; -// import * as myExtension from '../../extension'; - -/* - * FIXME: These tests are outdated and thus disabled for now - */ -suite.skip("processTargets", () => { - test("simple processTargets", () => { - const navigationMap = new NavigationMap(); - const token: Token = { - text: "hello", - range: new vscode.Range( - new vscode.Position(0, 0), - new vscode.Position(0, 5) - ), - startOffset: 0, - endOffset: 5, - displayLine: 0, - editor: vscode.window.activeTextEditor!, - }; - navigationMap.addToken("red", "h", token); - - const target: Target = { - type: "primitive", - mark: { - type: "decoratedSymbol", - character: "h", - symbolColor: "red", - }, - position: "contents", - selectionType: "token", - modifier: { type: "identity" }, - insideOutsideType: "inside", - }; - - const expectedReturnValue = [ - [new vscode.Selection(token.range.start, token.range.end)], - ]; - assert.deepStrictEqual( - expectedReturnValue, - // @ts-ignore - processTargets(navigationMap, [target]) - ); - }); -}); diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 5b265605ec..5968a77105 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -5,16 +5,13 @@ import { HatStyleName } from "../core/constants"; import { EditStyles } from "../core/editStyles"; import NavigationMap from "../core/NavigationMap"; import { Snippets } from "../core/Snippets"; -import { SelectionUpdater } from "../core/updateSelections/SelectionUpdater"; +import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; +import { FullRangeInfo } from "./updateSelections"; /** * A token within a text editor, including the current display line of the token */ -export interface Token { - text: string; - range: vscode.Range; - startOffset: number; - endOffset: number; +export interface Token extends FullRangeInfo { editor: vscode.TextEditor; displayLine: number; } @@ -330,7 +327,7 @@ export interface Graph { readonly navigationMap: NavigationMap; readonly extensionContext: ExtensionContext; readonly snippets: Snippets; - readonly selectionUpdater: SelectionUpdater; + readonly selectionUpdater: RangeUpdater; } export type NodeMatcherValue = { diff --git a/src/util/addDecorationsToEditor.ts b/src/util/addDecorationsToEditor.ts index 690836a3fe..413a68541b 100644 --- a/src/util/addDecorationsToEditor.ts +++ b/src/util/addDecorationsToEditor.ts @@ -7,6 +7,7 @@ import { Token } from "../typings/Types"; import Decorations from "../core/Decorations"; import { HatStyleName } from "../core/constants"; import NavigationMap from "../core/NavigationMap"; +import { TOKEN_MATCHER } from "../core/tokenizer"; interface CharacterTokenInfo { characterIdx: number; @@ -35,9 +36,17 @@ export function addDecorationsToEditors( ...editors.map((editor) => { const displayLineMap = getDisplayLineMap(editor); - const tokens = flatten( + const tokens: Token[] = flatten( editor.visibleRanges.map((range) => - getTokensInRange(editor, range, displayLineMap) + getTokensInRange(editor, range).map((partialToken) => ({ + ...partialToken, + displayLine: displayLineMap.get(partialToken.range.start.line)!, + editor, + expansionBehavior: { + start: { type: "regex", regex: TOKEN_MATCHER }, + end: { type: "regex", regex: TOKEN_MATCHER }, + }, + })) ) ); diff --git a/src/util/getTokensInRange.ts b/src/util/getTokensInRange.ts index 02b159d6f2..17a7e0d442 100644 --- a/src/util/getTokensInRange.ts +++ b/src/util/getTokensInRange.ts @@ -1,12 +1,18 @@ import * as vscode from "vscode"; -import { tokenize } from "../core/tokenizer"; +import { tokenize, TOKEN_MATCHER } from "../core/tokenizer"; import { Token } from "../typings/Types"; +import { RangeOffsets } from "../typings/updateSelections"; + +export interface PartialToken { + text: string; + range: vscode.Range; + offsets: RangeOffsets; +} export function getTokensInRange( editor: vscode.TextEditor, - range: vscode.Range, - displayLineMap: Map -): Token[] { + range: vscode.Range +): PartialToken[] { const text = editor.document.getText(range).toLowerCase(); const rangeOffset = editor.document.offsetAt(range.start); @@ -17,13 +23,11 @@ export function getTokensInRange( editor.document.positionAt(startOffset), editor.document.positionAt(endOffset) ); + return { text: match[0], range, - startOffset, - endOffset, - displayLine: displayLineMap.get(range.start.line)!, - editor, + offsets: { start: startOffset, end: endOffset }, }; }); } diff --git a/src/util/graphFactories.ts b/src/util/graphFactories.ts index c22a617a7a..3dac0bf005 100644 --- a/src/util/graphFactories.ts +++ b/src/util/graphFactories.ts @@ -4,14 +4,14 @@ import { Graph } from "../typings/Types"; import { FactoryMap } from "./makeGraph"; import NavigationMap from "../core/NavigationMap"; import { Snippets } from "../core/Snippets"; -import { SelectionUpdater } from "../core/updateSelections/SelectionUpdater"; +import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; const graphFactories: Partial> = { actions: (graph: Graph) => new Actions(graph), editStyles: () => new EditStyles(), - navigationMap: () => new NavigationMap(), + navigationMap: (graph: Graph) => new NavigationMap(graph), snippets: (graph: Graph) => new Snippets(graph), - selectionUpdater: (graph: Graph) => new SelectionUpdater(graph), + selectionUpdater: (graph: Graph) => new RangeUpdater(graph), }; export default graphFactories; diff --git a/src/util/performDocumentEdits.ts b/src/util/performDocumentEdits.ts index e95da41eea..c85408736c 100644 --- a/src/util/performDocumentEdits.ts +++ b/src/util/performDocumentEdits.ts @@ -1,9 +1,9 @@ import { Edit } from "../typings/Types"; import { TextEditor } from "vscode"; -import { SelectionUpdater } from "../core/updateSelections/SelectionUpdater"; +import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; export async function performDocumentEdits( - selectionUpdater: SelectionUpdater, + selectionUpdater: RangeUpdater, editor: TextEditor, edits: Edit[] ) { diff --git a/src/util/regex.ts b/src/util/regex.ts index 180caf7eab..680eae1bc5 100644 --- a/src/util/regex.ts +++ b/src/util/regex.ts @@ -1,17 +1,31 @@ -export function rightAnchored(regex: RegExp) { +function _rightAnchored(regex: RegExp) { const { source, flags } = regex; - return new RegExp( - source.endsWith("$") ? source : source + "$", - flags.replace("m", "") - ); + return new RegExp(`(${source})$`, flags.replace("m", "")); } -export function leftAnchored(regex: RegExp) { +function _leftAnchored(regex: RegExp) { const { source, flags } = regex; - return new RegExp( - source.startsWith("^") ? source : "^" + source, - flags.replace("m", "") - ); + return new RegExp(`^(${source})`, flags.replace("m", "")); } + +function makeMRUCache(func: (arg: T) => U) { + const cache: Map = new Map(); + + function wrapper(arg: T): U { + let cachedValue: U | undefined = cache.get(arg); + + if (cachedValue == null) { + cachedValue = func(arg); + cache.set(arg, cachedValue); + } + + return cachedValue; + } + + return wrapper; +} + +export const rightAnchored = makeMRUCache(_rightAnchored); +export const leftAnchored = makeMRUCache(_leftAnchored); From 842d51ebcb808ff75659e4dfe24cde6c5b5ecdbc Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Sun, 31 Oct 2021 22:38:08 +0000 Subject: [PATCH 17/48] cleanup --- src/util/regex.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/regex.ts b/src/util/regex.ts index 680eae1bc5..192ffc1c8e 100644 --- a/src/util/regex.ts +++ b/src/util/regex.ts @@ -10,7 +10,7 @@ function _leftAnchored(regex: RegExp) { return new RegExp(`^(${source})`, flags.replace("m", "")); } -function makeMRUCache(func: (arg: T) => U) { +function makeCache(func: (arg: T) => U) { const cache: Map = new Map(); function wrapper(arg: T): U { @@ -27,5 +27,5 @@ function makeMRUCache(func: (arg: T) => U) { return wrapper; } -export const rightAnchored = makeMRUCache(_rightAnchored); -export const leftAnchored = makeMRUCache(_leftAnchored); +export const rightAnchored = makeCache(_rightAnchored); +export const leftAnchored = makeCache(_leftAnchored); From ab7d5d433ab1f247fa0cb5cf7b85edad8a9b6f9e Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Sun, 31 Oct 2021 22:49:01 +0000 Subject: [PATCH 18/48] Fix CI --- src/actions/BringMoveSwap.ts | 17 ++++++---------- src/actions/WrapWithSnippet.ts | 20 +++++++++++++++---- src/core/updateSelections/updateSelections.ts | 8 ++++---- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index 5698f04b32..7431536f18 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -158,17 +158,12 @@ class BringMoveSwap implements Action { ? edits : edits.filter(({ isSource }) => !isSource); - const selectionInfos = edits.map( - ({ - originalSelection: { - selection: { selection }, - }, - }) => - getSelectionInfo( - editor.document, - selection, - DecorationRangeBehavior.OpenOpen - ) + const selectionInfos = edits.map(({ originalSelection }) => + getSelectionInfo( + editor.document, + originalSelection.selection.selection, + DecorationRangeBehavior.OpenOpen + ) ); const [updatedSelections]: Selection[][] = diff --git a/src/actions/WrapWithSnippet.ts b/src/actions/WrapWithSnippet.ts index 0737070554..026d05ccf9 100644 --- a/src/actions/WrapWithSnippet.ts +++ b/src/actions/WrapWithSnippet.ts @@ -1,5 +1,9 @@ -import { commands } from "vscode"; -import { callFunctionAndUpdateSelections } from "../core/updateSelections/updateSelections"; +import { commands, DecorationRangeBehavior } from "vscode"; +import { + callFunctionAndUpdateSelectionInfos, + callFunctionAndUpdateSelections, + getSelectionInfo, +} from "../core/updateSelections/updateSelections"; import { SnippetDefinition } from "../typings/snippet"; import { Action, @@ -95,16 +99,24 @@ export default class WrapWithSnippet implements Action { await this.graph.actions.setSelection.run([targets]); + const selectionInfos = targetSelections.map((selection) => + getSelectionInfo( + editor.document, + selection, + DecorationRangeBehavior.OpenOpen + ) + ); + // NB: We used the command "editor.action.insertSnippet" instead of calling editor.insertSnippet // because the latter doesn't support special variables like CLIPBOARD - const [updatedTargetSelections] = await callFunctionAndUpdateSelections( + const [updatedTargetSelections] = await callFunctionAndUpdateSelectionInfos( this.graph.selectionUpdater, () => commands.executeCommand("editor.action.insertSnippet", { snippet: snippetString, }), editor.document, - [targetSelections] + [selectionInfos] ); return { diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index d148c86703..6d531c3560 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -109,14 +109,12 @@ export async function callFunctionAndUpdateSelections( selectionMatrix ); - await callFunctionAndUpdateSelectionInfos( + return await callFunctionAndUpdateSelectionInfos( selectionUpdater, func, document, selectionInfoMatrix ); - - return selectionInfosToSelections(selectionInfoMatrix); } /** @@ -132,7 +130,7 @@ export async function callFunctionAndUpdateSelectionInfos( func: () => Thenable, document: TextDocument, selectionInfoMatrix: FullSelectionInfo[][] -): Promise { +) { const unsubscribe = selectionUpdater.registerRangeInfos( document, flatten(selectionInfoMatrix) @@ -141,6 +139,8 @@ export async function callFunctionAndUpdateSelectionInfos( await func(); unsubscribe(); + + return selectionInfosToSelections(selectionInfoMatrix); } /** From 99c6a042ca291dcd5a8f9aa7c3218b1190f39a15 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Sun, 31 Oct 2021 22:54:36 +0000 Subject: [PATCH 19/48] Fix CI again --- src/actions/WrapWithSnippet.ts | 20 ++++--------------- .../getOffsetsForDeleteOrReplace.ts | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/actions/WrapWithSnippet.ts b/src/actions/WrapWithSnippet.ts index 026d05ccf9..0737070554 100644 --- a/src/actions/WrapWithSnippet.ts +++ b/src/actions/WrapWithSnippet.ts @@ -1,9 +1,5 @@ -import { commands, DecorationRangeBehavior } from "vscode"; -import { - callFunctionAndUpdateSelectionInfos, - callFunctionAndUpdateSelections, - getSelectionInfo, -} from "../core/updateSelections/updateSelections"; +import { commands } from "vscode"; +import { callFunctionAndUpdateSelections } from "../core/updateSelections/updateSelections"; import { SnippetDefinition } from "../typings/snippet"; import { Action, @@ -99,24 +95,16 @@ export default class WrapWithSnippet implements Action { await this.graph.actions.setSelection.run([targets]); - const selectionInfos = targetSelections.map((selection) => - getSelectionInfo( - editor.document, - selection, - DecorationRangeBehavior.OpenOpen - ) - ); - // NB: We used the command "editor.action.insertSnippet" instead of calling editor.insertSnippet // because the latter doesn't support special variables like CLIPBOARD - const [updatedTargetSelections] = await callFunctionAndUpdateSelectionInfos( + const [updatedTargetSelections] = await callFunctionAndUpdateSelections( this.graph.selectionUpdater, () => commands.executeCommand("editor.action.insertSnippet", { snippet: snippetString, }), editor.document, - [selectionInfos] + [targetSelections] ); return { diff --git a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts index 241584c9de..40e921024f 100644 --- a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts +++ b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -34,7 +34,7 @@ export function getOffsetsForDeleteOrReplace( return { start: Math.min(rangeStart, changeFinalEndOffset), end: - changeOriginalEndOffset < rangeEnd + changeOriginalEndOffset <= rangeEnd ? rangeEnd + displacement : Math.min(rangeEnd, changeFinalEndOffset), }; From fd837d85280b3b63e172eedcaf7ae0eaca984593 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 10:44:19 +0000 Subject: [PATCH 20/48] Improve comments --- src/core/NavigationMap.ts | 2 +- src/core/updateSelections/RangeUpdater.ts | 96 +++++++++++-------- src/core/updateSelections/updateSelections.ts | 2 +- src/typings/Types.ts | 10 ++ src/util/performDocumentEdits.ts | 2 +- 5 files changed, 68 insertions(+), 44 deletions(-) diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 35b4e768d8..870d1fbdf3 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -24,7 +24,7 @@ export default class NavigationMap { currentValue = []; this.documentTokenLists.set(key, currentValue); this.deregisterFunctions.push( - this.graph.selectionUpdater.registerRangeInfos(document, currentValue) + this.graph.selectionUpdater.registerRangeInfoList(document, currentValue) ); } diff --git a/src/core/updateSelections/RangeUpdater.ts b/src/core/updateSelections/RangeUpdater.ts index fffcbf4f2d..c5dd0fc61b 100644 --- a/src/core/updateSelections/RangeUpdater.ts +++ b/src/core/updateSelections/RangeUpdater.ts @@ -15,20 +15,20 @@ import { getDefault } from "../../util/map"; import { updateRangeInfos } from "./updateRangeInfos"; export class RangeUpdater { - private rangeInfos: Map = new Map(); - private replaceEdits: Map = new Map(); + private rangeInfoLists: Map = new Map(); + private replaceEditLists: Map = new Map(); private disposable!: Disposable; constructor(graph: Graph) { this.listenForDocumentChanges(); } - private getDocumentRangeInfos(document: TextDocument) { - return getDefault(this.rangeInfos, document.uri.toString(), () => []); + private getDocumentRangeInfoLists(document: TextDocument) { + return getDefault(this.rangeInfoLists, document.uri.toString(), () => []); } - private getDocumentReplaceEdits(document: TextDocument) { - return getDefault(this.replaceEdits, document.uri.toString(), () => []); + private getDocumentReplaceEditLists(document: TextDocument) { + return getDefault(this.replaceEditLists, document.uri.toString(), () => []); } /** @@ -38,68 +38,64 @@ export class RangeUpdater { * returned deregister function when you no longer need the ranges * updated. * @param document The document containing the ranges - * @param rangeInfos The ranges to keep up to date; it is ok to add to this list after the fact + * @param rangeInfoList The ranges to keep up to date; it is ok to add to this list after the fact * @returns A function that can be used to deregister the list */ - registerRangeInfos( + registerRangeInfoList( document: TextDocument, - rangeInfos: FullRangeInfo[] + rangeInfoList: FullRangeInfo[] ): () => void { - const currentRangeInfos = this.getDocumentRangeInfos(document); + const documentRangeInfoLists = this.getDocumentRangeInfoLists(document); - currentRangeInfos.push(rangeInfos); + documentRangeInfoLists.push(rangeInfoList); - return () => pull(currentRangeInfos, rangeInfos); + return () => pull(documentRangeInfoLists, rangeInfoList); } - registerReplaceEdits( + /** + * Registers a list of edits to treat as replace edits. These edits are + * insertions that will not shift an empty selection to the right. + * + * It is ok to add to this list after registering it; any items in the list + * at the time of a document change will be kept up to date. Please be sure + * to call the returned deregister function when you no longer need the ranges + * updated. + * @param document The document containing the ranges + * @param replaceEditList A list of edits to treat as replace edits; it is ok to add to this list after the fact + * @returns A function that can be used to deregister the list + */ + registerReplaceEditList( document: TextDocument, - replaceEdits: Edit[] + replaceEditList: Edit[] ): () => void { - const currentReplaceEdits = this.getDocumentReplaceEdits(document); + const documentReplaceEditLists = this.getDocumentReplaceEditLists(document); - currentReplaceEdits.push(replaceEdits); + documentReplaceEditLists.push(replaceEditList); - return () => pull(currentReplaceEdits, replaceEdits); + return () => pull(documentReplaceEditLists, replaceEditList); } private *documentRangeInfoGenerator(document: TextDocument) { - const documentRangeInfos = this.getDocumentRangeInfos(document); + const documentRangeInfoLists = this.getDocumentRangeInfoLists(document); - for (const rangeInfos of documentRangeInfos) { - for (const rangeInfo of rangeInfos) { + for (const rangeInfoLists of documentRangeInfoLists) { + for (const rangeInfo of rangeInfoLists) { yield rangeInfo; } } } - private isReplace( - document: TextDocument, - change: TextDocumentContentChangeEvent - ) { - const documentReplaceEdits = this.getDocumentReplaceEdits(document); - - for (const replaceEdits of documentReplaceEdits) { - for (const replaceEdit of replaceEdits) { - if ( - replaceEdit.range.isEqual(change.range) && - replaceEdit.text === change.text - ) { - return true; - } - } - } - - return false; - } - private listenForDocumentChanges() { this.disposable = workspace.onDidChangeTextDocument( (event: TextDocumentChangeEvent) => { + const documentReplaceEditLists = this.getDocumentReplaceEditLists( + event.document + ); + const extendedEvent: ExtendedTextDocumentChangeEvent = { ...event, contentChanges: event.contentChanges.map((change) => - this.isReplace(event.document, change) + isReplace(documentReplaceEditLists, change) ? { ...change, isReplace: true, @@ -120,3 +116,21 @@ export class RangeUpdater { this.disposable.dispose(); } } + +function isReplace( + documentReplaceEditLists: Edit[][], + change: TextDocumentContentChangeEvent +) { + for (const replaceEditLists of documentReplaceEditLists) { + for (const replaceEdit of replaceEditLists) { + if ( + replaceEdit.range.isEqual(change.range) && + replaceEdit.text === change.text + ) { + return true; + } + } + } + + return false; +} diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index 6d531c3560..591f14e8cf 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -131,7 +131,7 @@ export async function callFunctionAndUpdateSelectionInfos( document: TextDocument, selectionInfoMatrix: FullSelectionInfo[][] ) { - const unsubscribe = selectionUpdater.registerRangeInfos( + const unsubscribe = selectionUpdater.registerRangeInfoList( document, flatten(selectionInfoMatrix) ); diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 5968a77105..7fe257f0b8 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -361,5 +361,15 @@ export type SelectionExtractor = ( export interface Edit { range: vscode.Range; text: string; + + /** + * If this edit is an insertion, ie the range has zero length, then this + * field can be set to `true` to indicate that any adjacent empty selection + * should *not* be shifted to the right, as would normally happen with an + * insertion. This is equivalent to the + * [distinction](https://code.visualstudio.com/api/references/vscode-api#TextEditorEdit) + * in a vscode edit builder between doing a replace with an empty range + * versus doing an insert. + */ isReplace?: boolean; } diff --git a/src/util/performDocumentEdits.ts b/src/util/performDocumentEdits.ts index c85408736c..64eb9f4246 100644 --- a/src/util/performDocumentEdits.ts +++ b/src/util/performDocumentEdits.ts @@ -7,7 +7,7 @@ export async function performDocumentEdits( editor: TextEditor, edits: Edit[] ) { - const deregister = selectionUpdater.registerReplaceEdits( + const deregister = selectionUpdater.registerReplaceEditList( editor.document, edits.filter((edit) => edit.isReplace) ); From e925391bf9a7049b9393f5a4c84a44fcac738ae6 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 10:55:12 +0000 Subject: [PATCH 21/48] Cleanup --- src/core/NavigationMap.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 870d1fbdf3..06acb4c116 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -24,7 +24,10 @@ export default class NavigationMap { currentValue = []; this.documentTokenLists.set(key, currentValue); this.deregisterFunctions.push( - this.graph.selectionUpdater.registerRangeInfoList(document, currentValue) + this.graph.selectionUpdater.registerRangeInfoList( + document, + currentValue + ) ); } @@ -51,7 +54,8 @@ export default class NavigationMap { public clear() { this.map = {}; - this.documentTokenLists.forEach((tokenList) => (tokenList.length = 0)); + this.documentTokenLists = new Map(); + this.deregisterFunctions.forEach((func) => func()); } public dispose() { From c8b240433cb6bec2ca4623da6928cc6b8aa7dec7 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 10:57:29 +0000 Subject: [PATCH 22/48] Rename --- src/actions/BringMoveSwap.ts | 2 +- src/actions/CommandAction.ts | 2 +- src/actions/CopyLines.ts | 2 +- src/actions/Delete.ts | 2 +- src/actions/InsertEmptyLines.ts | 2 +- src/actions/Replace.ts | 2 +- src/actions/Wrap.ts | 2 +- src/actions/WrapWithSnippet.ts | 2 +- src/core/NavigationMap.ts | 2 +- src/typings/Types.ts | 2 +- src/util/graphFactories.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index 7431536f18..d984a9765b 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -168,7 +168,7 @@ class BringMoveSwap implements Action { const [updatedSelections]: Selection[][] = await performEditsAndUpdateFullSelectionInfos( - this.graph.selectionUpdater, + this.graph.rangeUpdater, editor, filteredEdits, [selectionInfos] diff --git a/src/actions/CommandAction.ts b/src/actions/CommandAction.ts index 1d5c3743ea..94366bbbc0 100644 --- a/src/actions/CommandAction.ts +++ b/src/actions/CommandAction.ts @@ -49,7 +49,7 @@ export default class CommandAction implements Action { const [updatedOriginalSelections, updatedTargetSelections] = await callFunctionAndUpdateSelections( - this.graph.selectionUpdater, + this.graph.rangeUpdater, () => commands.executeCommand(this.command), editor.document, [originalSelections, targetSelections] diff --git a/src/actions/CopyLines.ts b/src/actions/CopyLines.ts index 64840d46cf..2147ffb000 100644 --- a/src/actions/CopyLines.ts +++ b/src/actions/CopyLines.ts @@ -66,7 +66,7 @@ class CopyLines implements Action { const [updatedSelections, copySelections] = await performEditsAndUpdateSelections( - this.graph.selectionUpdater, + this.graph.rangeUpdater, editor, edits, [ diff --git a/src/actions/Delete.ts b/src/actions/Delete.ts index 22f68a4592..47a21c7169 100644 --- a/src/actions/Delete.ts +++ b/src/actions/Delete.ts @@ -38,7 +38,7 @@ export default class Delete implements Action { })); const [updatedSelections] = await performEditsAndUpdateSelections( - this.graph.selectionUpdater, + this.graph.rangeUpdater, editor, edits, [targets.map((target) => target.selection.selection)] diff --git a/src/actions/InsertEmptyLines.ts b/src/actions/InsertEmptyLines.ts index 0739dab243..415432f2fd 100644 --- a/src/actions/InsertEmptyLines.ts +++ b/src/actions/InsertEmptyLines.ts @@ -56,7 +56,7 @@ class InsertEmptyLines implements Action { const [updatedSelections, lineSelections, updatedOriginalSelections] = await performEditsAndUpdateSelections( - this.graph.selectionUpdater, + this.graph.rangeUpdater, editor, edits, [ diff --git a/src/actions/Replace.ts b/src/actions/Replace.ts index 43587d43ec..953ba4cd09 100644 --- a/src/actions/Replace.ts +++ b/src/actions/Replace.ts @@ -67,7 +67,7 @@ export default class implements Action { (edit) => edit.editor, async (editor, edits) => { const [updatedSelections] = await performEditsAndUpdateSelections( - this.graph.selectionUpdater, + this.graph.rangeUpdater, editor, edits, [targets.map((target) => target.selection.selection)] diff --git a/src/actions/Wrap.ts b/src/actions/Wrap.ts index 8feeda2fd5..0cd11b086b 100644 --- a/src/actions/Wrap.ts +++ b/src/actions/Wrap.ts @@ -94,7 +94,7 @@ export default class Wrap implements Action { const [delimiterSelections, cursorSelections, thatMarkSelections] = await performEditsAndUpdateFullSelectionInfos( - this.graph.selectionUpdater, + this.graph.rangeUpdater, editor, edits, [ diff --git a/src/actions/WrapWithSnippet.ts b/src/actions/WrapWithSnippet.ts index 0737070554..0fc160c4c6 100644 --- a/src/actions/WrapWithSnippet.ts +++ b/src/actions/WrapWithSnippet.ts @@ -98,7 +98,7 @@ export default class WrapWithSnippet implements Action { // NB: We used the command "editor.action.insertSnippet" instead of calling editor.insertSnippet // because the latter doesn't support special variables like CLIPBOARD const [updatedTargetSelections] = await callFunctionAndUpdateSelections( - this.graph.selectionUpdater, + this.graph.rangeUpdater, () => commands.executeCommand("editor.action.insertSnippet", { snippet: snippetString, diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 06acb4c116..7601e411be 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -24,7 +24,7 @@ export default class NavigationMap { currentValue = []; this.documentTokenLists.set(key, currentValue); this.deregisterFunctions.push( - this.graph.selectionUpdater.registerRangeInfoList( + this.graph.rangeUpdater.registerRangeInfoList( document, currentValue ) diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 7fe257f0b8..26f2a2c131 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -327,7 +327,7 @@ export interface Graph { readonly navigationMap: NavigationMap; readonly extensionContext: ExtensionContext; readonly snippets: Snippets; - readonly selectionUpdater: RangeUpdater; + readonly rangeUpdater: RangeUpdater; } export type NodeMatcherValue = { diff --git a/src/util/graphFactories.ts b/src/util/graphFactories.ts index 3dac0bf005..2ef76afff9 100644 --- a/src/util/graphFactories.ts +++ b/src/util/graphFactories.ts @@ -11,7 +11,7 @@ const graphFactories: Partial> = { editStyles: () => new EditStyles(), navigationMap: (graph: Graph) => new NavigationMap(graph), snippets: (graph: Graph) => new Snippets(graph), - selectionUpdater: (graph: Graph) => new RangeUpdater(graph), + rangeUpdater: (graph: Graph) => new RangeUpdater(graph), }; export default graphFactories; From e5ad5c57b18fbfc7ddd9ee068d3b99abc720f10f Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 11:00:28 +0000 Subject: [PATCH 23/48] More renaming --- src/core/updateSelections/updateSelections.ts | 24 +++++++++---------- src/util/performDocumentEdits.ts | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index 591f14e8cf..98daab0806 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -99,7 +99,7 @@ export function selectionInfosToSelections( * @returns The initial selections updated based upon what happened in the function */ export async function callFunctionAndUpdateSelections( - selectionUpdater: RangeUpdater, + rangeUpdater: RangeUpdater, func: () => Thenable, document: TextDocument, selectionMatrix: Selection[][] @@ -110,7 +110,7 @@ export async function callFunctionAndUpdateSelections( ); return await callFunctionAndUpdateSelectionInfos( - selectionUpdater, + rangeUpdater, func, document, selectionInfoMatrix @@ -126,12 +126,12 @@ export async function callFunctionAndUpdateSelections( * @returns The initial selections updated based upon what happened in the function */ export async function callFunctionAndUpdateSelectionInfos( - selectionUpdater: RangeUpdater, + rangeUpdater: RangeUpdater, func: () => Thenable, document: TextDocument, selectionInfoMatrix: FullSelectionInfo[][] ) { - const unsubscribe = selectionUpdater.registerRangeInfoList( + const unsubscribe = rangeUpdater.registerRangeInfoList( document, flatten(selectionInfoMatrix) ); @@ -152,7 +152,7 @@ export async function callFunctionAndUpdateSelectionInfos( * @returns The updated selections */ export async function performEditsAndUpdateSelections( - selectionUpdater: RangeUpdater, + rangeUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelections: Selection[][] @@ -164,7 +164,7 @@ export async function performEditsAndUpdateSelections( ); await performEditsAndUpdateFullSelectionInfos( - selectionUpdater, + rangeUpdater, editor, edits, selectionInfoMatrix @@ -174,7 +174,7 @@ export async function performEditsAndUpdateSelections( } export async function performEditsAndUpdateSelectionInfos( - selectionUpdater: RangeUpdater, + rangeUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: SelectionInfo[][] @@ -182,7 +182,7 @@ export async function performEditsAndUpdateSelectionInfos( fillOutSelectionInfos(editor.document, originalSelectionInfos); return await performEditsAndUpdateFullSelectionInfos( - selectionUpdater, + rangeUpdater, editor, edits, originalSelectionInfos as FullSelectionInfo[][] @@ -190,7 +190,7 @@ export async function performEditsAndUpdateSelectionInfos( } export async function performEditsAndUpdateFullSelectionInfos( - selectionUpdater: RangeUpdater, + rangeUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: FullSelectionInfo[][] @@ -214,7 +214,7 @@ export async function performEditsAndUpdateFullSelectionInfos( // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts#L598-L604 // See also // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts#L464 - // - We should have a component on the graph called graph.selectionUpdater + // - We should have a component on the graph called graph.rangeUpdater // - It will support registering a list of selections to keep up-to-date, and // it returns a dispose function. // - It also has a function that allows callers to register isReplace edits, @@ -226,7 +226,7 @@ export async function performEditsAndUpdateFullSelectionInfos( const func = async () => { const wereEditsApplied = await performDocumentEdits( - selectionUpdater, + rangeUpdater, editor, edits ); @@ -237,7 +237,7 @@ export async function performEditsAndUpdateFullSelectionInfos( }; await callFunctionAndUpdateSelectionInfos( - selectionUpdater, + rangeUpdater, func, editor.document, originalSelectionInfos diff --git a/src/util/performDocumentEdits.ts b/src/util/performDocumentEdits.ts index 64eb9f4246..bbb13c1d15 100644 --- a/src/util/performDocumentEdits.ts +++ b/src/util/performDocumentEdits.ts @@ -3,11 +3,11 @@ import { TextEditor } from "vscode"; import { RangeUpdater } from "../core/updateSelections/RangeUpdater"; export async function performDocumentEdits( - selectionUpdater: RangeUpdater, + rangeUpdater: RangeUpdater, editor: TextEditor, edits: Edit[] ) { - const deregister = selectionUpdater.registerReplaceEditList( + const deregister = rangeUpdater.registerReplaceEditList( editor.document, edits.filter((edit) => edit.isReplace) ); From 811023f2ac8c286dd708108fda0daed6e1523b8f Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 11:30:11 +0000 Subject: [PATCH 24/48] Navigation map disposal --- src/core/NavigationMap.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 7601e411be..30cbe3f603 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -1,7 +1,6 @@ -import { TextDocumentChangeEvent, Range, TextDocument } from "vscode"; +import { TextDocument } from "vscode"; import { HatStyleName } from "./constants"; -import { Graph, SelectionWithEditor, Token } from "../typings/Types"; -import { getDefault } from "../util/map"; +import { Graph, Token } from "../typings/Types"; /** * Maps from (hatStyle, character) pairs to tokens @@ -14,7 +13,9 @@ export default class NavigationMap { [decoratedCharacter: string]: Token; } = {}; - constructor(private graph: Graph) {} + constructor(private graph: Graph) { + graph.extensionContext.subscriptions.push(this); + } private getDocumentTokenList(document: TextDocument) { const key = document.uri.toString(); @@ -24,10 +25,7 @@ export default class NavigationMap { currentValue = []; this.documentTokenLists.set(key, currentValue); this.deregisterFunctions.push( - this.graph.rangeUpdater.registerRangeInfoList( - document, - currentValue - ) + this.graph.rangeUpdater.registerRangeInfoList(document, currentValue) ); } From 83abf914bc52a32b92a3acef02a90f872321d4c4 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 12:24:59 +0000 Subject: [PATCH 25/48] Add documentation to graph --- src/typings/Types.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 26f2a2c131..a3ec001b7b 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -322,11 +322,37 @@ export type ActionType = export type ActionRecord = Record; export interface Graph { + /** + * Keeps a map from action names to objects that implement the given action + */ readonly actions: ActionRecord; + + /** + * Maintains decorations that can be used to visually indicate to the user + * the targets of their actions. + */ readonly editStyles: EditStyles; + + /** + * Keeps a map of all decorated marks + */ readonly navigationMap: NavigationMap; + + /** + * The extension context passed in during extension activation + */ readonly extensionContext: ExtensionContext; + + /** + * Keeps a merged list of all user-contributed, core, and + * extension-contributed cursorless snippets + */ readonly snippets: Snippets; + + /** + * This component can be used to register a list of ranges to keep up to date + * as the document changes + */ readonly rangeUpdater: RangeUpdater; } From 538e993195afcc7833e2aeb1fe7fc0cf30ba6146 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 12:33:06 +0000 Subject: [PATCH 26/48] More documentation --- src/core/updateSelections/RangeUpdater.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/updateSelections/RangeUpdater.ts b/src/core/updateSelections/RangeUpdater.ts index c5dd0fc61b..2ebf22b06e 100644 --- a/src/core/updateSelections/RangeUpdater.ts +++ b/src/core/updateSelections/RangeUpdater.ts @@ -54,12 +54,16 @@ export class RangeUpdater { /** * Registers a list of edits to treat as replace edits. These edits are - * insertions that will not shift an empty selection to the right. + * insertions that will not shift an empty selection to the right. Call this + * function before applying your edits to the document + * + * Note that if you make two edits at the same location with the same text, + * it is not possible to mark only one of them as replace edit. * * It is ok to add to this list after registering it; any items in the list - * at the time of a document change will be kept up to date. Please be sure - * to call the returned deregister function when you no longer need the ranges - * updated. + * at the time of a document change will be treated as replace edits. Please + * be sure to call the returned deregister function after you have waited for + * your edits to be applied. * @param document The document containing the ranges * @param replaceEditList A list of edits to treat as replace edits; it is ok to add to this list after the fact * @returns A function that can be used to deregister the list From 02f4f1da1d5ad27473519e2b1d77713ecc98f396 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 2 Nov 2021 13:47:30 +0000 Subject: [PATCH 27/48] Add comments --- .../getOffsetsForDeleteOrReplace.ts | 23 ++++++++++- .../getOffsetsForEmptyRangeInsert.ts | 27 +++++++++++- .../getOffsetsForNonEmptyRangeInsert.ts | 27 +++++++++++- src/core/updateSelections/updateRangeInfos.ts | 41 +++++++++++++++++-- 4 files changed, 112 insertions(+), 6 deletions(-) diff --git a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts index 40e921024f..623f504992 100644 --- a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts +++ b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -5,7 +5,28 @@ import { RangeOffsets, } from "../../typings/updateSelections"; -export function getOffsetsForDeleteOrReplace( +/** + * Gets updated offsets for the range `rangeInfo` after the change described by + * `changeEventInfo`. This function will only be called if the following hold: + * + * - the change is a delete or replace event, ie a change event for which the + * original range is nonempty, and + * - the change's original range overlaps with or is directly adjacent to the + * range to be updated. + * + * There are many ways one might handle replaces and deletes. We opt for a + * relatively simple approach. We attempt to keep both the start and end + * offsets as close as possible to what they were prior to the change. We + * handle start and end offsets independently. For each edge (start or end), + * we move it to the left only if it was contained in the original range, and + * it will now be to the right of the new range. We just clamp it so that + * it will match the end of the new change range in that case. + * + * @param changeEventInfo Information about the change that occurred + * @param rangeInfo The range to compute new offsets for + * @returns The new offsets for the given range + */ +export default function getOffsetsForDeleteOrReplace( changeEventInfo: ChangeEventInfo, rangeInfo: FullRangeInfo ): RangeOffsets { diff --git a/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts b/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts index 3f232f42cc..b453864490 100644 --- a/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts +++ b/src/core/updateSelections/getOffsetsForEmptyRangeInsert.ts @@ -6,7 +6,32 @@ import { RangeOffsets, } from "../../typings/updateSelections"; -export function getOffsetsForEmptyRangeInsert( +/** + * Gets updated offsets for the range `rangeInfo` after the change described by + * `changeEventInfo`. This function will only be called if the following hold: + * + * - the change is an insert event, ie a change event for which the + * original range is empty, and + * - the range to be updated is empty, and + * - the insertion position is equal to the position of the empty range to be + * updated. + * + * The approach taken here is to first look at the `isReplace` field of the + * change to determine whether it should shift empty ranges to the right. If + * it shifts them to the right, we then look at its left / start expansion + * behaviour. If does not shift empty ranges, then we look at its right / end + * expansion behaviour. + * + * If the given expansion behaviour is "open", we expand to contain the new + * text, if "closed" we do not expand, and if "regex", we expand to contain as + * much of the inserted text as matches the given regex, anchored at the + * opposite end. + * + * @param changeEventInfo Information about the change that occurred + * @param rangeInfo The range to compute new offsets for + * @returns The new offsets for the given range + */ +export default function getOffsetsForEmptyRangeInsert( changeEventInfo: ChangeEventInfo, rangeInfo: FullRangeInfo ): RangeOffsets { diff --git a/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts b/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts index 8370e192b0..1ea93a3a63 100644 --- a/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts +++ b/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts @@ -6,7 +6,32 @@ import { RangeOffsets, } from "../../typings/updateSelections"; -export function getOffsetsForNonEmptyRangeInsert( +/** + * Gets updated offsets for the range `rangeInfo` after the change described by + * `changeEventInfo`. This function will only be called if the following hold: + * + * - the change is an insert event, ie a change event for which the + * original range is empty, + * - the range to be updated is nonempty, and + * - the insertion position is non-strictly contained by the range to be + * updated, ie inside the range or at its start or end. + * + * The approach taken here is to leave the selection unchanged in the case of + * internal insertions (ie insertion position is strictly greater than start + * and strictly less than end). In that case, we just update the position of + * the range end position to take into account the shift from the insertion. + * + * In the case of insertions that are at the beginning or end of the range, we + * look at the `expansionBehavior` of the given end of the range. If it is + * "open", we expand to contain the new text, if "closed" we do not expand, + * and if "regex" we anchor the regex at the other end of the range and see + * how far it extends into the newly inserted text. + * + * @param changeEventInfo Information about the change that occurred + * @param rangeInfo The range to compute new offsets for + * @returns The new offsets for the given range + */ +export default function getOffsetsForNonEmptyRangeInsert( changeEventInfo: ChangeEventInfo, rangeInfo: FullRangeInfo ): RangeOffsets { diff --git a/src/core/updateSelections/updateRangeInfos.ts b/src/core/updateSelections/updateRangeInfos.ts index c4efdfd3bf..fd7c49f8ef 100644 --- a/src/core/updateSelections/updateRangeInfos.ts +++ b/src/core/updateSelections/updateRangeInfos.ts @@ -1,7 +1,7 @@ import { sumBy } from "lodash"; -import { getOffsetsForDeleteOrReplace } from "./getOffsetsForDeleteOrReplace"; -import { getOffsetsForEmptyRangeInsert } from "./getOffsetsForEmptyRangeInsert"; -import { getOffsetsForNonEmptyRangeInsert } from "./getOffsetsForNonEmptyRangeInsert"; +import getOffsetsForDeleteOrReplace from "./getOffsetsForDeleteOrReplace"; +import getOffsetsForEmptyRangeInsert from "./getOffsetsForEmptyRangeInsert"; +import getOffsetsForNonEmptyRangeInsert from "./getOffsetsForNonEmptyRangeInsert"; import { ExtendedTextDocumentChangeEvent, FullRangeInfo, @@ -10,6 +10,22 @@ import { } from "../../typings/updateSelections"; import { getUpdatedText } from "./getUpdatedText"; +/** + * Iterates through the given range infos and updates them to take into account + * the given changes. + * + * For a given range / change pair, if the given change original range doesn't + * overlap with and is not adjacent to the range to update, the range will just + * be shifted as necessary if it is after the change range. + * + * For a range / change pair that are adjacent or have some overlap, delegate + * to the functions `getOffsetsForDeleteOrReplace`, + * `getOffsetsForEmptyRangeInsert`, and `getOffsetsForNonEmptyRangeInsert`. + * See their documentation for information about how these cases are handled. + * + * @param changeEvent Information about the change that occurred + * @param rangeInfoGenerator A generator yielding `FullRangeInfo`s to update + */ export function updateRangeInfos( changeEvent: ExtendedTextDocumentChangeEvent, rangeInfoGenerator: Generator @@ -23,6 +39,7 @@ export function updateRangeInfos( changeOriginalStartOffset + change.rangeLength; const changeFinalStartOffset = changeOriginalStartOffset; const changeFinalEndOffset = changeOriginalEndOffset + changeDisplacement; + return { displacement: changeDisplacement, event: change, @@ -40,9 +57,19 @@ export function updateRangeInfos( for (const rangeInfo of rangeInfoGenerator) { const originalOffsets = rangeInfo.offsets; + // NB: We just collect displacements for both ends of the range and then + // add them up after we've processed all changes. This way we can treat + // the changes completely independently. + // + // Note that VSCode gives us the list of changes in an order that is in + // reverse document order. If two edits occur at the same location, it + // will give us the edits in the reverse order in which the edits were + // created in an editBuilder, so that if we were to apply the edits one + // after the other, the first edit would appear first in the new document. const displacements = changeEventInfos.map((changeEventInfo) => { let newOffsets: RangeOffsets; + // Easy case 1: edit occurred strictly after the range; nothing to do if (changeEventInfo.originalOffsets.start > originalOffsets.end) { return { start: 0, @@ -50,6 +77,8 @@ export function updateRangeInfos( }; } + // Easy case 2: edit occurred strictly before the range; just shift start + // and end of range as necessary to accommodate displacement from edit. if (changeEventInfo.originalOffsets.end < originalOffsets.start) { return { start: changeEventInfo.displacement, @@ -57,6 +86,7 @@ export function updateRangeInfos( }; } + // Handle the hard cases if (changeEventInfo.event.rangeLength === 0) { if (rangeInfo.range.isEmpty) { newOffsets = getOffsetsForEmptyRangeInsert( @@ -73,19 +103,24 @@ export function updateRangeInfos( newOffsets = getOffsetsForDeleteOrReplace(changeEventInfo, rangeInfo); } + // Update the text field to match what it will actually be after the + // given edit. We use this text field when doing regex-based expansion. rangeInfo.text = getUpdatedText(changeEventInfo, rangeInfo, newOffsets); + // Convert to displacements rather than document offsets return { start: newOffsets.start - originalOffsets.start, end: newOffsets.end - originalOffsets.end, }; }); + // Add up all the displacements const newOffsets = { start: originalOffsets.start + sumBy(displacements, ({ start }) => start), end: originalOffsets.end + sumBy(displacements, ({ end }) => end), }; + // Do final range and offset update rangeInfo.range = rangeInfo.range.with( document.positionAt(newOffsets.start), document.positionAt(newOffsets.end) From 0c2ed1ba924aca7e040cfe20cac6a2779a91b13c Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 18:08:53 +0000 Subject: [PATCH 28/48] More comments --- src/core/updateSelections/getUpdatedText.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/core/updateSelections/getUpdatedText.ts b/src/core/updateSelections/getUpdatedText.ts index e7f03524c5..99b49898ce 100644 --- a/src/core/updateSelections/getUpdatedText.ts +++ b/src/core/updateSelections/getUpdatedText.ts @@ -4,6 +4,19 @@ import { RangeOffsets, } from "../../typings/updateSelections"; +/** + * Updates the text of the given rangeInfo to take into account the given change. + * + * The process is to first include any text from the original range that is + * before the range of the change, then add the text of the change, then add any + * text that trails the original change range. Then we take a substring + * corresponding to the range's new offsets. + * + * @param changeEventInfo The change to incorporate + * @param rangeInfo The rangeInfo to update + * @param newOffsets The new offsets that the rangeInfo will have + * @returns The new text of the range + */ export function getUpdatedText( changeEventInfo: ChangeEventInfo, rangeInfo: FullRangeInfo, @@ -13,6 +26,7 @@ export function getUpdatedText( changeEventInfo.originalOffsets; const { start: rangeOriginalOffsetsStart, end: rangeOriginalOffsetsEnd } = rangeInfo.offsets; + const newTextStartOffset = Math.min( changeOriginalOffsetsStart, rangeOriginalOffsetsStart @@ -20,6 +34,7 @@ export function getUpdatedText( let result = ""; + // First add any text from the range before the start of the change range if (rangeOriginalOffsetsStart < changeOriginalOffsetsStart) { result += rangeInfo.text.substring( 0, @@ -27,8 +42,10 @@ export function getUpdatedText( ); } + // Then add the text of the change result += changeEventInfo.event.text; + // Then add any text that was after the original change range if (changeOriginalOffsetsEnd < rangeOriginalOffsetsEnd) { result += rangeInfo.text.substring( rangeOriginalOffsetsEnd - changeOriginalOffsetsEnd, @@ -36,6 +53,7 @@ export function getUpdatedText( ); } + // Then take a substring based on the range's new offsets return result.substring( newOffsets.start - newTextStartOffset, newOffsets.end - newTextStartOffset From c5f01ff83937ced9c2346b7fc65f946eed52713e Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 18:11:57 +0000 Subject: [PATCH 29/48] Fix comment --- src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts b/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts index 1ea93a3a63..fa9e58b782 100644 --- a/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts +++ b/src/core/updateSelections/getOffsetsForNonEmptyRangeInsert.ts @@ -119,7 +119,7 @@ export default function getOffsetsForNonEmptyRangeInsert( let matches = text.match(regex); let matchLength = matches == null ? 0 : matches[0].length; while (matchLength !== 0 && matchLength < originalRangeText.length) { - // If the original range contains multiple matching instances of the regex use the leftmost one + // If the original range contains multiple matching instances of the regex use the rightmost one text = originalRangeText.slice(matchLength) + insertedText; matches = text.match(regex); matchLength = matches == null ? 0 : matchLength + matches[0].length; From 240d99e20a800584299ccd86943db2555a5abd83 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 18:24:50 +0000 Subject: [PATCH 30/48] More doc updates --- src/core/updateSelections/updateSelections.ts | 65 ++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index 98daab0806..b238bd880a 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -14,6 +14,15 @@ import { isForward } from "../../util/selectionUtils"; import { Edit } from "../../typings/Types"; import { RangeUpdater } from "./RangeUpdater"; +/** + * Given a selection, this function creates a `SelectionInfo` object that can + * be passed in to any of the commands that update selections. + * + * @param document The document containing the selection + * @param selection The selection + * @param rangeBehavior How selection should behave with respect to insertions on either end + * @returns An object that can be used for selection tracking + */ export function getSelectionInfo( document: TextDocument, selection: Selection, @@ -46,17 +55,22 @@ export function getSelectionInfo( }; } +/** + * Creates SelectionInfo objects for all selections in a list of lists. + * + * @param document The document containing the selections + * @param selectionMatrix A list of lists of selections + * @param rangeBehavior How selections should behave with respect to insertions on either end + * @returns A list of lists of selection info objects + */ export function selectionsToSelectionInfos( document: TextDocument, - selectionMatrix: Selection[][] + selectionMatrix: Selection[][], + rangeBehavior: DecorationRangeBehavior = DecorationRangeBehavior.ClosedClosed ): FullSelectionInfo[][] { return selectionMatrix.map((selections) => selections.map((selection) => - getSelectionInfo( - document, - selection, - DecorationRangeBehavior.ClosedClosed - ) + getSelectionInfo(document, selection, rangeBehavior) ) ); } @@ -80,7 +94,7 @@ function fillOutSelectionInfos( return true; } -export function selectionInfosToSelections( +function selectionInfosToSelections( selectionInfoMatrix: SelectionInfo[][] ): Selection[][] { return selectionInfoMatrix.map((selectionInfos) => @@ -93,8 +107,9 @@ export function selectionInfosToSelections( /** * Calls the given function and updates the given selections based on the * changes that occurred as a result of calling function. + * @param rangeUpdater A RangeUpdate instance that will perform actual range updating * @param func The function to call - * @param editor The editor containing the selections + * @param document The document containing the selections * @param selectionMatrix A matrix of selections to update * @returns The initial selections updated based upon what happened in the function */ @@ -120,9 +135,10 @@ export async function callFunctionAndUpdateSelections( /** * Calls the given function and updates the given selections based on the * changes that occurred as a result of calling function. + * @param rangeUpdater A RangeUpdate instance that will perform actual range updating * @param func The function to call - * @param editor The editor containing the selections - * @param selectionMatrix A matrix of selections to update + * @param document The document containing the selections + * @param selectionMatrix A matrix of selection info objects to update * @returns The initial selections updated based upon what happened in the function */ export async function callFunctionAndUpdateSelectionInfos( @@ -146,6 +162,7 @@ export async function callFunctionAndUpdateSelectionInfos( /** * Performs a list of edits and returns the given selections updated based on * the applied edits + * @param rangeUpdater A RangeUpdate instance that will perform actual range updating * @param editor The editor containing the selections * @param edits A list of edits to apply * @param originalSelections The selections to update @@ -173,6 +190,7 @@ export async function performEditsAndUpdateSelections( return selectionInfosToSelections(selectionInfoMatrix); } +// TODO: Remove this function if we don't end up using it for the next couple use cases, eg `that` mark and cursor history export async function performEditsAndUpdateSelectionInfos( rangeUpdater: RangeUpdater, editor: TextEditor, @@ -189,19 +207,25 @@ export async function performEditsAndUpdateSelectionInfos( ); } +/** + * Performs a list of edits and returns the given selections updated based on + * the applied edits + * @param rangeUpdater A RangeUpdate instance that will perform actual range updating + * @param editor The editor containing the selections + * @param edits A list of edits to apply + * @param originalSelectionInfos The selection info objects to update + * @returns The updated selections + */ export async function performEditsAndUpdateFullSelectionInfos( rangeUpdater: RangeUpdater, editor: TextEditor, edits: Edit[], originalSelectionInfos: FullSelectionInfo[][] ) { - // TODO: Do everything using VSCode listeners. We can associate changes with - // our changes just by looking at their offets / text in order to recover - // isReplace. We need to do this because VSCode does some fancy stuff, and - // returns the changes in a nice order - // So this function would prob mostly go away, and everything would basically - // just be a version of callFunctionAndUpdateSelections, or just call that - // directly + // NB: We do everything using VSCode listeners. We can associate changes + // with our changes just by looking at their offets / text in order to + // recover isReplace. We need to do this because VSCode does some fancy + // stuff, and returns the changes in a nice order // Note that some additional weird edits like whitespace things can be // created by VSCode I believe, and they change order, so we can't just zip // their changes with ours. @@ -214,15 +238,12 @@ export async function performEditsAndUpdateFullSelectionInfos( // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts#L598-L604 // See also // https://github.com/microsoft/vscode/blob/174db5eb992d880adcc42c41d83a0e6cb6b92474/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts#L464 - // - We should have a component on the graph called graph.rangeUpdater - // - It will support registering a list of selections to keep up-to-date, and + // - We have a component on the graph called graph.rangeUpdater + // - It supports registering a list of selections to keep up-to-date, and // it returns a dispose function. // - It also has a function that allows callers to register isReplace edits, // and it will look those up when it receives edits in order to set that // field. - // - It should probably just store a list of lists of selectionInfos, and - // just remove the corresponding list when it gets deregistered - // - Should clients register one list at a time or a list of lists? const func = async () => { const wereEditsApplied = await performDocumentEdits( From 07803b19f15d9bebcafd68497cdf76c4ea46f399 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 18:30:58 +0000 Subject: [PATCH 31/48] More cleanup --- src/processTargets/processMark.ts | 41 +++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/processTargets/processMark.ts b/src/processTargets/processMark.ts index e68a52dfd7..64f4efa72a 100644 --- a/src/processTargets/processMark.ts +++ b/src/processTargets/processMark.ts @@ -32,13 +32,43 @@ export default function ( } } +/** + * Returns tokens that intersect with the selection that may be relevant for + * expanding the selection to its containing token. + * @param selection The selection + * @returns All tokens that intersect with the selection and are on the same line as the start or endpoint of the selection + */ function getTokenIntersectionsForSelection(selection: SelectionWithEditor) { + let tokens = getRelevantTokens(selection); + + const tokenIntersections: { token: PartialToken; intersection: Range }[] = []; + + tokens.forEach((token) => { + const intersection = token.range.intersection(selection.selection); + if (intersection != null) { + tokenIntersections.push({ token, intersection }); + } + }); + + return tokenIntersections; +} + +/** + * Given a selection, finds all tokens that we might use to expand the + * selection. Just looks at tokens on the same line as the start and end of the + * selection, because we assume that a token cannot span multiple lines. + * @param selection The selection we care about + * @returns A list of tokens that we might expand to + */ +function getRelevantTokens(selection: SelectionWithEditor) { const startLine = selection.selection.start.line; const endLine = selection.selection.end.line; + let tokens = getTokensInRange( selection.editor, selection.editor.document.lineAt(startLine).range ); + if (endLine !== startLine) { tokens.push( ...getTokensInRange( @@ -48,16 +78,7 @@ function getTokenIntersectionsForSelection(selection: SelectionWithEditor) { ); } - const tokenIntersections: { token: PartialToken; intersection: Range }[] = []; - - tokens.forEach((token) => { - const intersection = token.range.intersection(selection.selection); - if (intersection != null) { - tokenIntersections.push({ token, intersection }); - } - }); - - return tokenIntersections; + return tokens; } /** From dcf9521b0c74bb7c345754a6743797d762099940 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 18:36:21 +0000 Subject: [PATCH 32/48] Doc string --- src/util/map.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/map.ts b/src/util/map.ts index 3deb17d836..6603403b53 100644 --- a/src/util/map.ts +++ b/src/util/map.ts @@ -1,3 +1,11 @@ +/** + * Returns value at key in map, creating it using factory if it doesn't exist. + * Behaves a bit like Python defaultdicts. + * @param map The map to check / update + * @param key The key to look for + * @param factory A factory used to construct missing values + * @returns The existing value, or the new one if constructed + */ export function getDefault(map: Map, key: K, factory: () => V): V { let currentValue = map.get(key); From 8499d827751de3831edb70d0906854c2af82c985 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 22:00:44 +0000 Subject: [PATCH 33/48] Improve bring; add a bunch of tests --- src/actions/BringMoveSwap.ts | 20 ++++++-- .../getOffsetsForDeleteOrReplace.ts | 5 +- src/core/updateSelections/updateSelections.ts | 3 +- .../recorded/updateSelections/bringFine.yml | 35 ++++++++++++++ .../bringFineAfterThirdCar.yml | 33 +++++++++++++ .../bringFineAfterThirdCarThis.yml | 34 +++++++++++++ .../updateSelections/bringFineAfterThis.yml | 32 +++++++++++++ .../updateSelections/bringFineAfterThis2.yml | 32 +++++++++++++ .../updateSelections/bringFineBeforeThis.yml | 32 +++++++++++++ .../bringFineToFirstCarWhale.yml | 36 ++++++++++++++ .../bringFineToFirstTwoCar.yml | 32 +++++++++++++ .../bringFineToLastCarWhale.yml | 36 ++++++++++++++ .../bringFineToLastTwoCar.yml | 32 +++++++++++++ .../bringFineToThirdCarWhale.yml | 36 ++++++++++++++ .../updateSelections/bringFineToWhale.yml | 34 +++++++++++++ .../updateSelections/bringFineToWhale2.yml | 34 +++++++++++++ .../updateSelections/bringFineToWhale3.yml | 34 +++++++++++++ .../updateSelections/bringFineToWhale4.yml | 34 +++++++++++++ .../updateSelections/bringFineToWhale5.yml | 34 +++++++++++++ .../bringHarpToEndOfWhale.yml | 36 ++++++++++++++ ...gHarpToFourthCarWhalePastSecondCarHarp.yml | 45 +++++++++++++++++ ...ingHarpToSecondCarFinePastThirdCarHarp.yml | 45 +++++++++++++++++ ...ngHarpToSecondCarFinePastThirdCarWhale.yml | 48 +++++++++++++++++++ .../bringHarpToStartOfWhale.yml | 36 ++++++++++++++ .../updateSelections/bringTailToFine.yml | 31 ++++++++++++ .../recorded/updateSelections/bringWhale.yml | 35 ++++++++++++++ .../updateSelections/bringWhaleAfterFine.yml | 35 ++++++++++++++ .../updateSelections/bringWhaleAfterThis.yml | 32 +++++++++++++ .../updateSelections/bringWhaleAfterThis2.yml | 32 +++++++++++++ .../updateSelections/bringWhaleBeforeThis.yml | 32 +++++++++++++ .../bringWhaleToEndOfFine.yml | 36 ++++++++++++++ .../updateSelections/bringWhaleToFine.yml | 34 +++++++++++++ .../updateSelections/chuckFirstCarWhale.yml | 28 +++++++++++ .../chuckFirstPastSecondCar.yml | 24 ++++++++++ .../chuckFourthPastFifthCar.yml | 24 ++++++++++ .../updateSelections/chuckLastCarWhale.yml | 28 +++++++++++ .../chuckSecondCarFinePastThirdCarWhale.yml | 40 ++++++++++++++++ .../chuckSecondPastThirdCar.yml | 24 ++++++++++ .../chuckThirdCarWhalePastSecondCarHarp.yml | 40 ++++++++++++++++ 39 files changed, 1247 insertions(+), 6 deletions(-) create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFine.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml create mode 100644 src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml diff --git a/src/actions/BringMoveSwap.ts b/src/actions/BringMoveSwap.ts index d984a9765b..f40e0911f1 100644 --- a/src/actions/BringMoveSwap.ts +++ b/src/actions/BringMoveSwap.ts @@ -108,6 +108,7 @@ class BringMoveSwap implements Action { editor: destination.selection.editor, originalSelection: destination, isSource: false, + isReplace: destination.position === "after", }, ]; @@ -137,6 +138,7 @@ class BringMoveSwap implements Action { editor: source.selection.editor, originalSelection: source, isSource: true, + isReplace: false, }); } @@ -158,7 +160,7 @@ class BringMoveSwap implements Action { ? edits : edits.filter(({ isSource }) => !isSource); - const selectionInfos = edits.map(({ originalSelection }) => + const editSelectionInfos = edits.map(({ originalSelection }) => getSelectionInfo( editor.document, originalSelection.selection.selection, @@ -166,16 +168,26 @@ class BringMoveSwap implements Action { ) ); - const [updatedSelections]: Selection[][] = + const cursorSelectionInfos = editor.selections.map((selection) => + getSelectionInfo( + editor.document, + selection, + DecorationRangeBehavior.ClosedClosed + ) + ); + + const [updatedEditSelections, cursorSelections]: Selection[][] = await performEditsAndUpdateFullSelectionInfos( this.graph.rangeUpdater, editor, filteredEdits, - [selectionInfos] + [editSelectionInfos, cursorSelectionInfos] ); + editor.selections = cursorSelections; + return edits.map((edit, index) => { - const selection = updatedSelections[index]; + const selection = updatedEditSelections[index]; return { editor, selection, diff --git a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts index 623f504992..eef29dd579 100644 --- a/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts +++ b/src/core/updateSelections/getOffsetsForDeleteOrReplace.ts @@ -53,7 +53,10 @@ export default function getOffsetsForDeleteOrReplace( ); return { - start: Math.min(rangeStart, changeFinalEndOffset), + start: + changeOriginalEndOffset <= rangeStart + ? rangeStart + displacement + : Math.min(rangeStart, changeFinalEndOffset), end: changeOriginalEndOffset <= rangeEnd ? rangeEnd + displacement diff --git a/src/core/updateSelections/updateSelections.ts b/src/core/updateSelections/updateSelections.ts index b238bd880a..6f3b4c1279 100644 --- a/src/core/updateSelections/updateSelections.ts +++ b/src/core/updateSelections/updateSelections.ts @@ -3,6 +3,7 @@ import { TextEditor, TextDocument, DecorationRangeBehavior, + Range, } from "vscode"; import { flatten } from "lodash"; import { @@ -29,7 +30,7 @@ export function getSelectionInfo( rangeBehavior: DecorationRangeBehavior ): FullSelectionInfo { return { - range: selection, + range: new Range(selection.start, selection.end), isForward: isForward(selection), expansionBehavior: { start: { diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml new file mode 100644 index 0000000000..17d1c9c258 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml @@ -0,0 +1,35 @@ +spokenForm: bring fine +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: cursor} + selectionType: token + position: contents + modifier: {type: identity} + insideOutsideType: inside + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: foo fooworld + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml new file mode 100644 index 0000000000..14b5dd06c3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml @@ -0,0 +1,33 @@ +spokenForm: bring fine after third car +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + position: after + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foofoo world whatever + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 12} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 6} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml new file mode 100644 index 0000000000..c31800c15d --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml @@ -0,0 +1,34 @@ +spokenForm: bring fine after third car this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: cursor} + position: after + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo worfoold whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 12} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 10} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml new file mode 100644 index 0000000000..21d94bfeb1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml @@ -0,0 +1,32 @@ +spokenForm: bring fine after this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: cursor} + position: after + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: foo fooworld + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 8} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml new file mode 100644 index 0000000000..f9aa2e7d50 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml @@ -0,0 +1,32 @@ +spokenForm: bring fine after this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: cursor} + position: after + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +finalState: + documentContents: foo world foo + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 13} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml new file mode 100644 index 0000000000..6a90ca8f2f --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml @@ -0,0 +1,32 @@ +spokenForm: bring fine before this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: cursor} + position: before + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: foo foo world + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 8} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: before, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml new file mode 100644 index 0000000000..61a82f7928 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml @@ -0,0 +1,36 @@ +spokenForm: bring fine to first car whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} +finalState: + documentContents: foo fooorld whatever + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 10} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml new file mode 100644 index 0000000000..f3176acbd8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml @@ -0,0 +1,32 @@ +spokenForm: bring fine to first two car +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo foorld whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 10} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursorToken}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml new file mode 100644 index 0000000000..870447b919 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml @@ -0,0 +1,36 @@ +spokenForm: bring fine to last car whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} +finalState: + documentContents: foo worlfoo whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 11} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml new file mode 100644 index 0000000000..4907a9e486 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml @@ -0,0 +1,32 @@ +spokenForm: bring fine to last two car +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo worfoo whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 10} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 10} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursorToken}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml new file mode 100644 index 0000000000..5d819c076d --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml @@ -0,0 +1,36 @@ +spokenForm: bring fine to third car whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo wofoold whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml new file mode 100644 index 0000000000..42c3ab20cd --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml @@ -0,0 +1,34 @@ +spokenForm: bring fine to whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: foo foo + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml new file mode 100644 index 0000000000..0d1e5c8cc1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml @@ -0,0 +1,34 @@ +spokenForm: bring fine to whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +finalState: + documentContents: foo foo + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml new file mode 100644 index 0000000000..2634177741 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml @@ -0,0 +1,34 @@ +spokenForm: bring fine to whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +finalState: + documentContents: foo foo + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml new file mode 100644 index 0000000000..46c9ff23d8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml @@ -0,0 +1,34 @@ +spokenForm: bring fine to whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 7} +finalState: + documentContents: foo foo + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml new file mode 100644 index 0000000000..4b55a56502 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml @@ -0,0 +1,34 @@ +spokenForm: bring fine to whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} +finalState: + documentContents: foo foo whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml new file mode 100644 index 0000000000..94d9a6180c --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml @@ -0,0 +1,36 @@ +spokenForm: bring harp to end of whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo worldwhatever whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 17} + sourceMark: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 26} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml new file mode 100644 index 0000000000..7acbdc0cea --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml @@ -0,0 +1,45 @@ +spokenForm: bring harp to fourth car whale past second car harp +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: h} + excludeStart: false + excludeEnd: false + extraArgs: [] +marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo worwhateveratever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 15} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 21} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml new file mode 100644 index 0000000000..b13d960985 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml @@ -0,0 +1,45 @@ +spokenForm: bring harp to second car fine past third car harp +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: f} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: h} + excludeStart: false + excludeEnd: false + extraArgs: [] +marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 27} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world whateverspaghetti + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: fwhateverspaghettiteverspaghetti + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 18} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 32} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml new file mode 100644 index 0000000000..0203b81357 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml @@ -0,0 +1,48 @@ +spokenForm: bring harp to second car fine past third car whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: f} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + excludeStart: false + excludeEnd: false + extraArgs: [] +marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: fwhateverld whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 20} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml new file mode 100644 index 0000000000..f5616fd8ce --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml @@ -0,0 +1,36 @@ +spokenForm: bring harp to start of whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo whateverworld whatever + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 17} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 12} + sourceMark: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 26} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml new file mode 100644 index 0000000000..fa81acb44e --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml @@ -0,0 +1,31 @@ +spokenForm: bring tail to fine +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + modifier: {type: tail} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: " world" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 6} + sourceMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: tail}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: tail}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml new file mode 100644 index 0000000000..e059d87b22 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml @@ -0,0 +1,35 @@ +spokenForm: bring whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + mark: {type: cursor} + selectionType: token + position: contents + modifier: {type: identity} + insideOutsideType: inside + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: fooworld world + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 8} + sourceMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 14} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml new file mode 100644 index 0000000000..faec9379d0 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml @@ -0,0 +1,35 @@ +spokenForm: bring whale after fine +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + position: after + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: foo world world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 15} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml new file mode 100644 index 0000000000..86befe5b23 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml @@ -0,0 +1,32 @@ +spokenForm: bring whale after this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + mark: {type: cursor} + position: after + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: foo world world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 15} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml new file mode 100644 index 0000000000..86befe5b23 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml @@ -0,0 +1,32 @@ +spokenForm: bring whale after this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + mark: {type: cursor} + position: after + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: foo world world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 15} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml new file mode 100644 index 0000000000..d7fd883aa1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml @@ -0,0 +1,32 @@ +spokenForm: bring whale before this +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + mark: {type: cursor} + position: before + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: fooworld world + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 15} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: before, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml new file mode 100644 index 0000000000..6fab20d410 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml @@ -0,0 +1,36 @@ +spokenForm: bring whale to end of fine +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: f} + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: fooworld world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 8} + sourceMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 14} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml new file mode 100644 index 0000000000..ed1fd2a048 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml @@ -0,0 +1,34 @@ +spokenForm: bring whale to fine +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: f} + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} +initialState: + documentContents: foo world + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: world world + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} + sourceMark: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml new file mode 100644 index 0000000000..93edb73d73 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml @@ -0,0 +1,28 @@ +spokenForm: chuck first car whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} +finalState: + documentContents: foo orld whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml new file mode 100644 index 0000000000..012b5d5b7b --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml @@ -0,0 +1,24 @@ +spokenForm: chuck first past second car +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1, excludeAnchor: false, excludeActive: false} + extraArgs: [] +marks: {} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo rld whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +fullTargets: [{type: primitive, mark: {type: cursorToken}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml new file mode 100644 index 0000000000..308a86cc84 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml @@ -0,0 +1,24 @@ +spokenForm: chuck fourth past fifth car +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 3, active: 4, excludeAnchor: false, excludeActive: false} + extraArgs: [] +marks: {} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo wor whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +fullTargets: [{type: primitive, mark: {type: cursorToken}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 4, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml new file mode 100644 index 0000000000..481b7e4401 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml @@ -0,0 +1,28 @@ +spokenForm: chuck last car whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} +finalState: + documentContents: foo worl whatever + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml new file mode 100644 index 0000000000..e8071ecb92 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml @@ -0,0 +1,40 @@ +spokenForm: chuck second car fine past third car whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: f} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + excludeStart: false + excludeEnd: false + extraArgs: [] +marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: fld whatever + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml new file mode 100644 index 0000000000..5bd0a6c7a2 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml @@ -0,0 +1,24 @@ +spokenForm: chuck second past third car +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false} + extraArgs: [] +marks: {} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo wld whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: cursorToken}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml new file mode 100644 index 0000000000..e288e7c813 --- /dev/null +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml @@ -0,0 +1,40 @@ +spokenForm: chuck third car whale past second car harp +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: h} + excludeStart: false + excludeEnd: false + extraArgs: [] +marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} +initialState: + documentContents: foo world whatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 9} +finalState: + documentContents: foo woatever + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 6} + thatMark: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}] From 0bb155d0fc887f3201bdf538d27a0d19cfe610fe Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 22:10:23 +0000 Subject: [PATCH 34/48] Delete useless test --- .../bringFineAfterThirdCar.yml | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml deleted file mode 100644 index 14b5dd06c3..0000000000 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCar.yml +++ /dev/null @@ -1,33 +0,0 @@ -spokenForm: bring fine after third car -languageId: plaintext -command: - actionName: replaceWithTarget - partialTargets: - - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: f} - - type: primitive - selectionType: token - modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} - position: after - extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} -initialState: - documentContents: foo world whatever - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 9} -finalState: - documentContents: foofoo world whatever - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 12} - thatMark: - - anchor: {line: 0, character: 3} - active: {line: 0, character: 6} - sourceMark: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 6} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] From 1dd8f3ce00ebfa6aacb594b2164e7f19f60e2049 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 3 Nov 2021 22:12:12 +0000 Subject: [PATCH 35/48] Delete another test --- .../updateSelections/bringTailToFine.yml | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml deleted file mode 100644 index fa81acb44e..0000000000 --- a/src/test/suite/fixtures/recorded/updateSelections/bringTailToFine.yml +++ /dev/null @@ -1,31 +0,0 @@ -spokenForm: bring tail to fine -languageId: plaintext -command: - actionName: replaceWithTarget - partialTargets: - - type: primitive - modifier: {type: tail} - - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: f} - extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} -initialState: - documentContents: foo world - selections: - - anchor: {line: 0, character: 3} - active: {line: 0, character: 3} -finalState: - documentContents: " world" - selections: - - anchor: {line: 0, character: 3} - active: {line: 0, character: 3} - thatMark: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 6} - sourceMark: - - anchor: {line: 0, character: 3} - active: {line: 0, character: 6} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: tail}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: tail}}] From 33f6c4fb84468ceb30c7e9d768fb75924bbc6903 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 17:16:25 +0000 Subject: [PATCH 36/48] Add navigation map tests --- src/core/NavigationMap.ts | 4 + src/core/constants.ts | 2 +- src/extension.ts | 17 ++-- .../bringAirToThirdCarWhaleTakeWhale.yml | 43 +++++++++++ .../bringHarpAfterWhaleTakeWhale.yml | 42 ++++++++++ .../bringHarpBeforeWhaleTakeWhale.yml | 42 ++++++++++ .../navigationMap/bringHarpTakeWhale.yml | 45 +++++++++++ .../bringHarpToStartOfWhaleTakeWhale.yml | 43 +++++++++++ .../bringPointAfterFirstCarWhaleTakeWhale.yml | 44 +++++++++++ .../bringPointToEndOfWhaleTakeWhale.yml | 43 +++++++++++ .../bringPointToStartOfWhaleTakeWhale.yml | 43 +++++++++++ .../bringPointToThirdCarWhaleTakeWhale.yml | 43 +++++++++++ .../chuckFirstTwoCarWhaleTakeWhale.yml | 32 ++++++++ ...FourthCarWhalePastThirdCarAirTakeWhale.yml | 47 +++++++++++ .../chuckHarpPastAirTakeWhale.yml | 49 ++++++++++++ .../chuckLastTwoCarWhaleTakeWhale.yml | 32 ++++++++ .../chuckSecondPastThirdCarWhaleTakeWhale.yml | 32 ++++++++ ...hirdCarHarpPastSecondCarWhaleTakeWhale.yml | 47 +++++++++++ ...astSecondCarWhaleToEndOfWhaleTakeWhale.yml | 54 +++++++++++++ .../recorded/navigationMap/takeHarp.yml | 26 +++++++ src/test/suite/recorded.test.ts | 2 +- src/testUtil/TestCase.ts | 77 +++++++++++++++---- src/testUtil/TestCaseRecorder.ts | 43 +++++++++-- src/testUtil/extractTargetedMarks.ts | 7 +- src/testUtil/takeSnapshot.ts | 6 +- 25 files changed, 827 insertions(+), 38 deletions(-) create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 30cbe3f603..6e2af3a899 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -41,6 +41,10 @@ export default class NavigationMap { return { hatStyle: hatStyle as HatStyleName, character }; } + public getEntries() { + return Object.entries(this.map); + } + public addToken(hatStyle: HatStyleName, character: string, token: Token) { this.map[NavigationMap.getKey(hatStyle, character)] = token; this.getDocumentTokenList(token.editor.document).push(token); diff --git a/src/core/constants.ts b/src/core/constants.ts index 6663abeeca..9dbd446e49 100644 --- a/src/core/constants.ts +++ b/src/core/constants.ts @@ -1,6 +1,6 @@ export const SUBWORD_MATCHER = /[A-Z]?[a-z]+|[A-Z]+(?![a-z])|[0-9]+/g; -export const DEBOUNCE_DELAY = 175; +export const DECORATION_DEBOUNCE_DELAY = 175; export const HAT_COLORS = [ "default", diff --git a/src/extension.ts b/src/extension.ts index 1435eed932..fad9cec939 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,6 +1,6 @@ import * as vscode from "vscode"; import { addDecorationsToEditors } from "./util/addDecorationsToEditor"; -import { DEBOUNCE_DELAY } from "./core/constants"; +import { DECORATION_DEBOUNCE_DELAY } from "./core/constants"; import Decorations from "./core/Decorations"; import graphFactories from "./util/graphFactories"; import inferFullTargets from "./core/inferFullTargets"; @@ -58,7 +58,7 @@ export async function activate(context: vscode.ExtensionContext) { addDecorations(); timeoutHandle = null; - }, DEBOUNCE_DELAY); + }, DECORATION_DEBOUNCE_DELAY); } const toggleDecorationsDisposable = vscode.commands.registerCommand( @@ -88,12 +88,12 @@ export async function activate(context: vscode.ExtensionContext) { const cursorlessRecordTestCaseDisposable = vscode.commands.registerCommand( "cursorless.recordTestCase", - async () => { + async (isNavigationMapTest: boolean = false) => { if (testCaseRecorder.active) { vscode.window.showInformationMessage("Stopped recording test cases"); testCaseRecorder.stop(); } else { - if (await testCaseRecorder.start()) { + if (await testCaseRecorder.start(isNavigationMapTest)) { vscode.window.showInformationMessage( `Recording test cases for following commands in:\n${testCaseRecorder.fixtureSubdirectory}` ); @@ -151,7 +151,6 @@ export async function activate(context: vscode.ExtensionContext) { const selections = processTargets(processedTargetsContext, targets); - let testCase: TestCase | null = null; if (testCaseRecorder.active) { const command = { actionName, partialTargets, extraArgs }; const context = { @@ -161,8 +160,7 @@ export async function activate(context: vscode.ExtensionContext) { navigationMap: graph.navigationMap!, spokenForm, }; - testCase = new TestCase(command, context); - await testCase.recordInitialState(); + await testCaseRecorder.preCommandHook(command, context); } const { @@ -174,9 +172,8 @@ export async function activate(context: vscode.ExtensionContext) { thatMark.set(newThatMark); sourceMark.set(newSourceMark); - if (testCase != null) { - await testCase.recordFinalState(returnValue); - await testCaseRecorder.finish(testCase); + if (testCaseRecorder.active) { + await testCaseRecorder.postCommandHook(returnValue); } return returnValue; diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..62e58b5046 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml @@ -0,0 +1,43 @@ +spokenForm: bring air to third car whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: a} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.a: + start: {line: 0, character: 13} + end: {line: 0, character: 21} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. wowhateverld whatever + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: + default.a: + start: {line: 0, character: 20} + end: {line: 0, character: 28} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 19} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 17} + sourceMark: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 28} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml new file mode 100644 index 0000000000..5129012315 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml @@ -0,0 +1,42 @@ +spokenForm: bring harp after whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + position: after + extraArgs: [] +initialState: + documentContents: hello world + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} +finalState: + documentContents: hello world hello + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 17} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml new file mode 100644 index 0000000000..fce80e8603 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml @@ -0,0 +1,42 @@ +spokenForm: bring harp before whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: w} + position: before + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. hello world whatever + selections: + - anchor: {line: 0, character: 19} + active: {line: 0, character: 19} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 13} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 13} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: null, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml new file mode 100644 index 0000000000..a0125e4be8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml @@ -0,0 +1,45 @@ +spokenForm: bring harp take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + mark: {type: cursor} + selectionType: token + position: contents + modifier: {type: identity} + insideOutsideType: inside + extraArgs: [] +initialState: + documentContents: hello world + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} +finalState: + documentContents: hello worldhello + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 16} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 16} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..d790eee711 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml @@ -0,0 +1,43 @@ +spokenForm: bring harp to start of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. helloworld whatever + selections: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 17} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 12} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..ffa8480225 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml @@ -0,0 +1,44 @@ +spokenForm: bring point after first car whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + position: after + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. w.orld whatever + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 13} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 9} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..b494fa3499 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml @@ -0,0 +1,43 @@ +spokenForm: bring point to end of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. world. whatever + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} + thatMark: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 13} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..92b5748200 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml @@ -0,0 +1,43 @@ +spokenForm: bring point to start of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. .world whatever + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 8} + end: {line: 0, character: 13} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 8} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..9952aa3313 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml @@ -0,0 +1,43 @@ +spokenForm: bring point to third car whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. wo.ld whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 10} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..a3198f378a --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml @@ -0,0 +1,32 @@ +spokenForm: chuck first two car whale take whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello world + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} +finalState: + documentContents: hello rld + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml new file mode 100644 index 0000000000..b77f59f11c --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml @@ -0,0 +1,47 @@ +spokenForm: chuck fourth car whale past third car air take whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: a} + excludeStart: false + excludeEnd: false + extraArgs: [] +initialState: + documentContents: hello world whatever + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} + default.a: + start: {line: 0, character: 12} + end: {line: 0, character: 20} +finalState: + documentContents: hello wortever + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 9} + default.a: + start: {line: 0, character: 9} + end: {line: 0, character: 14} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml new file mode 100644 index 0000000000..74a891cd54 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml @@ -0,0 +1,49 @@ +spokenForm: chuck harp past air take whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: range + start: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + end: + type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: a} + excludeStart: false + excludeEnd: false + extraArgs: [] +initialState: + documentContents: hello world whatever + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.a: + start: {line: 0, character: 12} + end: {line: 0, character: 20} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 0} + default.a: + start: {line: 0, character: 0} + end: {line: 0, character: 0} + default.w: + start: {line: 0, character: 0} + end: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: identity}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: identity}}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..ce7123cc73 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml @@ -0,0 +1,32 @@ +spokenForm: chuck last two car whale take whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. wor whatever + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 10} + thatMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..a3a950840d --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml @@ -0,0 +1,32 @@ +spokenForm: chuck second past third car whale take whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world whatever + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. wld whatever + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 10} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml new file mode 100644 index 0000000000..79ffcb2be6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml @@ -0,0 +1,47 @@ +spokenForm: chuck third car harp past second car whale take whale +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: h} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + excludeStart: false + excludeEnd: false + extraArgs: [] +initialState: + documentContents: hello world whatever + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} +finalState: + documentContents: herld whatever + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 2} + default.w: + start: {line: 0, character: 2} + end: {line: 0, character: 5} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..2b1831c9fd --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml @@ -0,0 +1,54 @@ +spokenForm: move fourth car harp past second car whale to end of whale take whale +languageId: plaintext +command: + actionName: moveToTarget + partialTargets: + - type: range + start: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: h} + end: + type: primitive + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + excludeStart: false + excludeEnd: false + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello world whatever + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 6} + end: {line: 0, character: 11} +finalState: + documentContents: helrldlo wo whatever + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 3} + end: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 11} + sourceMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml b/src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml new file mode 100644 index 0000000000..807c2d0f49 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml @@ -0,0 +1,26 @@ +spokenForm: take harp +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + extraArgs: [] +initialState: + documentContents: hello world + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} +finalState: + documentContents: hello world + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/recorded.test.ts b/src/test/suite/recorded.test.ts index 1aba830eca..3738cf6c2a 100644 --- a/src/test/suite/recorded.test.ts +++ b/src/test/suite/recorded.test.ts @@ -99,7 +99,7 @@ async function runTest(file: string) { cursorlessApi.addDecorations(); // Assert that recorded decorations are present - Object.entries(fixture.marks).forEach(([key, token]) => { + Object.entries(fixture.initialState.marks!).forEach(([key, token]) => { const { hatStyle, character } = NavigationMap.splitKey(key); const currentToken = cursorlessApi.navigationMap.getToken( hatStyle, diff --git a/src/testUtil/TestCase.ts b/src/testUtil/TestCase.ts index d6f7493084..fa6cb5ed71 100644 --- a/src/testUtil/TestCase.ts +++ b/src/testUtil/TestCase.ts @@ -1,19 +1,23 @@ import * as vscode from "vscode"; import NavigationMap from "../core/NavigationMap"; import { ThatMark } from "../core/ThatMark"; -import { ActionType, PartialTarget, Target } from "../typings/Types"; -import { extractTargetedMarks } from "./extractTargetedMarks"; +import { ActionType, PartialTarget, Target, Token } from "../typings/Types"; +import { + extractTargetedMarks, + extractTargetKeys, +} from "./extractTargetedMarks"; import { marksToPlainObject, SerializedMarks } from "./toPlainObject"; import { takeSnapshot, TestCaseSnapshot } from "./takeSnapshot"; import serialize from "./serialize"; +import { pick } from "lodash"; -type TestCaseCommand = { +export type TestCaseCommand = { actionName: ActionType; partialTargets: PartialTarget[]; extraArgs: any[]; }; -type TestCaseContext = { +export type TestCaseContext = { spokenForm: string; thatMark: ThatMark; sourceMark: ThatMark; @@ -25,7 +29,6 @@ export type TestCaseFixture = { spokenForm: string; command: TestCaseCommand; languageId: string; - marks: SerializedMarks; initialState: TestCaseSnapshot; finalState: TestCaseSnapshot; returnValue: unknown; @@ -35,26 +38,43 @@ export type TestCaseFixture = { export class TestCase { spokenForm: string; - command: TestCaseCommand; languageId: string; fullTargets: Target[]; - marks: SerializedMarks; - context: TestCaseContext; initialState: TestCaseSnapshot | null = null; finalState: TestCaseSnapshot | null = null; returnValue: unknown = null; + targetKeys: string[]; + private _awaitingFinalMarkInfo: boolean; - constructor(command: TestCaseCommand, context: TestCaseContext) { + constructor( + private command: TestCaseCommand, + private context: TestCaseContext, + private isNavigationMapTest: boolean = false + ) { const activeEditor = vscode.window.activeTextEditor!; - const { navigationMap, targets, spokenForm } = context; - const targetedMarks = extractTargetedMarks(targets, navigationMap); + + const { targets, spokenForm } = context; + + this.targetKeys = targets.map(extractTargetKeys).flat(); this.spokenForm = spokenForm; - this.command = command; this.languageId = activeEditor.document.languageId; - this.marks = marksToPlainObject(targetedMarks); this.fullTargets = targets; - this.context = context; + this._awaitingFinalMarkInfo = isNavigationMapTest; + } + + private getMarks() { + let marks: Record; + + const { navigationMap } = this.context; + + if (this.isNavigationMapTest) { + marks = Object.fromEntries(navigationMap.getEntries()); + } else { + marks = extractTargetedMarks(this.targetKeys, navigationMap); + } + + return marksToPlainObject(marks); } private includesThatMark(target: Target, type: string): boolean { @@ -107,7 +127,6 @@ export class TestCase { spokenForm: this.spokenForm, languageId: this.languageId, command: this.command, - marks: this.marks, initialState: this.initialState, finalState: this.finalState, returnValue: this.returnValue, @@ -121,7 +140,8 @@ export class TestCase { this.initialState = await takeSnapshot( this.context.thatMark, this.context.sourceMark, - excludeFields + excludeFields, + this.getMarks() ); } @@ -131,7 +151,30 @@ export class TestCase { this.finalState = await takeSnapshot( this.context.thatMark, this.context.sourceMark, - excludeFields + excludeFields, + this.isNavigationMapTest ? this.getMarks() : undefined ); } + + filterMarks(command: TestCaseCommand, context: TestCaseContext) { + const keys = this.targetKeys.concat( + context.targets.map(extractTargetKeys).flat() + ); + + this.initialState!.marks = pick( + this.initialState!.marks, + keys + ) as SerializedMarks; + + this.finalState!.marks = pick( + this.finalState!.marks, + keys + ) as SerializedMarks; + + this._awaitingFinalMarkInfo = false; + } + + get awaitingFinalMarkInfo() { + return this._awaitingFinalMarkInfo; + } } diff --git a/src/testUtil/TestCaseRecorder.ts b/src/testUtil/TestCaseRecorder.ts index df9529e503..05427daf09 100644 --- a/src/testUtil/TestCaseRecorder.ts +++ b/src/testUtil/TestCaseRecorder.ts @@ -1,8 +1,9 @@ import * as vscode from "vscode"; import * as path from "path"; import * as fs from "fs"; -import { TestCase } from "./TestCase"; +import { TestCase, TestCaseCommand, TestCaseContext } from "./TestCase"; import { walkDirsSync } from "./walkSync"; +import { invariant } from "immutability-helper"; export class TestCaseRecorder { active: boolean = false; @@ -10,6 +11,8 @@ export class TestCaseRecorder { workSpaceFolder: string | null; fixtureRoot: string | null; fixtureSubdirectory: string | null = null; + testCase: TestCase | null = null; + isNavigationMapTest: boolean = false; constructor(extensionContext: vscode.ExtensionContext) { this.workspacePath = @@ -26,8 +29,11 @@ export class TestCaseRecorder { : null; } - async start(): Promise { + async start(isNavigationMapTest: boolean = false): Promise { this.active = await this.promptSubdirectory(); + if (this.active) { + this.isNavigationMapTest = isNavigationMapTest; + } return this.active; } @@ -35,10 +41,37 @@ export class TestCaseRecorder { this.active = false; } - async finish(testCase: TestCase): Promise { - const outPath = this.calculateFilePath(testCase); - const fixture = testCase.toYaml(); + async preCommandHook(command: TestCaseCommand, context: TestCaseContext) { + if (this.testCase != null) { + invariant( + this.testCase.awaitingFinalMarkInfo, + () => "expected to be awaiting final mark info" + ); + this.testCase.filterMarks(command, context); + await this.finishTestCase(); + } else { + this.testCase = new TestCase(command, context, this.isNavigationMapTest); + await this.testCase.recordInitialState(); + } + } + + async postCommandHook(returnValue: any) { + if (this.testCase == null) { + return; + } + + await this.testCase.recordFinalState(returnValue); + + if (!this.testCase.awaitingFinalMarkInfo) { + await this.finishTestCase(); + } + } + + async finishTestCase(): Promise { + const outPath = this.calculateFilePath(this.testCase!); + const fixture = this.testCase!.toYaml(); await this.writeToFile(outPath, fixture); + this.testCase = null; } private async writeToFile(outPath: string, fixture: string) { diff --git a/src/testUtil/extractTargetedMarks.ts b/src/testUtil/extractTargetedMarks.ts index 83a9d81c17..2a7fad2b90 100644 --- a/src/testUtil/extractTargetedMarks.ts +++ b/src/testUtil/extractTargetedMarks.ts @@ -13,7 +13,7 @@ function extractPrimitiveTargetKeys(...targets: PrimitiveTarget[]) { return keys; } -function extractTargetKeys(target: Target): string[] { +export function extractTargetKeys(target: Target): string[] { switch (target.type) { case "primitive": return extractPrimitiveTargetKeys(target); @@ -30,14 +30,15 @@ function extractTargetKeys(target: Target): string[] { } export function extractTargetedMarks( - targets: Target[], + targetKeys: string[], navigationMap: NavigationMap ) { const targetedMarks: { [decoratedCharacter: string]: Token } = {}; - const targetKeys = targets.map(extractTargetKeys).flat(); + targetKeys.forEach((key) => { const { hatStyle, character } = NavigationMap.splitKey(key); targetedMarks[key] = navigationMap.getToken(hatStyle, character); }); + return targetedMarks; } diff --git a/src/testUtil/takeSnapshot.ts b/src/testUtil/takeSnapshot.ts index 3d233b6855..c34cbc63fb 100644 --- a/src/testUtil/takeSnapshot.ts +++ b/src/testUtil/takeSnapshot.ts @@ -5,6 +5,7 @@ import { rangeToPlainObject, RangePlainObject, SelectionPlainObject, + SerializedMarks, } from "./toPlainObject"; import { ThatMark } from "../core/ThatMark"; @@ -15,6 +16,7 @@ export type TestCaseSnapshot = { // TODO Visible ranges are not asserted during testing, see: // https://github.com/pokey/cursorless-vscode/issues/160 visibleRanges?: RangePlainObject[]; + marks?: SerializedMarks; thatMark?: SelectionPlainObject[]; sourceMark?: SelectionPlainObject[]; }; @@ -22,13 +24,15 @@ export type TestCaseSnapshot = { export async function takeSnapshot( thatMark: ThatMark, sourceMark: ThatMark, - excludeFields: string[] = [] + excludeFields: string[] = [], + marks?: SerializedMarks ) { const activeEditor = vscode.window.activeTextEditor!; const snapshot: TestCaseSnapshot = { documentContents: activeEditor.document.getText(), selections: activeEditor.selections.map(selectionToPlainObject), + marks, }; if (!excludeFields.includes("clipboard")) { From e1f94dc71a288f9db2daa76379b7faa978b73a03 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 17:18:26 +0000 Subject: [PATCH 37/48] Move marks to initial state --- .../fixtures/recorded/actions/bringVest.yml | 8 ++++---- .../recorded/actions/bringVestToCap.yml | 14 ++++++------- .../fixtures/recorded/actions/callFine.yml | 8 ++++---- .../fixtures/recorded/actions/callVest.yml | 8 ++++---- .../recorded/actions/callVestOnCap.yml | 14 ++++++------- .../fixtures/recorded/actions/carveVest.yml | 8 ++++---- .../fixtures/recorded/actions/chuckVest.yml | 8 ++++---- .../fixtures/recorded/actions/clearVest.yml | 8 ++++---- .../fixtures/recorded/actions/commentVest.yml | 8 ++++---- .../fixtures/recorded/actions/copyVest.yml | 8 ++++---- .../fixtures/recorded/actions/dedentVest.yml | 8 ++++---- .../fixtures/recorded/actions/drinkVest.yml | 8 ++++---- .../fixtures/recorded/actions/dropVest.yml | 8 ++++---- .../fixtures/recorded/actions/dupeUpVest.yml | 8 ++++---- .../fixtures/recorded/actions/dupeVest.yml | 8 ++++---- .../fixtures/recorded/actions/findVest.yml | 8 ++++---- .../fixtures/recorded/actions/floatVest.yml | 8 ++++---- .../fixtures/recorded/actions/indentVest.yml | 8 ++++---- .../fixtures/recorded/actions/moveVest.yml | 8 ++++---- .../recorded/actions/moveVestToCap.yml | 14 ++++++------- .../fixtures/recorded/actions/pasteCap.yml | 8 ++++---- .../fixtures/recorded/actions/phonesSpy.yml | 8 ++++---- .../fixtures/recorded/actions/postVest.yml | 8 ++++---- .../fixtures/recorded/actions/pourVest.yml | 8 ++++---- .../fixtures/recorded/actions/preeVest.yml | 8 ++++---- .../fixtures/recorded/actions/puffVest.yml | 8 ++++---- .../recorded/actions/reformatHarpAsSnake.yml | 8 ++++---- .../recorded/actions/reformatHarpAsSnake2.yml | 8 ++++---- .../replaceAirAndBatAndCapWithCount.yml | 20 +++++++++---------- .../actions/replaceVestWithWhatever.yml | 8 ++++---- .../actions/reverseAirAndBatAndCap.yml | 20 +++++++++---------- .../recorded/actions/roundWrapThis.yml | 2 +- .../recorded/actions/roundWrapVest.yml | 8 ++++---- .../recorded/actions/roundWrapVest2.yml | 8 ++++---- .../recorded/actions/sortAirAndCapAndBat.yml | 20 +++++++++---------- .../recorded/actions/swapVestWithCap.yml | 14 ++++++------- .../recorded/actions/swapWithVest.yml | 8 ++++---- .../fixtures/recorded/actions/takeVest.yml | 8 ++++---- .../compoundTargets/takeCapAndVestAndHarp.yml | 20 +++++++++---------- .../compoundTargets/takeCapPastHarp.yml | 14 ++++++------- .../compoundTargets/takeHarpAndVestAndCap.yml | 20 +++++++++---------- .../compoundTargets/takeHarpPastCap.yml | 14 ++++++------- .../compoundTargets/takeLineVestAndAir.yml | 14 ++++++------- .../compoundTargets/takePastEndOfToken.yml | 2 +- .../compoundTargets/takePastStartOfToken.yml | 2 +- .../recorded/compoundTargets/takePastTrap.yml | 8 ++++---- .../compoundTargets/takeTokenPastTrap.yml | 8 ++++---- .../compoundTargets/takeVestTweenWhale.yml | 14 ++++++------- .../compoundTargets/takeVestUntilWhale.yml | 14 ++++++------- .../compoundTargets/takeWhaleTweenVest.yml | 14 ++++++------- .../compoundTargets/takeWhaleUntilVest.yml | 14 ++++++------- .../fixtures/recorded/headTail/takeHead.yml | 2 +- .../recorded/headTail/takeHeadVest.yml | 8 ++++---- .../fixtures/recorded/headTail/takeTail.yml | 2 +- .../recorded/headTail/takeTailVest.yml | 8 ++++---- .../bringLineBatPastEndOfFunkToThis.yml | 8 ++++---- .../inference/bringMapAirToLineHarp.yml | 14 ++++++------- .../inference/bringMapAirToTokenHarp.yml | 14 ++++++------- .../recorded/inference/bringOddToLine.yml | 8 ++++---- .../recorded/inference/bringOddToState.yml | 8 ++++---- .../recorded/inference/bringOddToToken.yml | 8 ++++---- .../inference/bringTokenHarpToMapAir.yml | 14 ++++++------- .../recorded/inference/ifWrapTokenFine.yml | 8 ++++---- .../inference/takeAfterVestPastAir.yml | 14 ++++++------- .../inference/takeAfterVestPastBeforeAir.yml | 14 ++++++------- .../inference/takeAirPastEndOfLine.yml | 8 ++++---- .../inference/takeEachPastStartOfLine.yml | 8 ++++---- .../recorded/inference/takeFirstWord.yml | 2 +- .../inference/takeHarpAndStringEach.yml | 14 ++++++------- .../inference/takeHarpPastStringEach.yml | 14 ++++++------- .../recorded/inference/takeLastChar.yml | 2 +- .../recorded/inference/takeLinePastAir.yml | 8 ++++---- .../recorded/inference/takeLineVestAndAir.yml | 14 ++++++------- .../inference/takeLineVestPastAir.yml | 14 ++++++------- .../inference/takeOddPastEndOfState.yml | 8 ++++---- .../recorded/inference/takeOddPastLine.yml | 8 ++++---- .../recorded/inference/takeOddPastState.yml | 8 ++++---- .../recorded/inference/takeOddPastToken.yml | 8 ++++---- .../recorded/inference/takePastLineAir.yml | 8 ++++---- .../inference/takeStringHarpAndEach.yml | 14 ++++++------- .../inference/takeStringHarpPastEach.yml | 14 ++++++------- .../recorded/inference/takeVestAndLineAir.yml | 14 ++++++------- .../inference/takeVestPastAfterAir.yml | 14 ++++++------- .../inference/takeVestPastBeforeAir.yml | 14 ++++++------- .../inference/takeVestPastLineAir.yml | 14 ++++++------- .../recorded/languages/c/clearFunk.yml | 2 +- .../languages/cpp/elseStateWrapThis.yml | 2 +- .../recorded/languages/cpp/ifElseWrapThis.yml | 2 +- .../languages/cpp/ifStateWrapThis.yml | 2 +- .../recorded/languages/cpp/takeArg.yml | 2 +- .../recorded/languages/cpp/takeArg2.yml | 2 +- .../recorded/languages/cpp/takeAttribute.yml | 2 +- .../recorded/languages/cpp/takeCall.yml | 2 +- .../recorded/languages/cpp/takeClass.yml | 2 +- .../recorded/languages/cpp/takeClass2.yml | 2 +- .../recorded/languages/cpp/takeClassName.yml | 2 +- .../recorded/languages/cpp/takeClassName2.yml | 2 +- .../recorded/languages/cpp/takeClassName3.yml | 2 +- .../recorded/languages/cpp/takeComment.yml | 2 +- .../recorded/languages/cpp/takeEveryArg.yml | 2 +- .../recorded/languages/cpp/takeEveryItem.yml | 2 +- .../recorded/languages/cpp/takeFunk.yml | 2 +- .../recorded/languages/cpp/takeFunk2.yml | 2 +- .../recorded/languages/cpp/takeFunkName.yml | 2 +- .../recorded/languages/cpp/takeFunkName2.yml | 2 +- .../recorded/languages/cpp/takeFunkName3.yml | 2 +- .../recorded/languages/cpp/takeIf.yml | 2 +- .../recorded/languages/cpp/takeIf2.yml | 2 +- .../recorded/languages/cpp/takeItem.yml | 2 +- .../recorded/languages/cpp/takeItem2.yml | 2 +- .../recorded/languages/cpp/takeLambda.yml | 2 +- .../recorded/languages/cpp/takeList.yml | 2 +- .../recorded/languages/cpp/takeList2.yml | 2 +- .../recorded/languages/cpp/takeName.yml | 2 +- .../recorded/languages/cpp/takeName2.yml | 2 +- .../recorded/languages/cpp/takeName3.yml | 2 +- .../recorded/languages/cpp/takeState.yml | 2 +- .../recorded/languages/cpp/takeState2.yml | 2 +- .../recorded/languages/cpp/takeState3.yml | 2 +- .../recorded/languages/cpp/takeString.yml | 2 +- .../recorded/languages/cpp/takeType.yml | 2 +- .../recorded/languages/cpp/takeType2.yml | 2 +- .../recorded/languages/cpp/takeType3.yml | 2 +- .../recorded/languages/cpp/takeValue.yml | 2 +- .../recorded/languages/cpp/takeValue2.yml | 2 +- .../recorded/languages/cpp/takeValue3.yml | 2 +- .../languages/cpp/tryCatchWrapThis.yml | 2 +- .../languages/cpp/tryCatchWrapThis2.yml | 2 +- .../languages/csharp/elseStateWrapThis.yml | 2 +- .../languages/csharp/ifElseWrapThis.yml | 2 +- .../languages/csharp/ifStateWrapThis.yml | 2 +- .../languages/csharp/tryCatchWrapThis.yml | 2 +- .../languages/csharp/tryCatchWrapThis2.yml | 2 +- .../languages/java/elseStateWrapThis.yml | 2 +- .../languages/java/ifElseWrapThis.yml | 2 +- .../languages/java/ifStateWrapThis.yml | 2 +- .../recorded/languages/java/takeArg.yml | 2 +- .../recorded/languages/java/takeArg2.yml | 2 +- .../recorded/languages/java/takeCall.yml | 2 +- .../recorded/languages/java/takeClass.yml | 2 +- .../recorded/languages/java/takeClassName.yml | 2 +- .../recorded/languages/java/takeComment.yml | 2 +- .../recorded/languages/java/takeEveryArg.yml | 2 +- .../recorded/languages/java/takeEveryArg2.yml | 2 +- .../recorded/languages/java/takeEveryItem.yml | 2 +- .../recorded/languages/java/takeFunk.yml | 2 +- .../recorded/languages/java/takeFunk2.yml | 2 +- .../recorded/languages/java/takeFunkName.yml | 2 +- .../recorded/languages/java/takeFunkName2.yml | 2 +- .../recorded/languages/java/takeIf.yml | 2 +- .../recorded/languages/java/takeItem.yml | 2 +- .../recorded/languages/java/takeList.yml | 2 +- .../recorded/languages/java/takeMap.yml | 2 +- .../recorded/languages/java/takeName.yml | 2 +- .../recorded/languages/java/takeName2.yml | 2 +- .../recorded/languages/java/takeName3.yml | 2 +- .../recorded/languages/java/takeState.yml | 2 +- .../recorded/languages/java/takeString.yml | 2 +- .../recorded/languages/java/takeType.yml | 2 +- .../recorded/languages/java/takeType2.yml | 2 +- .../recorded/languages/java/takeType3.yml | 2 +- .../recorded/languages/java/takeValue.yml | 2 +- .../languages/java/tryCatchWrapThis.yml | 2 +- .../languages/java/tryCatchWrapThis2.yml | 2 +- .../recorded/languages/json/takeItem.yml | 2 +- .../recorded/languages/json/takeItem2.yml | 2 +- .../recorded/languages/json/takeKey.yml | 2 +- .../recorded/languages/json/takeList.yml | 2 +- .../recorded/languages/json/takeString.yml | 2 +- .../recorded/languages/json/takeValue.yml | 2 +- .../recorded/languages/jsx/takeAttribute.yml | 2 +- .../recorded/languages/jsx/takeElement.yml | 2 +- .../recorded/languages/jsx/takeEndTag.yml | 2 +- .../languages/jsx/takeEveryAttribute.yml | 2 +- .../recorded/languages/jsx/takeKey.yml | 2 +- .../recorded/languages/jsx/takeStartTag.yml | 2 +- .../recorded/languages/jsx/takeTags.yml | 2 +- .../recorded/languages/jsx/takeValue.yml | 2 +- .../recorded/languages/python/chuckKey.yml | 2 +- .../recorded/languages/python/chuckKey2.yml | 2 +- .../recorded/languages/python/chuckType.yml | 2 +- .../recorded/languages/python/chuckValue.yml | 2 +- .../recorded/languages/python/chuckValue2.yml | 2 +- .../languages/python/clearEveryValue.yml | 2 +- .../recorded/languages/python/clearValue.yml | 2 +- .../recorded/languages/python/clearValue2.yml | 2 +- .../languages/python/elseStateWrapThis.yml | 2 +- .../languages/python/ifElseWrapThis.yml | 2 +- .../languages/python/ifStateWrapThis.yml | 2 +- .../recorded/languages/python/takeArg.yml | 2 +- .../recorded/languages/python/takeArg2.yml | 2 +- .../recorded/languages/python/takeCall.yml | 2 +- .../recorded/languages/python/takeClass.yml | 2 +- .../recorded/languages/python/takeClass2.yml | 2 +- .../languages/python/takeClassName.yml | 2 +- .../recorded/languages/python/takeComment.yml | 2 +- .../languages/python/takeEveryArg.yml | 2 +- .../languages/python/takeEveryArg2.yml | 2 +- .../languages/python/takeEveryItem.yml | 2 +- .../languages/python/takeEveryItem2.yml | 2 +- .../languages/python/takeEveryItem3.yml | 2 +- .../recorded/languages/python/takeFunk.yml | 2 +- .../recorded/languages/python/takeFunk2.yml | 2 +- .../languages/python/takeFunkName.yml | 2 +- .../recorded/languages/python/takeIf.yml | 2 +- .../recorded/languages/python/takeItem.yml | 2 +- .../recorded/languages/python/takeItem2.yml | 2 +- .../recorded/languages/python/takeItem3.yml | 2 +- .../recorded/languages/python/takeKey.yml | 2 +- .../recorded/languages/python/takeLambda.yml | 2 +- .../recorded/languages/python/takeList.yml | 2 +- .../recorded/languages/python/takeList2.yml | 2 +- .../recorded/languages/python/takeMap.yml | 2 +- .../recorded/languages/python/takeName.yml | 2 +- .../recorded/languages/python/takeName2.yml | 2 +- .../recorded/languages/python/takeName3.yml | 2 +- .../recorded/languages/python/takeState.yml | 2 +- .../recorded/languages/python/takeString.yml | 2 +- .../recorded/languages/python/takeType.yml | 2 +- .../recorded/languages/python/takeType2.yml | 2 +- .../recorded/languages/python/takeValue.yml | 2 +- .../recorded/languages/python/takeValue2.yml | 2 +- .../languages/python/takeValueZero.yml | 8 ++++---- .../languages/python/tryCatchWrapThis.yml | 2 +- .../languages/python/tryCatchWrapThis2.yml | 2 +- .../languages/typescript/chuckKey.yml | 2 +- .../languages/typescript/clearFunk.yml | 2 +- .../languages/typescript/clearFunk2.yml | 2 +- .../languages/typescript/clearKey.yml | 2 +- .../languages/typescript/clearLambda.yml | 2 +- .../languages/typescript/clearLambda2.yml | 2 +- .../languages/typescript/clearLambda3.yml | 2 +- .../languages/typescript/clearLambda4.yml | 2 +- .../typescript/elseStateWrapThis.yml | 2 +- .../languages/typescript/ifElseWrapThis.yml | 2 +- .../languages/typescript/ifStateWrapThis.yml | 2 +- .../recorded/languages/typescript/takeArg.yml | 2 +- .../languages/typescript/takeArg2.yml | 2 +- .../languages/typescript/takeArrow.yml | 2 +- .../languages/typescript/takeCall.yml | 2 +- .../languages/typescript/takeClass.yml | 2 +- .../languages/typescript/takeClassName.yml | 2 +- .../languages/typescript/takeComment.yml | 2 +- .../languages/typescript/takeEveryArgAir.yml | 8 ++++---- .../languages/typescript/takeEveryArgBat.yml | 8 ++++---- .../languages/typescript/takeEveryArgRam.yml | 8 ++++---- .../languages/typescript/takeEveryItem.yml | 2 +- .../languages/typescript/takeEveryItem2.yml | 2 +- .../languages/typescript/takeEveryItem3.yml | 2 +- .../languages/typescript/takeEveryItem4.yml | 2 +- .../languages/typescript/takeEveryItem5.yml | 2 +- .../languages/typescript/takeEveryKey.yml | 2 +- .../languages/typescript/takeEveryValue.yml | 2 +- .../languages/typescript/takeFunk.yml | 2 +- .../languages/typescript/takeFunk10.yml | 2 +- .../languages/typescript/takeFunk11.yml | 2 +- .../languages/typescript/takeFunk12.yml | 2 +- .../languages/typescript/takeFunk13.yml | 2 +- .../languages/typescript/takeFunk2.yml | 2 +- .../languages/typescript/takeFunk3.yml | 2 +- .../languages/typescript/takeFunk4.yml | 2 +- .../languages/typescript/takeFunk5.yml | 2 +- .../languages/typescript/takeFunk6.yml | 2 +- .../languages/typescript/takeFunk7.yml | 2 +- .../languages/typescript/takeFunk8.yml | 2 +- .../languages/typescript/takeFunk9.yml | 2 +- .../languages/typescript/takeFunkName.yml | 2 +- .../languages/typescript/takeFunkName10.yml | 2 +- .../languages/typescript/takeFunkName11.yml | 2 +- .../languages/typescript/takeFunkName2.yml | 2 +- .../languages/typescript/takeFunkName3.yml | 2 +- .../languages/typescript/takeFunkName4.yml | 2 +- .../languages/typescript/takeFunkName5.yml | 2 +- .../languages/typescript/takeFunkName6.yml | 2 +- .../languages/typescript/takeFunkName7.yml | 2 +- .../languages/typescript/takeFunkName8.yml | 2 +- .../languages/typescript/takeFunkName9.yml | 2 +- .../recorded/languages/typescript/takeIf.yml | 2 +- .../languages/typescript/takeItem.yml | 2 +- .../languages/typescript/takeItem2.yml | 2 +- .../languages/typescript/takeItem3.yml | 2 +- .../languages/typescript/takeItem4.yml | 2 +- .../languages/typescript/takeItemAir.yml | 8 ++++---- .../languages/typescript/takeItemBrace.yml | 8 ++++---- .../languages/typescript/takeItemComma.yml | 8 ++++---- .../languages/typescript/takeItemOne.yml | 8 ++++---- .../recorded/languages/typescript/takeKey.yml | 2 +- .../languages/typescript/takeList.yml | 2 +- .../languages/typescript/takeList2.yml | 2 +- .../recorded/languages/typescript/takeMap.yml | 2 +- .../languages/typescript/takeMap2.yml | 2 +- .../languages/typescript/takeName.yml | 2 +- .../languages/typescript/takeName2.yml | 2 +- .../languages/typescript/takeRegex.yml | 2 +- .../languages/typescript/takeState.yml | 2 +- .../languages/typescript/takeString.yml | 2 +- .../languages/typescript/takeType.yml | 2 +- .../languages/typescript/takeType2.yml | 2 +- .../languages/typescript/takeValue.yml | 2 +- .../languages/typescript/takeValue2.yml | 2 +- .../languages/typescript/takeValue3.yml | 2 +- .../languages/typescript/takeValue4.yml | 2 +- .../languages/typescript/tryCatchWrapThis.yml | 2 +- .../typescript/tryCatchWrapThis2.yml | 2 +- .../recorded/lineEndings/chuckVestLF.yml | 8 ++++---- .../recorded/lineEndings/chuckVestLFCR.yml | 8 ++++---- .../recorded/lineEndings/dropVestLF.yml | 8 ++++---- .../recorded/lineEndings/dropVestLFCR.yml | 8 ++++---- .../recorded/lineNumbers/takeDownOne.yml | 2 +- .../lineNumbers/takeDownOnePastThree.yml | 2 +- .../recorded/lineNumbers/takeRowFour.yml | 2 +- .../lineNumbers/takeRowTwoPastDownThree.yml | 2 +- .../lineNumbers/takeRowTwoPastFour.yml | 2 +- .../lineNumbers/takeUpOnePastDownOne.yml | 2 +- .../lineNumbers/takeUpOnePastRowFour.yml | 2 +- .../fixtures/recorded/marks/takeSource.yml | 2 +- .../fixtures/recorded/marks/takeThat.yml | 2 +- .../fixtures/recorded/marks/takeThis.yml | 2 +- .../positions/chuckAfterBlockVest.yml | 8 ++++---- .../recorded/positions/chuckAfterLineVest.yml | 8 ++++---- .../recorded/positions/chuckAfterVest.yml | 8 ++++---- .../positions/chuckBeforeBlockAir.yml | 8 ++++---- .../recorded/positions/chuckBeforeLineAir.yml | 8 ++++---- .../recorded/positions/chuckBeforeVest.yml | 8 ++++---- .../recorded/positions/chuckPastAfterLook.yml | 8 ++++---- .../positions/chuckPastBeforeTrap.yml | 8 ++++---- .../recorded/positions/chuckPastEndOfLine.yml | 2 +- .../recorded/positions/chuckPastEndOfLook.yml | 8 ++++---- .../positions/chuckPastStartOfTrap.yml | 8 ++++---- .../positions/replaceAfterVestWithHallo.yml | 8 ++++---- .../positions/replaceBeforeVestWithHello.yml | 8 ++++---- .../positions/replaceEndOfVestWithHello.yml | 8 ++++---- .../positions/replaceStartOfVestWithHello.yml | 8 ++++---- .../recorded/selectionTypes/chuckBlockAir.yml | 8 ++++---- .../selectionTypes/chuckBlockAir2.yml | 8 ++++---- .../selectionTypes/chuckBlockVest.yml | 8 ++++---- .../recorded/selectionTypes/chuckFile.yml | 2 +- .../recorded/selectionTypes/chuckLineVest.yml | 8 ++++---- .../selectionTypes/chuckLineVest2.yml | 8 ++++---- .../selectionTypes/chuckTokenVest.yml | 8 ++++---- .../recorded/selectionTypes/drinkCell.yml | 2 +- .../recorded/selectionTypes/drinkCellEach.yml | 8 ++++---- .../recorded/selectionTypes/pourCell.yml | 2 +- .../recorded/selectionTypes/pourCellEach.yml | 8 ++++---- .../recorded/selectionTypes/takeBlockAir.yml | 8 ++++---- .../recorded/selectionTypes/takeFile.yml | 2 +- .../recorded/selectionTypes/takeLineVest.yml | 8 ++++---- .../recorded/selectionTypes/takeTokenVest.yml | 8 ++++---- .../recorded/subtoken/chuckFirstCharVest.yml | 8 ++++---- .../recorded/subtoken/chuckFirstWordVest.yml | 8 ++++---- .../recorded/subtoken/chuckLastCharVest.yml | 8 ++++---- .../recorded/subtoken/chuckLastWordVest.yml | 8 ++++---- .../recorded/subtoken/chuckSecondWordVest.yml | 8 ++++---- .../recorded/subtoken/chuckSixthCharVest.yml | 8 ++++---- .../recorded/subtoken/clearFirstCharVest.yml | 8 ++++---- .../recorded/subtoken/clearFirstWordVest.yml | 8 ++++---- .../recorded/subtoken/clearLastCharVest.yml | 8 ++++---- .../recorded/subtoken/clearLastWordVest.yml | 8 ++++---- .../recorded/subtoken/clearSecondWordVest.yml | 8 ++++---- .../recorded/subtoken/clearSixthCharVest.yml | 8 ++++---- .../recorded/subtoken/takeFirstChar.yml | 2 +- .../recorded/subtoken/takeFirstChar2.yml | 2 +- .../recorded/subtoken/takeFirstChar3.yml | 2 +- .../recorded/subtoken/takeFirstChar4.yml | 2 +- .../recorded/subtoken/takeFirstChar5.yml | 2 +- .../subtoken/takeFirstPastLastCharHarp.yml | 8 ++++---- .../subtoken/takeFirstPastLastWordHarp.yml | 8 ++++---- .../subtoken/takeFirstPastSecondWordHarp.yml | 8 ++++---- .../subtoken/takeFirstThreeCharHarp.yml | 8 ++++---- .../subtoken/takeFirstTwoWordHarp.yml | 8 ++++---- .../recorded/subtoken/takeFirstWord.yml | 2 +- .../subtoken/takeLastPastFirstCharHarp.yml | 8 ++++---- .../subtoken/takeLastPastFirstWordHarp.yml | 8 ++++---- .../subtoken/takeLastThreeCharHarp.yml | 8 ++++---- .../recorded/subtoken/takeLastTwoWordHarp.yml | 8 ++++---- .../takeSecondCharLookPastEndOfToken.yml | 8 ++++---- .../takeSecondCharLookPastSecondCharTrap.yml | 14 ++++++------- .../recorded/subtoken/takeSecondWord.yml | 2 +- .../subtoken/takeThirdPastSecondWordHarp.yml | 8 ++++---- .../surroundingPair/chuckMatching.yml | 2 +- .../surroundingPair/chuckMatching2.yml | 2 +- .../surroundingPair/chuckMatching3.yml | 2 +- .../recorded/surroundingPair/chuckPair.yml | 2 +- .../recorded/surroundingPair/chuckRound.yml | 2 +- .../recorded/surroundingPair/clearCurly.yml | 2 +- .../surroundingPair/clearMatching.yml | 2 +- .../surroundingPair/clearMatching10.yml | 2 +- .../surroundingPair/clearMatching11.yml | 2 +- .../surroundingPair/clearMatching12.yml | 2 +- .../surroundingPair/clearMatching13.yml | 2 +- .../surroundingPair/clearMatching14.yml | 2 +- .../surroundingPair/clearMatching15.yml | 2 +- .../surroundingPair/clearMatching2.yml | 2 +- .../surroundingPair/clearMatching3.yml | 2 +- .../surroundingPair/clearMatching4.yml | 2 +- .../surroundingPair/clearMatching5.yml | 2 +- .../surroundingPair/clearMatching6.yml | 2 +- .../surroundingPair/clearMatching7.yml | 2 +- .../surroundingPair/clearMatching8.yml | 2 +- .../surroundingPair/clearMatching9.yml | 2 +- .../recorded/surroundingPair/clearPair.yml | 2 +- .../recorded/surroundingPair/clearPair2.yml | 2 +- .../recorded/surroundingPair/clearPair3.yml | 2 +- .../recorded/surroundingPair/clearPair4.yml | 2 +- .../surroundingPair/clearPairCurly.yml | 2 +- .../recorded/surroundingPair/clearRound.yml | 2 +- .../recorded/surroundingPair/clearSquare.yml | 2 +- .../recorded/surroundingPair/clearSquare2.yml | 2 +- .../recorded/surroundingPair/clearSquare3.yml | 2 +- .../recorded/surroundingPair/clearSquare4.yml | 2 +- .../recorded/surroundingPair/clearSquare5.yml | 2 +- .../surroundingPair/clearSquareLack.yml | 8 ++++---- .../surroundingPair/clearSquareRack.yml | 8 ++++---- .../recorded/updateSelections/bringFine.yml | 8 ++++---- .../bringFineAfterThirdCarThis.yml | 8 ++++---- .../updateSelections/bringFineAfterThis.yml | 8 ++++---- .../updateSelections/bringFineAfterThis2.yml | 8 ++++---- .../updateSelections/bringFineBeforeThis.yml | 8 ++++---- .../bringFineToFirstCarWhale.yml | 14 ++++++------- .../bringFineToFirstTwoCar.yml | 8 ++++---- .../bringFineToLastCarWhale.yml | 14 ++++++------- .../bringFineToLastTwoCar.yml | 8 ++++---- .../bringFineToThirdCarWhale.yml | 14 ++++++------- .../updateSelections/bringFineToWhale.yml | 14 ++++++------- .../updateSelections/bringFineToWhale2.yml | 14 ++++++------- .../updateSelections/bringFineToWhale3.yml | 14 ++++++------- .../updateSelections/bringFineToWhale4.yml | 14 ++++++------- .../updateSelections/bringFineToWhale5.yml | 14 ++++++------- .../bringHarpToEndOfWhale.yml | 14 ++++++------- ...gHarpToFourthCarWhalePastSecondCarHarp.yml | 14 ++++++------- ...ingHarpToSecondCarFinePastThirdCarHarp.yml | 14 ++++++------- ...ngHarpToSecondCarFinePastThirdCarWhale.yml | 20 +++++++++---------- .../bringHarpToStartOfWhale.yml | 14 ++++++------- .../recorded/updateSelections/bringWhale.yml | 8 ++++---- .../updateSelections/bringWhaleAfterFine.yml | 14 ++++++------- .../updateSelections/bringWhaleAfterThis.yml | 8 ++++---- .../updateSelections/bringWhaleAfterThis2.yml | 8 ++++---- .../updateSelections/bringWhaleBeforeThis.yml | 8 ++++---- .../bringWhaleToEndOfFine.yml | 14 ++++++------- .../updateSelections/bringWhaleToFine.yml | 14 ++++++------- .../updateSelections/chuckFirstCarWhale.yml | 8 ++++---- .../chuckFirstPastSecondCar.yml | 2 +- .../chuckFourthPastFifthCar.yml | 2 +- .../updateSelections/chuckLastCarWhale.yml | 8 ++++---- .../chuckSecondCarFinePastThirdCarWhale.yml | 14 ++++++------- .../chuckSecondPastThirdCar.yml | 2 +- .../chuckThirdCarWhalePastSecondCarHarp.yml | 14 ++++++------- .../recorded/updateSelections/commentTrap.yml | 8 ++++---- 448 files changed, 1135 insertions(+), 1135 deletions(-) diff --git a/src/test/suite/fixtures/recorded/actions/bringVest.yml b/src/test/suite/fixtures/recorded/actions/bringVest.yml index cd9eb95f65..56f3364f2f 100644 --- a/src/test/suite/fixtures/recorded/actions/bringVest.yml +++ b/src/test/suite/fixtures/recorded/actions/bringVest.yml @@ -12,10 +12,6 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -23,6 +19,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | value diff --git a/src/test/suite/fixtures/recorded/actions/bringVestToCap.yml b/src/test/suite/fixtures/recorded/actions/bringVestToCap.yml index 13b142195b..f81b3163e1 100644 --- a/src/test/suite/fixtures/recorded/actions/bringVestToCap.yml +++ b/src/test/suite/fixtures/recorded/actions/bringVestToCap.yml @@ -8,13 +8,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -22,6 +15,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/callFine.yml b/src/test/suite/fixtures/recorded/actions/callFine.yml index 82daef04cb..1319cceeed 100644 --- a/src/test/suite/fixtures/recorded/actions/callFine.yml +++ b/src/test/suite/fixtures/recorded/actions/callFine.yml @@ -12,10 +12,6 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: |- foo; @@ -26,6 +22,10 @@ initialState: active: {line: 1, character: 3} - anchor: {line: 2, character: 0} active: {line: 2, character: 3} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: |- foo; diff --git a/src/test/suite/fixtures/recorded/actions/callVest.yml b/src/test/suite/fixtures/recorded/actions/callVest.yml index 1365585c6f..66022e8345 100644 --- a/src/test/suite/fixtures/recorded/actions/callVest.yml +++ b/src/test/suite/fixtures/recorded/actions/callVest.yml @@ -12,10 +12,6 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -23,6 +19,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | value() diff --git a/src/test/suite/fixtures/recorded/actions/callVestOnCap.yml b/src/test/suite/fixtures/recorded/actions/callVestOnCap.yml index e2c0990395..0233e03694 100644 --- a/src/test/suite/fixtures/recorded/actions/callVestOnCap.yml +++ b/src/test/suite/fixtures/recorded/actions/callVestOnCap.yml @@ -8,13 +8,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -22,6 +15,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/carveVest.yml b/src/test/suite/fixtures/recorded/actions/carveVest.yml index 268107c2fa..d94dbe8846 100644 --- a/src/test/suite/fixtures/recorded/actions/carveVest.yml +++ b/src/test/suite/fixtures/recorded/actions/carveVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/chuckVest.yml b/src/test/suite/fixtures/recorded/actions/chuckVest.yml index ed112bb040..8725734116 100644 --- a/src/test/suite/fixtures/recorded/actions/chuckVest.yml +++ b/src/test/suite/fixtures/recorded/actions/chuckVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/clearVest.yml b/src/test/suite/fixtures/recorded/actions/clearVest.yml index e39440f29d..1391da55c6 100644 --- a/src/test/suite/fixtures/recorded/actions/clearVest.yml +++ b/src/test/suite/fixtures/recorded/actions/clearVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/commentVest.yml b/src/test/suite/fixtures/recorded/actions/commentVest.yml index e8b1d1a6ba..624d5cbca5 100644 --- a/src/test/suite/fixtures/recorded/actions/commentVest.yml +++ b/src/test/suite/fixtures/recorded/actions/commentVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/copyVest.yml b/src/test/suite/fixtures/recorded/actions/copyVest.yml index 3a16165e1b..d739bd99a6 100644 --- a/src/test/suite/fixtures/recorded/actions/copyVest.yml +++ b/src/test/suite/fixtures/recorded/actions/copyVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} clipboard: value + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/dedentVest.yml b/src/test/suite/fixtures/recorded/actions/dedentVest.yml index 560ad6e7e8..b6e7db9c23 100644 --- a/src/test/suite/fixtures/recorded/actions/dedentVest.yml +++ b/src/test/suite/fixtures/recorded/actions/dedentVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 10} - end: {line: 1, character: 15} initialState: documentContents: |2 @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 10} + end: {line: 1, character: 15} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/drinkVest.yml b/src/test/suite/fixtures/recorded/actions/drinkVest.yml index 4f88617b02..c695de294d 100644 --- a/src/test/suite/fixtures/recorded/actions/drinkVest.yml +++ b/src/test/suite/fixtures/recorded/actions/drinkVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/dropVest.yml b/src/test/suite/fixtures/recorded/actions/dropVest.yml index 0869bd03dd..86b3d69d31 100644 --- a/src/test/suite/fixtures/recorded/actions/dropVest.yml +++ b/src/test/suite/fixtures/recorded/actions/dropVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/dupeUpVest.yml b/src/test/suite/fixtures/recorded/actions/dupeUpVest.yml index ce9d260648..1247ce2f71 100644 --- a/src/test/suite/fixtures/recorded/actions/dupeUpVest.yml +++ b/src/test/suite/fixtures/recorded/actions/dupeUpVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 1, character: 11} active: {line: 1, character: 11} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/dupeVest.yml b/src/test/suite/fixtures/recorded/actions/dupeVest.yml index ff3d7fc046..70707dcbaf 100644 --- a/src/test/suite/fixtures/recorded/actions/dupeVest.yml +++ b/src/test/suite/fixtures/recorded/actions/dupeVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 1, character: 11} active: {line: 1, character: 11} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/findVest.yml b/src/test/suite/fixtures/recorded/actions/findVest.yml index 7c26ff6b42..8d8ca3bdf3 100644 --- a/src/test/suite/fixtures/recorded/actions/findVest.yml +++ b/src/test/suite/fixtures/recorded/actions/findVest.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: - {showDecorations: null, ensureSingleTarget: true} -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/floatVest.yml b/src/test/suite/fixtures/recorded/actions/floatVest.yml index bc1a7cd4ab..7f50b03f22 100644 --- a/src/test/suite/fixtures/recorded/actions/floatVest.yml +++ b/src/test/suite/fixtures/recorded/actions/floatVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/actions/indentVest.yml b/src/test/suite/fixtures/recorded/actions/indentVest.yml index 545e3e1c2d..1ad5dcf980 100644 --- a/src/test/suite/fixtures/recorded/actions/indentVest.yml +++ b/src/test/suite/fixtures/recorded/actions/indentVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |2 diff --git a/src/test/suite/fixtures/recorded/actions/moveVest.yml b/src/test/suite/fixtures/recorded/actions/moveVest.yml index 677e33ac5f..1da2586e1f 100644 --- a/src/test/suite/fixtures/recorded/actions/moveVest.yml +++ b/src/test/suite/fixtures/recorded/actions/moveVest.yml @@ -12,10 +12,6 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -23,6 +19,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | value diff --git a/src/test/suite/fixtures/recorded/actions/moveVestToCap.yml b/src/test/suite/fixtures/recorded/actions/moveVestToCap.yml index 5a8fb2f552..b2be76f24b 100644 --- a/src/test/suite/fixtures/recorded/actions/moveVestToCap.yml +++ b/src/test/suite/fixtures/recorded/actions/moveVestToCap.yml @@ -8,13 +8,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -22,6 +15,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/pasteCap.yml b/src/test/suite/fixtures/recorded/actions/pasteCap.yml index a584122696..ff9a7c8750 100644 --- a/src/test/suite/fixtures/recorded/actions/pasteCap.yml +++ b/src/test/suite/fixtures/recorded/actions/pasteCap.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} clipboard: value + marks: + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/phonesSpy.yml b/src/test/suite/fixtures/recorded/actions/phonesSpy.yml index 684583a0be..639ad4e222 100644 --- a/src/test/suite/fixtures/recorded/actions/phonesSpy.yml +++ b/src/test/suite/fixtures/recorded/actions/phonesSpy.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: s} extraArgs: - [sum] -marks: - default.s: - start: {line: 1, character: 15} - end: {line: 1, character: 19} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.s: + start: {line: 1, character: 15} + end: {line: 1, character: 19} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/postVest.yml b/src/test/suite/fixtures/recorded/actions/postVest.yml index 5d988c90de..1f32d0c31f 100644 --- a/src/test/suite/fixtures/recorded/actions/postVest.yml +++ b/src/test/suite/fixtures/recorded/actions/postVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/pourVest.yml b/src/test/suite/fixtures/recorded/actions/pourVest.yml index cc630b3024..8b309f5d4a 100644 --- a/src/test/suite/fixtures/recorded/actions/pourVest.yml +++ b/src/test/suite/fixtures/recorded/actions/pourVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/actions/preeVest.yml b/src/test/suite/fixtures/recorded/actions/preeVest.yml index 4267a083e8..7484651753 100644 --- a/src/test/suite/fixtures/recorded/actions/preeVest.yml +++ b/src/test/suite/fixtures/recorded/actions/preeVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/puffVest.yml b/src/test/suite/fixtures/recorded/actions/puffVest.yml index 08341c16ee..efd898b894 100644 --- a/src/test/suite/fixtures/recorded/actions/puffVest.yml +++ b/src/test/suite/fixtures/recorded/actions/puffVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake.yml b/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake.yml index bb6ef78ab8..4a40e0c505 100644 --- a/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake.yml +++ b/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: - {showDecorations: false, ensureSingleTarget: null} -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 25} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 25} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake2.yml b/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake2.yml index 04de68b87b..308cbf513b 100644 --- a/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake2.yml +++ b/src/test/suite/fixtures/recorded/actions/reformatHarpAsSnake2.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: - [hello_world] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 25} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 25} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/replaceAirAndBatAndCapWithCount.yml b/src/test/suite/fixtures/recorded/actions/replaceAirAndBatAndCapWithCount.yml index 8fcf9de898..c1581c5ac8 100644 --- a/src/test/suite/fixtures/recorded/actions/replaceAirAndBatAndCapWithCount.yml +++ b/src/test/suite/fixtures/recorded/actions/replaceAirAndBatAndCapWithCount.yml @@ -13,16 +13,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: - {start: 0} -marks: - default.a: - start: {line: 1, character: 0} - end: {line: 1, character: 1} - default.b: - start: {line: 2, character: 0} - end: {line: 2, character: 1} - default.c: - start: {line: 3, character: 0} - end: {line: 3, character: 1} initialState: documentContents: | @@ -32,6 +22,16 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 1, character: 0} + end: {line: 1, character: 1} + default.b: + start: {line: 2, character: 0} + end: {line: 2, character: 1} + default.c: + start: {line: 3, character: 0} + end: {line: 3, character: 1} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/replaceVestWithWhatever.yml b/src/test/suite/fixtures/recorded/actions/replaceVestWithWhatever.yml index 66e664ddcf..df496bef1a 100644 --- a/src/test/suite/fixtures/recorded/actions/replaceVestWithWhatever.yml +++ b/src/test/suite/fixtures/recorded/actions/replaceVestWithWhatever.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: - [whatever] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/reverseAirAndBatAndCap.yml b/src/test/suite/fixtures/recorded/actions/reverseAirAndBatAndCap.yml index 0d2282ea22..c72912234b 100644 --- a/src/test/suite/fixtures/recorded/actions/reverseAirAndBatAndCap.yml +++ b/src/test/suite/fixtures/recorded/actions/reverseAirAndBatAndCap.yml @@ -12,16 +12,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.a: - start: {line: 1, character: 16} - end: {line: 1, character: 17} - default.b: - start: {line: 1, character: 21} - end: {line: 1, character: 22} - default.c: - start: {line: 1, character: 26} - end: {line: 1, character: 27} initialState: documentContents: | @@ -29,6 +19,16 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 1, character: 16} + end: {line: 1, character: 17} + default.b: + start: {line: 1, character: 21} + end: {line: 1, character: 22} + default.c: + start: {line: 1, character: 26} + end: {line: 1, character: 27} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/roundWrapThis.yml b/src/test/suite/fixtures/recorded/actions/roundWrapThis.yml index dbe1618540..17b3247d4d 100644 --- a/src/test/suite/fixtures/recorded/actions/roundWrapThis.yml +++ b/src/test/suite/fixtures/recorded/actions/roundWrapThis.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [(, )] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | () diff --git a/src/test/suite/fixtures/recorded/actions/roundWrapVest.yml b/src/test/suite/fixtures/recorded/actions/roundWrapVest.yml index f554bcd369..b106a694e2 100644 --- a/src/test/suite/fixtures/recorded/actions/roundWrapVest.yml +++ b/src/test/suite/fixtures/recorded/actions/roundWrapVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [(, )] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 1, character: 11} active: {line: 1, character: 11} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/roundWrapVest2.yml b/src/test/suite/fixtures/recorded/actions/roundWrapVest2.yml index c7ee924d0f..65d537ff31 100644 --- a/src/test/suite/fixtures/recorded/actions/roundWrapVest2.yml +++ b/src/test/suite/fixtures/recorded/actions/roundWrapVest2.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [(, )] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/sortAirAndCapAndBat.yml b/src/test/suite/fixtures/recorded/actions/sortAirAndCapAndBat.yml index 45746330d5..03bb8ebf18 100644 --- a/src/test/suite/fixtures/recorded/actions/sortAirAndCapAndBat.yml +++ b/src/test/suite/fixtures/recorded/actions/sortAirAndCapAndBat.yml @@ -12,16 +12,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: b} extraArgs: [] -marks: - default.a: - start: {line: 1, character: 16} - end: {line: 1, character: 17} - default.c: - start: {line: 1, character: 21} - end: {line: 1, character: 22} - default.b: - start: {line: 1, character: 26} - end: {line: 1, character: 27} initialState: documentContents: | @@ -29,6 +19,16 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 1, character: 16} + end: {line: 1, character: 17} + default.c: + start: {line: 1, character: 21} + end: {line: 1, character: 22} + default.b: + start: {line: 1, character: 26} + end: {line: 1, character: 27} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/swapVestWithCap.yml b/src/test/suite/fixtures/recorded/actions/swapVestWithCap.yml index 29852fe55b..187ffc7409 100644 --- a/src/test/suite/fixtures/recorded/actions/swapVestWithCap.yml +++ b/src/test/suite/fixtures/recorded/actions/swapVestWithCap.yml @@ -8,13 +8,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -22,6 +15,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/actions/swapWithVest.yml b/src/test/suite/fixtures/recorded/actions/swapWithVest.yml index 8b5bffbfce..1f5d5e6eea 100644 --- a/src/test/suite/fixtures/recorded/actions/swapWithVest.yml +++ b/src/test/suite/fixtures/recorded/actions/swapWithVest.yml @@ -7,10 +7,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | value diff --git a/src/test/suite/fixtures/recorded/actions/takeVest.yml b/src/test/suite/fixtures/recorded/actions/takeVest.yml index 8d03645601..4d71b42952 100644 --- a/src/test/suite/fixtures/recorded/actions/takeVest.yml +++ b/src/test/suite/fixtures/recorded/actions/takeVest.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeCapAndVestAndHarp.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeCapAndVestAndHarp.yml index 12644573d6..2eb64d51e0 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeCapAndVestAndHarp.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeCapAndVestAndHarp.yml @@ -12,16 +12,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} initialState: documentContents: | @@ -29,6 +19,16 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 20} + marks: + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeCapPastHarp.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeCapPastHarp.yml index 244cad1b3f..ca3f7bfe6d 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeCapPastHarp.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeCapPastHarp.yml @@ -13,13 +13,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeHarpAndVestAndCap.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeHarpAndVestAndCap.yml index 2a466e379a..b12a277f53 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeHarpAndVestAndCap.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeHarpAndVestAndCap.yml @@ -12,16 +12,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: c} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -29,6 +19,16 @@ initialState: selections: - anchor: {line: 1, character: 20} active: {line: 1, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeHarpPastCap.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeHarpPastCap.yml index fa48f20b8e..e5a7db1b42 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeHarpPastCap.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeHarpPastCap.yml @@ -13,13 +13,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} - default.c: - start: {line: 1, character: 0} - end: {line: 1, character: 5} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} + default.c: + start: {line: 1, character: 0} + end: {line: 1, character: 5} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeLineVestAndAir.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeLineVestAndAir.yml index 5f111b3366..d36cec1872 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeLineVestAndAir.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeLineVestAndAir.yml @@ -11,18 +11,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.v: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.a: - start: {line: 0, character: 13} - end: {line: 0, character: 14} initialState: documentContents: " value = {a:2}" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.a: + start: {line: 0, character: 13} + end: {line: 0, character: 14} finalState: documentContents: " value = {a:2}" selections: diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takePastEndOfToken.yml b/src/test/suite/fixtures/recorded/compoundTargets/takePastEndOfToken.yml index 99c1363520..62b0a503f1 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takePastEndOfToken.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takePastEndOfToken.yml @@ -9,12 +9,12 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: {} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} + marks: {} finalState: documentContents: hello there selections: diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takePastStartOfToken.yml b/src/test/suite/fixtures/recorded/compoundTargets/takePastStartOfToken.yml index 0b6d248283..8589e57cd0 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takePastStartOfToken.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takePastStartOfToken.yml @@ -9,12 +9,12 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: {} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} + marks: {} finalState: documentContents: hello there selections: diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takePastTrap.yml b/src/test/suite/fixtures/recorded/compoundTargets/takePastTrap.yml index 464eea0521..69d8f23455 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takePastTrap.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takePastTrap.yml @@ -11,15 +11,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.t: - start: {line: 0, character: 6} - end: {line: 0, character: 11} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.t: + start: {line: 0, character: 6} + end: {line: 0, character: 11} finalState: documentContents: hello there selections: diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeTokenPastTrap.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeTokenPastTrap.yml index da86ce7fc4..7e52560132 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeTokenPastTrap.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeTokenPastTrap.yml @@ -11,15 +11,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.t: - start: {line: 0, character: 6} - end: {line: 0, character: 11} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.t: + start: {line: 0, character: 6} + end: {line: 0, character: 11} finalState: documentContents: hello there selections: diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeVestTweenWhale.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeVestTweenWhale.yml index 0df1ff1d14..a2d74dc533 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeVestTweenWhale.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeVestTweenWhale.yml @@ -13,13 +13,6 @@ command: excludeStart: true excludeEnd: true extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.w: - start: {line: 1, character: 21} - end: {line: 1, character: 26} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 1, character: 26} active: {line: 1, character: 11} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.w: + start: {line: 1, character: 21} + end: {line: 1, character: 26} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeVestUntilWhale.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeVestUntilWhale.yml index acb59d6319..841d68fd59 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeVestUntilWhale.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeVestUntilWhale.yml @@ -13,13 +13,6 @@ command: excludeStart: false excludeEnd: true extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.w: - start: {line: 1, character: 21} - end: {line: 1, character: 26} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.w: + start: {line: 1, character: 21} + end: {line: 1, character: 26} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleTweenVest.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleTweenVest.yml index c42693b2c7..16a5792d6f 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleTweenVest.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleTweenVest.yml @@ -13,13 +13,6 @@ command: excludeStart: true excludeEnd: true extraArgs: [] -marks: - default.w: - start: {line: 1, character: 21} - end: {line: 1, character: 26} - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.w: + start: {line: 1, character: 21} + end: {line: 1, character: 26} + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleUntilVest.yml b/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleUntilVest.yml index d9cfc90d56..ded501aa59 100644 --- a/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleUntilVest.yml +++ b/src/test/suite/fixtures/recorded/compoundTargets/takeWhaleUntilVest.yml @@ -13,13 +13,6 @@ command: excludeStart: false excludeEnd: true extraArgs: [] -marks: - default.w: - start: {line: 1, character: 21} - end: {line: 1, character: 26} - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 1, character: 6} active: {line: 1, character: 21} + marks: + default.w: + start: {line: 1, character: 21} + end: {line: 1, character: 26} + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/headTail/takeHead.yml b/src/test/suite/fixtures/recorded/headTail/takeHead.yml index 6d13ac94b8..457acac3d7 100644 --- a/src/test/suite/fixtures/recorded/headTail/takeHead.yml +++ b/src/test/suite/fixtures/recorded/headTail/takeHead.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: head} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/headTail/takeHeadVest.yml b/src/test/suite/fixtures/recorded/headTail/takeHeadVest.yml index 4f30d9794c..7fd58366e4 100644 --- a/src/test/suite/fixtures/recorded/headTail/takeHeadVest.yml +++ b/src/test/suite/fixtures/recorded/headTail/takeHeadVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: head} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/headTail/takeTail.yml b/src/test/suite/fixtures/recorded/headTail/takeTail.yml index 6d3b0f8c6c..53af0023cd 100644 --- a/src/test/suite/fixtures/recorded/headTail/takeTail.yml +++ b/src/test/suite/fixtures/recorded/headTail/takeTail.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: tail} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 6} active: {line: 1, character: 6} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/headTail/takeTailVest.yml b/src/test/suite/fixtures/recorded/headTail/takeTailVest.yml index 195fac0f75..74acea8d1d 100644 --- a/src/test/suite/fixtures/recorded/headTail/takeTailVest.yml +++ b/src/test/suite/fixtures/recorded/headTail/takeTailVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: tail} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/bringLineBatPastEndOfFunkToThis.yml b/src/test/suite/fixtures/recorded/inference/bringLineBatPastEndOfFunkToThis.yml index ba851bca11..141dfe762b 100644 --- a/src/test/suite/fixtures/recorded/inference/bringLineBatPastEndOfFunkToThis.yml +++ b/src/test/suite/fixtures/recorded/inference/bringLineBatPastEndOfFunkToThis.yml @@ -18,10 +18,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [] -marks: - default.b: - start: {line: 1, character: 8} - end: {line: 1, character: 11} initialState: documentContents: | function foo() { @@ -34,6 +30,10 @@ initialState: selections: - anchor: {line: 6, character: 20} active: {line: 6, character: 20} + marks: + default.b: + start: {line: 1, character: 8} + end: {line: 1, character: 11} finalState: documentContents: | function foo() { diff --git a/src/test/suite/fixtures/recorded/inference/bringMapAirToLineHarp.yml b/src/test/suite/fixtures/recorded/inference/bringMapAirToLineHarp.yml index 69be80cb9b..70eb2e7bd9 100644 --- a/src/test/suite/fixtures/recorded/inference/bringMapAirToLineHarp.yml +++ b/src/test/suite/fixtures/recorded/inference/bringMapAirToLineHarp.yml @@ -10,18 +10,18 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.a: - start: {line: 1, character: 13} - end: {line: 1, character: 14} - default.h: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: " hello world\r\n value = {a:2}" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 1, character: 13} + end: {line: 1, character: 14} + default.h: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: " {a:2}\r\n value = {a:2}" selections: diff --git a/src/test/suite/fixtures/recorded/inference/bringMapAirToTokenHarp.yml b/src/test/suite/fixtures/recorded/inference/bringMapAirToTokenHarp.yml index ea7b5b33c0..edba8b54cf 100644 --- a/src/test/suite/fixtures/recorded/inference/bringMapAirToTokenHarp.yml +++ b/src/test/suite/fixtures/recorded/inference/bringMapAirToTokenHarp.yml @@ -10,18 +10,18 @@ command: selectionType: token mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.a: - start: {line: 1, character: 13} - end: {line: 1, character: 14} - default.h: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: " hello\r\n value = {a:2}" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 1, character: 13} + end: {line: 1, character: 14} + default.h: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: " {a:2}\r\n value = {a:2}" selections: diff --git a/src/test/suite/fixtures/recorded/inference/bringOddToLine.yml b/src/test/suite/fixtures/recorded/inference/bringOddToLine.yml index 5e02da4c70..12f119dedd 100644 --- a/src/test/suite/fixtures/recorded/inference/bringOddToLine.yml +++ b/src/test/suite/fixtures/recorded/inference/bringOddToLine.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: o} - {type: primitive, selectionType: line} extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -19,6 +15,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/bringOddToState.yml b/src/test/suite/fixtures/recorded/inference/bringOddToState.yml index 48b8b02800..dd7fb6f415 100644 --- a/src/test/suite/fixtures/recorded/inference/bringOddToState.yml +++ b/src/test/suite/fixtures/recorded/inference/bringOddToState.yml @@ -8,10 +8,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement, includeSiblings: false} extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/bringOddToToken.yml b/src/test/suite/fixtures/recorded/inference/bringOddToToken.yml index 6d827359e5..0894cee13a 100644 --- a/src/test/suite/fixtures/recorded/inference/bringOddToToken.yml +++ b/src/test/suite/fixtures/recorded/inference/bringOddToToken.yml @@ -7,10 +7,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: o} - {type: primitive, selectionType: token} extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -19,6 +15,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/bringTokenHarpToMapAir.yml b/src/test/suite/fixtures/recorded/inference/bringTokenHarpToMapAir.yml index 5d81795794..d424cf2091 100644 --- a/src/test/suite/fixtures/recorded/inference/bringTokenHarpToMapAir.yml +++ b/src/test/suite/fixtures/recorded/inference/bringTokenHarpToMapAir.yml @@ -10,18 +10,18 @@ command: modifier: {type: containingScope, scopeType: map, includeSiblings: false} mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.h: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.a: - start: {line: 1, character: 13} - end: {line: 1, character: 14} initialState: documentContents: " hello\r\n value = {a:2}" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.a: + start: {line: 1, character: 13} + end: {line: 1, character: 14} finalState: documentContents: " hello\r\n value = hello" selections: diff --git a/src/test/suite/fixtures/recorded/inference/ifWrapTokenFine.yml b/src/test/suite/fixtures/recorded/inference/ifWrapTokenFine.yml index 59c491081b..1fa522c32b 100644 --- a/src/test/suite/fixtures/recorded/inference/ifWrapTokenFine.yml +++ b/src/test/suite/fixtures/recorded/inference/ifWrapTokenFine.yml @@ -7,16 +7,16 @@ command: selectionType: token mark: {type: decoratedSymbol, symbolColor: default, character: f} extraArgs: [ifStatement.consequence] -marks: - default.f: - start: {line: 0, character: 6} - end: {line: 0, character: 9} initialState: documentContents: | const foo = "hello"; selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: + default.f: + start: {line: 0, character: 6} + end: {line: 0, character: 9} finalState: documentContents: | const if () { diff --git a/src/test/suite/fixtures/recorded/inference/takeAfterVestPastAir.yml b/src/test/suite/fixtures/recorded/inference/takeAfterVestPastAir.yml index 0c18029d29..6d4bdf40b2 100644 --- a/src/test/suite/fixtures/recorded/inference/takeAfterVestPastAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeAfterVestPastAir.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeAfterVestPastBeforeAir.yml b/src/test/suite/fixtures/recorded/inference/takeAfterVestPastBeforeAir.yml index 32b6c6c3ac..07c2a52d1b 100644 --- a/src/test/suite/fixtures/recorded/inference/takeAfterVestPastBeforeAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeAfterVestPastBeforeAir.yml @@ -15,13 +15,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -31,6 +24,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeAirPastEndOfLine.yml b/src/test/suite/fixtures/recorded/inference/takeAirPastEndOfLine.yml index 634af79ab9..86726beb05 100644 --- a/src/test/suite/fixtures/recorded/inference/takeAirPastEndOfLine.yml +++ b/src/test/suite/fixtures/recorded/inference/takeAirPastEndOfLine.yml @@ -11,10 +11,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -24,6 +20,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeEachPastStartOfLine.yml b/src/test/suite/fixtures/recorded/inference/takeEachPastStartOfLine.yml index 3c50de2eb5..29700ca4b5 100644 --- a/src/test/suite/fixtures/recorded/inference/takeEachPastStartOfLine.yml +++ b/src/test/suite/fixtures/recorded/inference/takeEachPastStartOfLine.yml @@ -11,10 +11,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.e: - start: {line: 0, character: 13} - end: {line: 0, character: 18} initialState: documentContents: |- const foo = "hello"; @@ -23,6 +19,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.e: + start: {line: 0, character: 13} + end: {line: 0, character: 18} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/takeFirstWord.yml b/src/test/suite/fixtures/recorded/inference/takeFirstWord.yml index a90547ecfc..89b0834b95 100644 --- a/src/test/suite/fixtures/recorded/inference/takeFirstWord.yml +++ b/src/test/suite/fixtures/recorded/inference/takeFirstWord.yml @@ -7,7 +7,6 @@ command: selectionType: token modifier: {type: subpiece, pieceType: word, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: |+ @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 18} active: {line: 1, character: 18} + marks: {} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/inference/takeHarpAndStringEach.yml b/src/test/suite/fixtures/recorded/inference/takeHarpAndStringEach.yml index 6384047a45..2006165640 100644 --- a/src/test/suite/fixtures/recorded/inference/takeHarpAndStringEach.yml +++ b/src/test/suite/fixtures/recorded/inference/takeHarpAndStringEach.yml @@ -11,13 +11,6 @@ command: modifier: {type: containingScope, scopeType: string} mark: {type: decoratedSymbol, symbolColor: default, character: e} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} - default.e: - start: {line: 3, character: 15} - end: {line: 3, character: 20} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} + default.e: + start: {line: 3, character: 15} + end: {line: 3, character: 20} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeHarpPastStringEach.yml b/src/test/suite/fixtures/recorded/inference/takeHarpPastStringEach.yml index 80ae323d96..44208159f7 100644 --- a/src/test/suite/fixtures/recorded/inference/takeHarpPastStringEach.yml +++ b/src/test/suite/fixtures/recorded/inference/takeHarpPastStringEach.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} - default.e: - start: {line: 3, character: 15} - end: {line: 3, character: 20} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} + default.e: + start: {line: 3, character: 15} + end: {line: 3, character: 20} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeLastChar.yml b/src/test/suite/fixtures/recorded/inference/takeLastChar.yml index 43d2545a61..eaebcbc932 100644 --- a/src/test/suite/fixtures/recorded/inference/takeLastChar.yml +++ b/src/test/suite/fixtures/recorded/inference/takeLastChar.yml @@ -7,7 +7,6 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1} extraArgs: [] -marks: {} initialState: documentContents: |+ @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 16} active: {line: 1, character: 16} + marks: {} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/inference/takeLinePastAir.yml b/src/test/suite/fixtures/recorded/inference/takeLinePastAir.yml index 9b7a3a4f52..240f95ef94 100644 --- a/src/test/suite/fixtures/recorded/inference/takeLinePastAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeLinePastAir.yml @@ -11,10 +11,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -24,6 +20,10 @@ initialState: selections: - anchor: {line: 1, character: 6} active: {line: 1, character: 6} + marks: + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeLineVestAndAir.yml b/src/test/suite/fixtures/recorded/inference/takeLineVestAndAir.yml index 81e9868a2d..aa2e3481a2 100644 --- a/src/test/suite/fixtures/recorded/inference/takeLineVestAndAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeLineVestAndAir.yml @@ -11,13 +11,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeLineVestPastAir.yml b/src/test/suite/fixtures/recorded/inference/takeLineVestPastAir.yml index f4c5565231..186b7be1c0 100644 --- a/src/test/suite/fixtures/recorded/inference/takeLineVestPastAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeLineVestPastAir.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeOddPastEndOfState.yml b/src/test/suite/fixtures/recorded/inference/takeOddPastEndOfState.yml index f0387c468d..69f32a1f77 100644 --- a/src/test/suite/fixtures/recorded/inference/takeOddPastEndOfState.yml +++ b/src/test/suite/fixtures/recorded/inference/takeOddPastEndOfState.yml @@ -15,10 +15,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -27,6 +23,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/takeOddPastLine.yml b/src/test/suite/fixtures/recorded/inference/takeOddPastLine.yml index ea955fcf7d..42597b3782 100644 --- a/src/test/suite/fixtures/recorded/inference/takeOddPastLine.yml +++ b/src/test/suite/fixtures/recorded/inference/takeOddPastLine.yml @@ -11,10 +11,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -23,6 +19,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/takeOddPastState.yml b/src/test/suite/fixtures/recorded/inference/takeOddPastState.yml index 0680bddeae..8462c640e7 100644 --- a/src/test/suite/fixtures/recorded/inference/takeOddPastState.yml +++ b/src/test/suite/fixtures/recorded/inference/takeOddPastState.yml @@ -13,10 +13,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -25,6 +21,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/takeOddPastToken.yml b/src/test/suite/fixtures/recorded/inference/takeOddPastToken.yml index 717de5f597..db0f8f792f 100644 --- a/src/test/suite/fixtures/recorded/inference/takeOddPastToken.yml +++ b/src/test/suite/fixtures/recorded/inference/takeOddPastToken.yml @@ -11,10 +11,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.o: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: |- const foo = "hello"; @@ -23,6 +19,10 @@ initialState: selections: - anchor: {line: 2, character: 18} active: {line: 2, character: 18} + marks: + default.o: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: |- const foo = "hello"; diff --git a/src/test/suite/fixtures/recorded/inference/takePastLineAir.yml b/src/test/suite/fixtures/recorded/inference/takePastLineAir.yml index ceb2c9d95a..5569239d09 100644 --- a/src/test/suite/fixtures/recorded/inference/takePastLineAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takePastLineAir.yml @@ -12,10 +12,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -25,6 +21,10 @@ initialState: selections: - anchor: {line: 1, character: 6} active: {line: 1, character: 6} + marks: + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeStringHarpAndEach.yml b/src/test/suite/fixtures/recorded/inference/takeStringHarpAndEach.yml index f9ddeff7fb..ce714ce670 100644 --- a/src/test/suite/fixtures/recorded/inference/takeStringHarpAndEach.yml +++ b/src/test/suite/fixtures/recorded/inference/takeStringHarpAndEach.yml @@ -11,13 +11,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: e} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} - default.e: - start: {line: 3, character: 15} - end: {line: 3, character: 20} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} + default.e: + start: {line: 3, character: 15} + end: {line: 3, character: 20} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeStringHarpPastEach.yml b/src/test/suite/fixtures/recorded/inference/takeStringHarpPastEach.yml index 5064193b57..72171695b6 100644 --- a/src/test/suite/fixtures/recorded/inference/takeStringHarpPastEach.yml +++ b/src/test/suite/fixtures/recorded/inference/takeStringHarpPastEach.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 20} - default.e: - start: {line: 3, character: 15} - end: {line: 3, character: 20} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 20} + default.e: + start: {line: 3, character: 15} + end: {line: 3, character: 20} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeVestAndLineAir.yml b/src/test/suite/fixtures/recorded/inference/takeVestAndLineAir.yml index a3fb91d8ec..8486331e3a 100644 --- a/src/test/suite/fixtures/recorded/inference/takeVestAndLineAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeVestAndLineAir.yml @@ -11,13 +11,6 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -27,6 +20,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeVestPastAfterAir.yml b/src/test/suite/fixtures/recorded/inference/takeVestPastAfterAir.yml index d9970e31b7..d3d43e329d 100644 --- a/src/test/suite/fixtures/recorded/inference/takeVestPastAfterAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeVestPastAfterAir.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeVestPastBeforeAir.yml b/src/test/suite/fixtures/recorded/inference/takeVestPastBeforeAir.yml index 7ec664d00a..534abedac8 100644 --- a/src/test/suite/fixtures/recorded/inference/takeVestPastBeforeAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeVestPastBeforeAir.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/inference/takeVestPastLineAir.yml b/src/test/suite/fixtures/recorded/inference/takeVestPastLineAir.yml index 39e67d3459..c167726b0b 100644 --- a/src/test/suite/fixtures/recorded/inference/takeVestPastLineAir.yml +++ b/src/test/suite/fixtures/recorded/inference/takeVestPastLineAir.yml @@ -14,13 +14,6 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -30,6 +23,13 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/c/clearFunk.yml b/src/test/suite/fixtures/recorded/languages/c/clearFunk.yml index 58a5508ba6..df80e9ecaf 100644 --- a/src/test/suite/fixtures/recorded/languages/c/clearFunk.yml +++ b/src/test/suite/fixtures/recorded/languages/c/clearFunk.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: |- int f(int a, int b) { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: "" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/elseStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/cpp/elseStateWrapThis.yml index 67f03b5748..6899773833 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/elseStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/elseStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.alternative] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/ifElseWrapThis.yml b/src/test/suite/fixtures/recorded/languages/cpp/ifElseWrapThis.yml index 09f561f114..c200bba920 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/ifElseWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/ifElseWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.consequence] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/ifStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/cpp/ifStateWrapThis.yml index 9ed0d478c3..980a579a7e 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/ifStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/ifStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifStatement.consequence] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeArg.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeArg.yml index 7451361bc0..ad1a02d0f2 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeArg.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: |- int main() { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: |- int main() { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeArg2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeArg2.yml index 53f9aff65f..9da517b735 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeArg2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: |- int f(int a, int b) { @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} + marks: {} finalState: documentContents: |- int f(int a, int b) { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeAttribute.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeAttribute.yml index 92d42b1bb5..f45458ef29 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeAttribute.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeAttribute.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: attribute} extraArgs: [] -marks: {} initialState: documentContents: "[[nodiscard]]\r\nint f(int a = 1) {\r\n}\r\n" selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: {} finalState: documentContents: "[[nodiscard]]\r\nint f(int a = 1) {\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeCall.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeCall.yml index f29a7c0611..eadecca6df 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeCall.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeCall.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionCall} extraArgs: [] -marks: {} initialState: documentContents: |- int f(int a, int b) { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 14} active: {line: 1, character: 14} + marks: {} finalState: documentContents: |- int f(int a, int b) { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeClass.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeClass.yml index 9c0397b9c6..1b273fa54c 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeClass.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeClass.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: class} extraArgs: [] -marks: {} initialState: documentContents: class A { int a; }; selections: - anchor: {line: 0, character: 14} active: {line: 0, character: 14} + marks: {} finalState: documentContents: class A { int a; }; selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeClass2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeClass2.yml index 46fefd29f2..29b2f593ff 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeClass2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeClass2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: class} extraArgs: [] -marks: {} initialState: documentContents: enum class A { B }; selections: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} + marks: {} finalState: documentContents: enum class A { B }; selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeClassName.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeClassName.yml index 5f0c73f456..51fd70b055 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeClassName.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeClassName.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: className} extraArgs: [] -marks: {} initialState: documentContents: class A { int a; }; selections: - anchor: {line: 0, character: 15} active: {line: 0, character: 15} + marks: {} finalState: documentContents: class A { int a; }; selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeClassName2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeClassName2.yml index ead98ca25f..c1ddfd3d3f 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeClassName2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeClassName2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: className} extraArgs: [] -marks: {} initialState: documentContents: enum class A { B }; selections: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} + marks: {} finalState: documentContents: enum class A { B }; selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeClassName3.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeClassName3.yml index 159aa4ce4a..054ec779cf 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeClassName3.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeClassName3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: className} extraArgs: [] -marks: {} initialState: documentContents: void ClassName::method() {} selections: - anchor: {line: 0, character: 26} active: {line: 0, character: 26} + marks: {} finalState: documentContents: void ClassName::method() {} selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeComment.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeComment.yml index 2b2c40e3b3..b42c13105f 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeComment.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeComment.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: comment} extraArgs: [] -marks: {} initialState: documentContents: int a; // the comment selections: - anchor: {line: 0, character: 20} active: {line: 0, character: 20} + marks: {} finalState: documentContents: int a; // the comment selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml index 45b9d99b31..70fc48e3e9 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- int f(int a, int b) { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 16} active: {line: 1, character: 16} + marks: {} finalState: documentContents: |- int f(int a, int b) { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml index a2ce58e9c6..cc91645dc8 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- int f(int a, int b) { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 29} active: {line: 1, character: 29} + marks: {} finalState: documentContents: |- int f(int a, int b) { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeFunk.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeFunk.yml index b99701ba7c..3efc42de51 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeFunk.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeFunk.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: |- int f(int a, int b) { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: |- int f(int a, int b) { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeFunk2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeFunk2.yml index 42bed394b5..122c9c8dd9 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeFunk2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeFunk2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: int f(int a, int b); selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 7} + marks: {} finalState: documentContents: int f(int a, int b); selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName.yml index f19ad0662c..7d09b36788 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a, int b) {\r\n \r\n}" selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: "int f(int a, int b) {\r\n \r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName2.yml index 8090425d19..d96902d746 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: "int C::f(int a, int b) {\r\n \r\n}" selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: "int C::f(int a, int b) {\r\n \r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName3.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName3.yml index 491905339b..0f0a065c17 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName3.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeFunkName3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: int f(int a, int b); selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 1} + marks: {} finalState: documentContents: int f(int a, int b); selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeIf.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeIf.yml index 9283cf9d46..02ad3557b5 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeIf.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeIf.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: ifStatement} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n if (true) {\r\n \r\n }\r\n}" selections: - anchor: {line: 2, character: 8} active: {line: 2, character: 8} + marks: {} finalState: documentContents: "void f() {\r\n if (true) {\r\n \r\n }\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeIf2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeIf2.yml index 0acb577cdb..abc41180cc 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeIf2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeIf2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: ifStatement} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n if constexpr (true) {\r\n \r\n }\r\n}" selections: - anchor: {line: 2, character: 8} active: {line: 2, character: 8} + marks: {} finalState: documentContents: "void f() {\r\n if constexpr (true) {\r\n \r\n }\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeItem.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeItem.yml index c811043dee..e8fbada77c 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeItem.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeItem.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n std::vector v {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: - anchor: {line: 2, character: 10} active: {line: 2, character: 10} + marks: {} finalState: documentContents: "void f() {\r\n std::vector v {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeItem2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeItem2.yml index 803f398ebe..32d4e8c1d2 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeItem2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n int arr[] = {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: - anchor: {line: 2, character: 11} active: {line: 2, character: 11} + marks: {} finalState: documentContents: "void f() {\r\n int arr[] = {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeLambda.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeLambda.yml index d88af9d1cc..41db22137b 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeLambda.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeLambda.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n [](){}();\r\n}\r\n" selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: "void f() {\r\n [](){}();\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeList.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeList.yml index 43fe87bea6..9db908dac6 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeList.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeList.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n std::vector v {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: - anchor: {line: 2, character: 11} active: {line: 2, character: 11} + marks: {} finalState: documentContents: "void f() {\r\n std::vector v {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeList2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeList2.yml index 72a75def1c..ec783c92c9 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeList2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeList2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n int arr[] = {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: - anchor: {line: 2, character: 12} active: {line: 2, character: 12} + marks: {} finalState: documentContents: "void f() {\r\n int arr[] = {\r\n 1 + 2,\r\n 3\r\n };\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeName.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeName.yml index 001a895ed2..ff170f51a3 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeName.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeName.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n int i = 1;\r\n}" selections: - anchor: {line: 1, character: 13} active: {line: 1, character: 13} + marks: {} finalState: documentContents: "void f() {\r\n int i = 1;\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeName2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeName2.yml index a9495aa589..84c3512966 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeName2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeName2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: "void f(int i = 1) {\r\n \r\n}" selections: - anchor: {line: 0, character: 15} active: {line: 0, character: 15} + marks: {} finalState: documentContents: "void f(int i = 1) {\r\n \r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeName3.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeName3.yml index f9804c305a..27fa97c1de 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeName3.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeName3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: "void f(int i = 1) {\r\n \r\n}" selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: "void f(int i = 1) {\r\n \r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeState.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeState.yml index db37c92532..b134cf0724 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeState.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeState.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n while (true) {\r\n ;\r\n }\r\n}" selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: "void f() {\r\n while (true) {\r\n ;\r\n }\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeState2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeState2.yml index 612a021934..8e8d2e4079 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeState2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeState2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n a = 1;\r\n}" selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: "void f() {\r\n a = 1;\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeState3.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeState3.yml index 11444fcaaf..a3ce6c2b41 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeState3.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeState3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement} extraArgs: [] -marks: {} initialState: documentContents: "void f() {\r\n int a = 1;\r\n}" selections: - anchor: {line: 1, character: 10} active: {line: 1, character: 10} + marks: {} finalState: documentContents: "void f() {\r\n int a = 1;\r\n}" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeString.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeString.yml index 37f5a22347..66b68a9c2d 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeString.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeString.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: string} extraArgs: [] -marks: {} initialState: documentContents: "char* a = \"hello world\";\r\n" selections: - anchor: {line: 0, character: 21} active: {line: 0, character: 21} + marks: {} finalState: documentContents: "char* a = \"hello world\";\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeType.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeType.yml index 5edd0f0166..590fd23894 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeType.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeType.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a) {}\r\n" selections: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} + marks: {} finalState: documentContents: "int f(int a) {}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeType2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeType2.yml index 11a58f8a8d..685f8c8fbc 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeType2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeType2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a) {}\r\n" selections: - anchor: {line: 0, character: 14} active: {line: 0, character: 14} + marks: {} finalState: documentContents: "int f(int a) {}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeType3.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeType3.yml index d8001975cc..56a9433c2b 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeType3.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeType3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a) {\r\n int j = a;\r\n}\r\n" selections: - anchor: {line: 1, character: 13} active: {line: 1, character: 13} + marks: {} finalState: documentContents: "int f(int a) {\r\n int j = a;\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeValue.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeValue.yml index 52531692f6..225de7cf40 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeValue.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeValue.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a) {\r\n int j = a;\r\n}\r\n" selections: - anchor: {line: 1, character: 5} active: {line: 1, character: 5} + marks: {} finalState: documentContents: "int f(int a) {\r\n int j = a;\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeValue2.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeValue2.yml index 76f61607f4..896e604467 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeValue2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeValue2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a) {\r\n a = 2;\r\n}\r\n" selections: - anchor: {line: 1, character: 5} active: {line: 1, character: 5} + marks: {} finalState: documentContents: "int f(int a) {\r\n a = 2;\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeValue3.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeValue3.yml index fed479b3be..c8de3737eb 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeValue3.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeValue3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: "int f(int a = 1) {\r\n}\r\n" selections: - anchor: {line: 0, character: 11} active: {line: 0, character: 11} + marks: {} finalState: documentContents: "int f(int a = 1) {\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis.yml b/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis.yml index 9ca7b8195c..30db9c896e 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis2.yml b/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis2.yml index 1454f71b44..76f0437ba9 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis2.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/tryCatchWrapThis2.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: |- if (true) { @@ -19,6 +18,7 @@ initialState: active: {line: 4, character: 0} - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/csharp/elseStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/csharp/elseStateWrapThis.yml index 8c0f9779d1..793a3280f9 100644 --- a/src/test/suite/fixtures/recorded/languages/csharp/elseStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/csharp/elseStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.alternative] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/csharp/ifElseWrapThis.yml b/src/test/suite/fixtures/recorded/languages/csharp/ifElseWrapThis.yml index 99efae39cd..74aa1f9a97 100644 --- a/src/test/suite/fixtures/recorded/languages/csharp/ifElseWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/csharp/ifElseWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.consequence] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/csharp/ifStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/csharp/ifStateWrapThis.yml index aa22745e98..a512adf837 100644 --- a/src/test/suite/fixtures/recorded/languages/csharp/ifStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/csharp/ifStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifStatement.consequence] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis.yml b/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis.yml index 31f11c84c0..bd5dcdcae5 100644 --- a/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis2.yml b/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis2.yml index cc88d423e5..52c142ca02 100644 --- a/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis2.yml +++ b/src/test/suite/fixtures/recorded/languages/csharp/tryCatchWrapThis2.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: |- if (true) { @@ -19,6 +18,7 @@ initialState: active: {line: 4, character: 0} - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/java/elseStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/java/elseStateWrapThis.yml index 69843ecff1..65f0f5a163 100644 --- a/src/test/suite/fixtures/recorded/languages/java/elseStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/java/elseStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.alternative] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/java/ifElseWrapThis.yml b/src/test/suite/fixtures/recorded/languages/java/ifElseWrapThis.yml index d43167eeb7..ec76cb7d1b 100644 --- a/src/test/suite/fixtures/recorded/languages/java/ifElseWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/java/ifElseWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.consequence] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/java/ifStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/java/ifStateWrapThis.yml index 191f56cf68..a0d48ccb44 100644 --- a/src/test/suite/fixtures/recorded/languages/java/ifStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/java/ifStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifStatement.consequence] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/java/takeArg.yml b/src/test/suite/fixtures/recorded/languages/java/takeArg.yml index 6025ebe034..54cc8e9e6d 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeArg.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 2, character: 26} active: {line: 2, character: 26} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeArg2.yml b/src/test/suite/fixtures/recorded/languages/java/takeArg2.yml index da23943adc..063bf41a91 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeArg2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 8} active: {line: 1, character: 8} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeCall.yml b/src/test/suite/fixtures/recorded/languages/java/takeCall.yml index 109cd3768d..eba38f5fd1 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeCall.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeCall.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionCall} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 5} active: {line: 1, character: 5} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeClass.yml b/src/test/suite/fixtures/recorded/languages/java/takeClass.yml index 7bb11992ba..7458eb8014 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeClass.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeClass.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: class} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeClassName.yml b/src/test/suite/fixtures/recorded/languages/java/takeClassName.yml index 5b35dd1d05..a666f37446 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeClassName.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeClassName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: className} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeComment.yml b/src/test/suite/fixtures/recorded/languages/java/takeComment.yml index 3167fb0bc2..1dc6256429 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeComment.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeComment.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: comment} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 2} active: {line: 1, character: 2} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml index 7b5a8cb724..299bd302d1 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 2, character: 20} active: {line: 2, character: 20} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml index afaeb95f49..aeeee7fd73 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 8} active: {line: 1, character: 8} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml index 7e4d0ece9b..98d478c843 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeFunk.yml b/src/test/suite/fixtures/recorded/languages/java/takeFunk.yml index f515409a46..d48016cccc 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeFunk.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeFunk.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeFunk2.yml b/src/test/suite/fixtures/recorded/languages/java/takeFunk2.yml index ffad534ca5..98d5d1dc94 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeFunk2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeFunk2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeFunkName.yml b/src/test/suite/fixtures/recorded/languages/java/takeFunkName.yml index fe6143e2dc..ccba428c14 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeFunkName.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeFunkName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeFunkName2.yml b/src/test/suite/fixtures/recorded/languages/java/takeFunkName2.yml index 4b99ef7b76..7236d52a54 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeFunkName2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeFunkName2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeIf.yml b/src/test/suite/fixtures/recorded/languages/java/takeIf.yml index 0c28e44f01..7b9f7c7e91 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeIf.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeIf.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: ifStatement} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeItem.yml b/src/test/suite/fixtures/recorded/languages/java/takeItem.yml index 1b43495847..10ada21e47 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeItem.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeItem.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: "\r\nint[] values = {1, 2, 3};\r\n" selections: - anchor: {line: 1, character: 16} active: {line: 1, character: 16} + marks: {} finalState: documentContents: "\r\nint[] values = {1, 2, 3};\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/java/takeList.yml b/src/test/suite/fixtures/recorded/languages/java/takeList.yml index e8060c4112..380dfd5f26 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeList.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeList.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeMap.yml b/src/test/suite/fixtures/recorded/languages/java/takeMap.yml index a51a5adb51..25866c448c 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeMap.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeMap.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: map} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 3, character: 8} active: {line: 3, character: 8} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeName.yml b/src/test/suite/fixtures/recorded/languages/java/takeName.yml index 70e1322980..b1287f95f3 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeName.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeName2.yml b/src/test/suite/fixtures/recorded/languages/java/takeName2.yml index 0334fd0004..a478a5450a 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeName2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeName2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 2, character: 26} active: {line: 2, character: 26} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeName3.yml b/src/test/suite/fixtures/recorded/languages/java/takeName3.yml index 136a3f8a7e..2a540a22bb 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeName3.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeName3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 15} active: {line: 1, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeState.yml b/src/test/suite/fixtures/recorded/languages/java/takeState.yml index a994918b44..b4cbbd7c58 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeState.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeState.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeString.yml b/src/test/suite/fixtures/recorded/languages/java/takeString.yml index 37d21ca4ed..5b2a00de1b 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeString.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeString.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: string} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 22} active: {line: 1, character: 22} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeType.yml b/src/test/suite/fixtures/recorded/languages/java/takeType.yml index 2aadec6372..ed47abc4da 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeType.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeType.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeType2.yml b/src/test/suite/fixtures/recorded/languages/java/takeType2.yml index 631760861b..5211288e31 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeType2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeType2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 2, character: 27} active: {line: 2, character: 27} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeType3.yml b/src/test/suite/fixtures/recorded/languages/java/takeType3.yml index 1e5c1ed5c1..91c7ecb8b2 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeType3.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeType3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 15} active: {line: 1, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/takeValue.yml b/src/test/suite/fixtures/recorded/languages/java/takeValue.yml index 1d1e53a152..129de8a49b 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeValue.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis.yml b/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis.yml index 9b95e3f83d..553cc672f9 100644 --- a/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: int foo = 0; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis2.yml b/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis2.yml index 832fba247d..97f052458f 100644 --- a/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/tryCatchWrapThis2.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: |- if (true) { @@ -19,6 +18,7 @@ initialState: active: {line: 4, character: 0} - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/json/takeItem.yml b/src/test/suite/fixtures/recorded/languages/json/takeItem.yml index b853921bb7..383202b58a 100644 --- a/src/test/suite/fixtures/recorded/languages/json/takeItem.yml +++ b/src/test/suite/fixtures/recorded/languages/json/takeItem.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: - anchor: {line: 2, character: 9} active: {line: 2, character: 9} + marks: {} finalState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/json/takeItem2.yml b/src/test/suite/fixtures/recorded/languages/json/takeItem2.yml index 86575b73ce..621a78b1db 100644 --- a/src/test/suite/fixtures/recorded/languages/json/takeItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/json/takeItem2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: "\r\n{\r\n \"foo\": [1, 2, 3]\r\n}\r\n" selections: - anchor: {line: 2, character: 13} active: {line: 2, character: 13} + marks: {} finalState: documentContents: "\r\n{\r\n \"foo\": [1, 2, 3]\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/json/takeKey.yml b/src/test/suite/fixtures/recorded/languages/json/takeKey.yml index eab9b27503..94c647655b 100644 --- a/src/test/suite/fixtures/recorded/languages/json/takeKey.yml +++ b/src/test/suite/fixtures/recorded/languages/json/takeKey.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey} extraArgs: [] -marks: {} initialState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: - anchor: {line: 2, character: 10} active: {line: 2, character: 10} + marks: {} finalState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/json/takeList.yml b/src/test/suite/fixtures/recorded/languages/json/takeList.yml index e723a890fa..d604ec20e0 100644 --- a/src/test/suite/fixtures/recorded/languages/json/takeList.yml +++ b/src/test/suite/fixtures/recorded/languages/json/takeList.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: "\r\n{\r\n \"foo\": [1, 2, 3]\r\n}\r\n" selections: - anchor: {line: 2, character: 19} active: {line: 2, character: 19} + marks: {} finalState: documentContents: "\r\n{\r\n \"foo\": [1, 2, 3]\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/json/takeString.yml b/src/test/suite/fixtures/recorded/languages/json/takeString.yml index 25aec4d908..e6050d297f 100644 --- a/src/test/suite/fixtures/recorded/languages/json/takeString.yml +++ b/src/test/suite/fixtures/recorded/languages/json/takeString.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: string} extraArgs: [] -marks: {} initialState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: - anchor: {line: 2, character: 12} active: {line: 2, character: 12} + marks: {} finalState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/json/takeValue.yml b/src/test/suite/fixtures/recorded/languages/json/takeValue.yml index 26359d64c5..96d4a9d2e5 100644 --- a/src/test/suite/fixtures/recorded/languages/json/takeValue.yml +++ b/src/test/suite/fixtures/recorded/languages/json/takeValue.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: - anchor: {line: 2, character: 9} active: {line: 2, character: 9} + marks: {} finalState: documentContents: "\r\n{\r\n \"foo\": \"bar\"\r\n}\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeAttribute.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeAttribute.yml index 15d46f1517..64eb61580a 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeAttribute.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeAttribute.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: attribute} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 14} active: {line: 2, character: 14} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeElement.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeElement.yml index 3774d47612..c34cfc1b81 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeElement.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeElement.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: xmlElement} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 15} active: {line: 2, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeEndTag.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeEndTag.yml index b205a8c1b8..fd232a4141 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeEndTag.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeEndTag.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: xmlEndTag} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 15} active: {line: 2, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml index 09027e3f4c..f3f73ea218 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: attribute, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 7} active: {line: 2, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeKey.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeKey.yml index 4ffded4e76..f20ea9978e 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeKey.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 10} active: {line: 2, character: 10} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeStartTag.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeStartTag.yml index 0992bd99ca..4cde8fac1b 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeStartTag.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeStartTag.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: xmlStartTag} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 15} active: {line: 2, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeTags.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeTags.yml index d0d1885bf4..da00eb08e8 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeTags.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeTags.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: xmlBothTags} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 15} active: {line: 2, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeValue.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeValue.yml index 5202721d02..a8c27dbf70 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeValue.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 7} active: {line: 2, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/chuckKey.yml b/src/test/suite/fixtures/recorded/languages/python/chuckKey.yml index 308f9bfe12..f22fc10dfd 100644 --- a/src/test/suite/fixtures/recorded/languages/python/chuckKey.yml +++ b/src/test/suite/fixtures/recorded/languages/python/chuckKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- { @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 5} active: {line: 1, character: 5} + marks: {} finalState: documentContents: |- { diff --git a/src/test/suite/fixtures/recorded/languages/python/chuckKey2.yml b/src/test/suite/fixtures/recorded/languages/python/chuckKey2.yml index a79d64f4a7..a4a0cbf99a 100644 --- a/src/test/suite/fixtures/recorded/languages/python/chuckKey2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/chuckKey2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- { @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: |- { diff --git a/src/test/suite/fixtures/recorded/languages/python/chuckType.yml b/src/test/suite/fixtures/recorded/languages/python/chuckType.yml index 1a30b6846f..39ae64bf80 100644 --- a/src/test/suite/fixtures/recorded/languages/python/chuckType.yml +++ b/src/test/suite/fixtures/recorded/languages/python/chuckType.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: "foo: str = 'hello'" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 1} + marks: {} finalState: documentContents: foo = 'hello' selections: diff --git a/src/test/suite/fixtures/recorded/languages/python/chuckValue.yml b/src/test/suite/fixtures/recorded/languages/python/chuckValue.yml index 7c637d1b57..1bcd51aaaf 100644 --- a/src/test/suite/fixtures/recorded/languages/python/chuckValue.yml +++ b/src/test/suite/fixtures/recorded/languages/python/chuckValue.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: "foo: str = \"hello\"" selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: "foo: str" selections: diff --git a/src/test/suite/fixtures/recorded/languages/python/chuckValue2.yml b/src/test/suite/fixtures/recorded/languages/python/chuckValue2.yml index 3cf35643e3..f05e1dcd66 100644 --- a/src/test/suite/fixtures/recorded/languages/python/chuckValue2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/chuckValue2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- def foo(): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 14} active: {line: 1, character: 14} + marks: {} finalState: documentContents: |- def foo(): diff --git a/src/test/suite/fixtures/recorded/languages/python/clearEveryValue.yml b/src/test/suite/fixtures/recorded/languages/python/clearEveryValue.yml index 03813cfe61..3da5bcfa73 100644 --- a/src/test/suite/fixtures/recorded/languages/python/clearEveryValue.yml +++ b/src/test/suite/fixtures/recorded/languages/python/clearEveryValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- { @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 13} active: {line: 1, character: 13} + marks: {} finalState: documentContents: |- { diff --git a/src/test/suite/fixtures/recorded/languages/python/clearValue.yml b/src/test/suite/fixtures/recorded/languages/python/clearValue.yml index 1f3484be6c..77bd664c13 100644 --- a/src/test/suite/fixtures/recorded/languages/python/clearValue.yml +++ b/src/test/suite/fixtures/recorded/languages/python/clearValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- def foo(): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 14} active: {line: 1, character: 14} + marks: {} finalState: documentContents: |- def foo(): diff --git a/src/test/suite/fixtures/recorded/languages/python/clearValue2.yml b/src/test/suite/fixtures/recorded/languages/python/clearValue2.yml index 7ce492cc20..fce28308da 100644 --- a/src/test/suite/fixtures/recorded/languages/python/clearValue2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/clearValue2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- def foo(): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: |- def foo(): diff --git a/src/test/suite/fixtures/recorded/languages/python/elseStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/python/elseStateWrapThis.yml index 14cdf0ec83..5c86ef04e1 100644 --- a/src/test/suite/fixtures/recorded/languages/python/elseStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/python/elseStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.alternative] -marks: {} initialState: documentContents: foo = "hello" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- if : diff --git a/src/test/suite/fixtures/recorded/languages/python/ifElseWrapThis.yml b/src/test/suite/fixtures/recorded/languages/python/ifElseWrapThis.yml index 8a63c3439d..c4fc2a948d 100644 --- a/src/test/suite/fixtures/recorded/languages/python/ifElseWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/python/ifElseWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.consequence] -marks: {} initialState: documentContents: foo = "hello" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- if : diff --git a/src/test/suite/fixtures/recorded/languages/python/ifStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/python/ifStateWrapThis.yml index a2b66e465c..37c57fad89 100644 --- a/src/test/suite/fixtures/recorded/languages/python/ifStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/python/ifStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifStatement.consequence] -marks: {} initialState: documentContents: foo = "hello" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- if : diff --git a/src/test/suite/fixtures/recorded/languages/python/takeArg.yml b/src/test/suite/fixtures/recorded/languages/python/takeArg.yml index 5351e222fc..326e663874 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeArg.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeArg2.yml b/src/test/suite/fixtures/recorded/languages/python/takeArg2.yml index 45c400abfd..95a1df540a 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeArg2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 8} active: {line: 1, character: 8} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeCall.yml b/src/test/suite/fixtures/recorded/languages/python/takeCall.yml index 6bedfb81c8..12580c7160 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeCall.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeCall.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionCall} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeClass.yml b/src/test/suite/fixtures/recorded/languages/python/takeClass.yml index c8e92b8cf1..0ea57000b3 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeClass.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeClass.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: class} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeClass2.yml b/src/test/suite/fixtures/recorded/languages/python/takeClass2.yml index 640091aa1c..afa6b63920 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeClass2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeClass2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: class} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 3, character: 4} active: {line: 3, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeClassName.yml b/src/test/suite/fixtures/recorded/languages/python/takeClassName.yml index 412cfb87a4..94146ccf54 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeClassName.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeClassName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: className} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeComment.yml b/src/test/suite/fixtures/recorded/languages/python/takeComment.yml index aa2c9ed74e..28548f4698 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeComment.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeComment.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: comment} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 1} active: {line: 1, character: 1} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeEveryArg.yml b/src/test/suite/fixtures/recorded/languages/python/takeEveryArg.yml index 3c3c9af142..71297d1bff 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeEveryArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeEveryArg2.yml b/src/test/suite/fixtures/recorded/languages/python/takeEveryArg2.yml index e78e8272da..92a4254b7f 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeEveryArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeEveryArg2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 8} active: {line: 1, character: 8} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/python/takeEveryItem.yml index b72e4ae214..e5be4d7cf9 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeEveryItem.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeEveryItem2.yml b/src/test/suite/fixtures/recorded/languages/python/takeEveryItem2.yml index ee73a9acde..be11b442b9 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeEveryItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeEveryItem2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeEveryItem3.yml b/src/test/suite/fixtures/recorded/languages/python/takeEveryItem3.yml index de8062f148..a673026297 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeEveryItem3.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeEveryItem3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeFunk.yml b/src/test/suite/fixtures/recorded/languages/python/takeFunk.yml index 8f38baee8b..108f707a87 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeFunk.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeFunk.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeFunk2.yml b/src/test/suite/fixtures/recorded/languages/python/takeFunk2.yml index c06a20d48f..f75ff23acd 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeFunk2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeFunk2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 3, character: 4} active: {line: 3, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeFunkName.yml b/src/test/suite/fixtures/recorded/languages/python/takeFunkName.yml index f73ad4609b..207b2b9ccc 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeFunkName.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeFunkName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeIf.yml b/src/test/suite/fixtures/recorded/languages/python/takeIf.yml index 220290049b..1fbb205d91 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeIf.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeIf.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: ifStatement} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeItem.yml b/src/test/suite/fixtures/recorded/languages/python/takeItem.yml index 68685302e2..0a427bc305 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeItem.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeItem.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeItem2.yml b/src/test/suite/fixtures/recorded/languages/python/takeItem2.yml index c41040c0ab..880be0052d 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeItem2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeItem3.yml b/src/test/suite/fixtures/recorded/languages/python/takeItem3.yml index de64771011..42749b500b 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeItem3.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeItem3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeKey.yml b/src/test/suite/fixtures/recorded/languages/python/takeKey.yml index 4b21edda0e..d304ba08e8 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeKey.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeLambda.yml b/src/test/suite/fixtures/recorded/languages/python/takeLambda.yml index d3924db465..cc1f3b60b0 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeLambda.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeLambda.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 14} active: {line: 1, character: 14} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeList.yml b/src/test/suite/fixtures/recorded/languages/python/takeList.yml index de56644658..6cef2d88f1 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeList.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeList.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeList2.yml b/src/test/suite/fixtures/recorded/languages/python/takeList2.yml index 1504d7af81..197fbbd9d7 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeList2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeList2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeMap.yml b/src/test/suite/fixtures/recorded/languages/python/takeMap.yml index 15faf7a88d..a42674ef4d 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeMap.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeMap.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: map} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeName.yml b/src/test/suite/fixtures/recorded/languages/python/takeName.yml index 6f006636a9..19efb4e4e4 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeName.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeName2.yml b/src/test/suite/fixtures/recorded/languages/python/takeName2.yml index 1099529705..a00990259d 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeName2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeName2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 19} active: {line: 1, character: 19} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeName3.yml b/src/test/suite/fixtures/recorded/languages/python/takeName3.yml index 9674e0188b..0430face6d 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeName3.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeName3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/python/takeState.yml b/src/test/suite/fixtures/recorded/languages/python/takeState.yml index f44a1079f9..170a03ac03 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeState.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeState.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 6} active: {line: 1, character: 6} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeString.yml b/src/test/suite/fixtures/recorded/languages/python/takeString.yml index d4de6f0dba..895f4b4c18 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeString.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeString.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: string} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 15} active: {line: 1, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeType.yml b/src/test/suite/fixtures/recorded/languages/python/takeType.yml index 3af0b215a3..3b9bbfa4a4 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeType.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeType.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 2, character: 4} active: {line: 2, character: 4} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeType2.yml b/src/test/suite/fixtures/recorded/languages/python/takeType2.yml index 59652dc9b8..f6893713d1 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeType2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeType2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 16} active: {line: 1, character: 16} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeValue.yml b/src/test/suite/fixtures/recorded/languages/python/takeValue.yml index 765a5f4fc0..7d56dc8d76 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeValue.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 5} active: {line: 1, character: 5} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeValue2.yml b/src/test/suite/fixtures/recorded/languages/python/takeValue2.yml index ce5850b999..cbad9b0e2a 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeValue2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeValue2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 10} active: {line: 1, character: 10} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/python/takeValueZero.yml b/src/test/suite/fixtures/recorded/languages/python/takeValueZero.yml index 90dd7d2f7e..c93d0b9d0e 100644 --- a/src/test/suite/fixtures/recorded/languages/python/takeValueZero.yml +++ b/src/test/suite/fixtures/recorded/languages/python/takeValueZero.yml @@ -7,10 +7,6 @@ command: modifier: {type: containingScope, scopeType: value, includeSiblings: false} mark: {type: decoratedSymbol, symbolColor: default, character: '0'} extraArgs: [] -marks: - default.0: - start: {line: 1, character: 15} - end: {line: 1, character: 16} initialState: documentContents: |- { @@ -19,6 +15,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.0: + start: {line: 1, character: 15} + end: {line: 1, character: 16} finalState: documentContents: |- { diff --git a/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis.yml b/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis.yml index 788878ea3d..752168ac51 100644 --- a/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: foo = "hello" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- try: diff --git a/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis2.yml b/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis2.yml index 6fd5886ec2..9f0096c789 100644 --- a/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis2.yml +++ b/src/test/suite/fixtures/recorded/languages/python/tryCatchWrapThis2.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: |- if True: @@ -18,6 +17,7 @@ initialState: active: {line: 3, character: 0} - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- try: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/chuckKey.yml b/src/test/suite/fixtures/recorded/languages/typescript/chuckKey.yml index 337236886d..c6e8a632ea 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/chuckKey.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/chuckKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 5} active: {line: 1, character: 5} + marks: {} finalState: documentContents: |- { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearFunk.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearFunk.yml index 44c62bdb06..47ad5a137f 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearFunk.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearFunk.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: | function bar() { @@ -17,6 +16,7 @@ initialState: selections: - anchor: {line: 2, character: 6} active: {line: 2, character: 6} + marks: {} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearFunk2.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearFunk2.yml index 4f4465ddf2..a998a711a6 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearFunk2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearFunk2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: | function bar() { @@ -17,6 +16,7 @@ initialState: selections: - anchor: {line: 2, character: 6} active: {line: 2, character: 6} + marks: {} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearKey.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearKey.yml index 824f0456a0..320b45e5fa 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearKey.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 10} active: {line: 1, character: 10} + marks: {} finalState: documentContents: |- { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda.yml index f59af2839f..19c65bbece 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- foo(() => { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: {} finalState: documentContents: foo() selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda2.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda2.yml index f39d997b7c..9c727e9965 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- foo(function () { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: {} finalState: documentContents: foo() selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda3.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda3.yml index f031cc3637..a233b2f19c 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- foo(async function () { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: {} finalState: documentContents: foo() selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda4.yml b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda4.yml index 016bf9105b..d63e26d638 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/clearLambda4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/clearLambda4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- foo(async () => { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: {} finalState: documentContents: foo() selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/elseStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/typescript/elseStateWrapThis.yml index 75def3f5b0..b1b29f0d9e 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/elseStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/elseStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.alternative] -marks: {} initialState: documentContents: const foo = "hello"; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/ifElseWrapThis.yml b/src/test/suite/fixtures/recorded/languages/typescript/ifElseWrapThis.yml index 2b8fae5fe0..fa06b13bd0 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/ifElseWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/ifElseWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifElseStatement.consequence] -marks: {} initialState: documentContents: const foo = "hello"; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/ifStateWrapThis.yml b/src/test/suite/fixtures/recorded/languages/typescript/ifStateWrapThis.yml index 8f84ac19a5..77bd1d2773 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/ifStateWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/ifStateWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [ifStatement.consequence] -marks: {} initialState: documentContents: const foo = "hello"; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- if () { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeArg.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeArg.yml index 6cf5e23092..1590c7aa3b 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeArg.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeArg.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 21} active: {line: 1, character: 21} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeArg2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeArg2.yml index 3c6bacf22e..15380073b2 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeArg2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: argumentOrParameter} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 8} active: {line: 1, character: 8} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeArrow.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeArrow.yml index febf63ea8e..0ef8a1fbd1 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeArrow.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeArrow.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: anonymousFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeCall.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeCall.yml index 3169c7c283..9a1f0498bf 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeCall.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeCall.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionCall} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 1} active: {line: 1, character: 1} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeClass.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeClass.yml index 0f0c3c455e..a56254c272 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeClass.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeClass.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: class} extraArgs: [] -marks: {} initialState: documentContents: | @@ -21,6 +20,7 @@ initialState: selections: - anchor: {line: 5, character: 4} active: {line: 5, character: 4} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeClassName.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeClassName.yml index 60aa1da0ca..b7698c5e8e 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeClassName.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeClassName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: className} extraArgs: [] -marks: {} initialState: documentContents: | @@ -21,6 +20,7 @@ initialState: selections: - anchor: {line: 5, character: 4} active: {line: 5, character: 4} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeComment.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeComment.yml index 156c06769d..22b10a41c4 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeComment.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeComment.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: comment} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 32} active: {line: 1, character: 32} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml index e348983f89..c6571b02c4 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml @@ -7,15 +7,15 @@ command: modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 0, character: 8} - end: {line: 0, character: 11} initialState: documentContents: foo(bar(baz, bongo), bazman) selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 0, character: 8} + end: {line: 0, character: 11} finalState: documentContents: foo(bar(baz, bongo), bazman) selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml index bfd025e48f..c74a1a771d 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml @@ -7,15 +7,15 @@ command: modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} mark: {type: decoratedSymbol, symbolColor: default, character: b} extraArgs: [] -marks: - default.b: - start: {line: 0, character: 21} - end: {line: 0, character: 27} initialState: documentContents: foo(bar(baz, bongo), bazman) selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.b: + start: {line: 0, character: 21} + end: {line: 0, character: 27} finalState: documentContents: foo(bar(baz, bongo), bazman) selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml index da6e85a756..a46abc0032 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml @@ -7,15 +7,15 @@ command: modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} mark: {type: decoratedSymbol, symbolColor: default, character: r} extraArgs: [] -marks: - default.r: - start: {line: 0, character: 4} - end: {line: 0, character: 7} initialState: documentContents: foo(bar(baz, bongo), bazman) selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.r: + start: {line: 0, character: 4} + end: {line: 0, character: 7} finalState: documentContents: foo(bar(baz, bongo), bazman) selections: diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml index b7487db420..f87773007e 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml index c5bd371eb0..45e8a2e0a4 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml index 1bcd6310c7..45ab4879e3 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 10} active: {line: 1, character: 10} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml index 650c743a50..f52b3a60b2 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml index 36bb9583d7..6467f897ef 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- const value = { @@ -18,6 +17,7 @@ initialState: active: {line: 1, character: 10} - anchor: {line: 2, character: 10} active: {line: 2, character: 17} + marks: {} finalState: documentContents: |- const value = { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml index cf84c6e064..5d756fa046 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- const value = { @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 10} active: {line: 1, character: 10} + marks: {} finalState: documentContents: |- const value = { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml index 2a0d338a87..9c75339448 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: true} extraArgs: [] -marks: {} initialState: documentContents: |- const value = { @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 10} active: {line: 1, character: 10} + marks: {} finalState: documentContents: |- const value = { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk.yml index 6055c00796..e6d9c12c81 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk10.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk10.yml index e6de780159..bf5c50b962 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk10.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk10.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk11.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk11.yml index 721be7d805..7f9351d9f0 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk11.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk11.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk12.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk12.yml index 4ddfe778e9..331d8b1215 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk12.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk12.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk13.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk13.yml index 7fa4d76458..05cda11720 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk13.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk13.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk2.yml index 080fd60885..e16853bb68 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk3.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk3.yml index 7a6cfd298d..3e8a7fbf18 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk4.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk4.yml index bee3e0b57b..cb85325a55 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk5.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk5.yml index 2dc220a43c..cd0bce82b3 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk5.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk5.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk6.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk6.yml index b9e7271403..83251f6f08 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk6.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk6.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk7.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk7.yml index fb8e02617a..c4cba3be08 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk7.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk7.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk8.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk8.yml index 4b227bb795..7d3df6b01b 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk8.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk8.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk9.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk9.yml index 5f18c3cc82..e60eb49254 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunk9.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunk9.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: namedFunction} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName.yml index 30539ab61a..012288685f 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName10.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName10.yml index 6babdffbc0..be3454bcee 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName10.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName10.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName11.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName11.yml index 9e54e19085..000e08fd71 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName11.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName11.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName2.yml index 759a7d4d60..6ff89ae3b7 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName3.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName3.yml index 3c304ec5ef..270b03da0e 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName4.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName4.yml index dcc7c721fe..9ba60988d6 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName5.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName5.yml index 1c2e6b5dfa..a3574eca22 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName5.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName5.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName6.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName6.yml index 83b434bf48..24e5647fd3 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName6.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName6.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName7.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName7.yml index 152884cf47..28682c73f5 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName7.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName7.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName8.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName8.yml index b429993d99..90e56db0b8 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName8.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName8.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName9.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName9.yml index d6e79651b1..dded2f9a30 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName9.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeFunkName9.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: functionName} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: selections: - anchor: {line: 3, character: 0} active: {line: 3, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeIf.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeIf.yml index e62c2ac5b0..9ca87b1e69 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeIf.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeIf.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: ifStatement} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItem.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItem.yml index 9dbcff8aff..a3a9da467d 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItem.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItem.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 15} active: {line: 1, character: 15} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItem2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItem2.yml index 50751496cb..a5c791847d 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItem2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 16} active: {line: 1, character: 16} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItem3.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItem3.yml index 84abaf8569..dbb3b49dbb 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItem3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItem3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 20} active: {line: 1, character: 20} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItem4.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItem4.yml index 58783e5fa6..4a434ba9bf 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItem4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItem4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionItem} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 21} active: {line: 1, character: 21} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItemAir.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItemAir.yml index d540f93bbc..7d339a0ee1 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItemAir.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItemAir.yml @@ -7,10 +7,6 @@ command: modifier: {type: containingScope, scopeType: collectionItem} mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 1, character: 16} - end: {line: 1, character: 17} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 1, character: 16} + end: {line: 1, character: 17} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItemBrace.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItemBrace.yml index 7b0d451497..21ea684c3e 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItemBrace.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItemBrace.yml @@ -7,10 +7,6 @@ command: modifier: {type: containingScope, scopeType: collectionItem} mark: {type: decoratedSymbol, symbolColor: default, character: '{'} extraArgs: [] -marks: - default.{: - start: {line: 1, character: 14} - end: {line: 1, character: 15} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.{: + start: {line: 1, character: 14} + end: {line: 1, character: 15} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItemComma.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItemComma.yml index 611a8a74fb..be8c0fae68 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItemComma.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItemComma.yml @@ -7,10 +7,6 @@ command: modifier: {type: containingScope, scopeType: collectionItem} mark: {type: decoratedSymbol, symbolColor: default, character: ','} extraArgs: [] -marks: - default.,: - start: {line: 1, character: 20} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.,: + start: {line: 1, character: 20} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeItemOne.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeItemOne.yml index 0e847fd6a2..dc7a603860 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeItemOne.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeItemOne.yml @@ -7,10 +7,6 @@ command: modifier: {type: containingScope, scopeType: collectionItem} mark: {type: decoratedSymbol, symbolColor: default, character: '1'} extraArgs: [] -marks: - default.1: - start: {line: 1, character: 15} - end: {line: 1, character: 16} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.1: + start: {line: 1, character: 15} + end: {line: 1, character: 16} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeKey.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeKey.yml index 6816470337..bd5cb3103f 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeKey.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeKey.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: collectionKey} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeList.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeList.yml index b2e0a6af2c..280ec65464 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeList.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeList.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 16} active: {line: 1, character: 16} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeList2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeList2.yml index 7764225e88..2dbe0b67b2 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeList2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeList2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: list} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 9} active: {line: 1, character: 9} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeMap.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeMap.yml index 0b9ffa7990..6cb4dcf700 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeMap.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeMap.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: map} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeMap2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeMap2.yml index 4ce0f49c56..8dec321bb7 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeMap2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeMap2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: map} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 11} active: {line: 1, character: 11} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeName.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeName.yml index 15dbc24079..ea99574ad6 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeName.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeName.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 29} active: {line: 1, character: 29} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeName2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeName2.yml index 73bbf96145..2c99a8e1b6 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeName2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeName2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: name} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 22} active: {line: 1, character: 22} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeRegex.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeRegex.yml index 3679b5ebe0..a0f28d08c6 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeRegex.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeRegex.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: regularExpression} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeState.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeState.yml index e17301d053..e5b941baf7 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeState.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeState.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: statement} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 29} active: {line: 1, character: 29} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeString.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeString.yml index f782ce13a5..669e8ba928 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeString.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeString.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: string} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 29} active: {line: 1, character: 29} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeType.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeType.yml index f12136de44..0f4f4fc107 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeType.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeType.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 29} active: {line: 1, character: 29} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeType2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeType2.yml index c783d2bb30..7b513e8d13 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeType2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeType2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: type} extraArgs: [] -marks: {} initialState: documentContents: | @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 22} active: {line: 1, character: 22} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeValue.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeValue.yml index c6848e2be6..f17727fecc 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeValue.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeValue.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 11} active: {line: 1, character: 11} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeValue2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeValue2.yml index 249b465ba0..9f2442d45e 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeValue2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeValue2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value} extraArgs: [] -marks: {} initialState: documentContents: | @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 17} active: {line: 1, character: 17} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeValue3.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeValue3.yml index 07f31ab167..4f6c9a71cb 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeValue3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeValue3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- function foo() { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 14} active: {line: 1, character: 14} + marks: {} finalState: documentContents: |- function foo() { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeValue4.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeValue4.yml index 8af5619a14..37f6972b2b 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeValue4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeValue4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: containingScope, scopeType: value, includeSiblings: false} extraArgs: [] -marks: {} initialState: documentContents: |- function foo() { @@ -15,6 +14,7 @@ initialState: selections: - anchor: {line: 1, character: 7} active: {line: 1, character: 7} + marks: {} finalState: documentContents: |- function foo() { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis.yml b/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis.yml index e74db810c6..2a06a44a39 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis.yml @@ -6,12 +6,12 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: const foo = "hello"; selections: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis2.yml b/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis2.yml index 51b89b697d..837fd8170c 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/tryCatchWrapThis2.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [tryCatchStatement.body] -marks: {} initialState: documentContents: |- if (true) { @@ -19,6 +18,7 @@ initialState: active: {line: 4, character: 0} - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: |- try { diff --git a/src/test/suite/fixtures/recorded/lineEndings/chuckVestLF.yml b/src/test/suite/fixtures/recorded/lineEndings/chuckVestLF.yml index 82063a02a4..77383154be 100644 --- a/src/test/suite/fixtures/recorded/lineEndings/chuckVestLF.yml +++ b/src/test/suite/fixtures/recorded/lineEndings/chuckVestLF.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 1, character: 28} active: {line: 1, character: 28} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineEndings/chuckVestLFCR.yml b/src/test/suite/fixtures/recorded/lineEndings/chuckVestLFCR.yml index 92f422b8cd..88a2949955 100644 --- a/src/test/suite/fixtures/recorded/lineEndings/chuckVestLFCR.yml +++ b/src/test/suite/fixtures/recorded/lineEndings/chuckVestLFCR.yml @@ -6,15 +6,15 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: "\r\nconst value = \"Hello world\";\r\n" selections: - anchor: {line: 1, character: 28} active: {line: 1, character: 28} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: "\r\nconst = \"Hello world\";\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/lineEndings/dropVestLF.yml b/src/test/suite/fixtures/recorded/lineEndings/dropVestLF.yml index b79697b575..2a53660ba1 100644 --- a/src/test/suite/fixtures/recorded/lineEndings/dropVestLF.yml +++ b/src/test/suite/fixtures/recorded/lineEndings/dropVestLF.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 1, character: 28} active: {line: 1, character: 28} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineEndings/dropVestLFCR.yml b/src/test/suite/fixtures/recorded/lineEndings/dropVestLFCR.yml index 0238cce65a..d727c473f2 100644 --- a/src/test/suite/fixtures/recorded/lineEndings/dropVestLFCR.yml +++ b/src/test/suite/fixtures/recorded/lineEndings/dropVestLFCR.yml @@ -6,15 +6,15 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: "\r\nconst value = \"Hello world\";\r\n" selections: - anchor: {line: 1, character: 28} active: {line: 1, character: 28} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: "\r\n\r\nconst value = \"Hello world\";\r\n" selections: diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeDownOne.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeDownOne.yml index 69c5b87a6c..3aa62d160b 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeDownOne.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeDownOne.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: 1, isRelative: true} active: {lineNumber: 1, isRelative: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeDownOnePastThree.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeDownOnePastThree.yml index 5b03026346..fe120fd6c1 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeDownOnePastThree.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeDownOnePastThree.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: 1, isRelative: true} active: {lineNumber: 3, isRelative: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeRowFour.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeRowFour.yml index bda74a3226..0242646566 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeRowFour.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeRowFour.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: 3, isRelative: false} active: {lineNumber: 3, isRelative: false} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastDownThree.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastDownThree.yml index 58375c316e..c51da39c56 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastDownThree.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastDownThree.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: 1, isRelative: false} active: {lineNumber: 3, isRelative: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastFour.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastFour.yml index e6aa921421..ef3b2739c2 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastFour.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeRowTwoPastFour.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: 1, isRelative: false} active: {lineNumber: 3, isRelative: false} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastDownOne.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastDownOne.yml index 5b289fa985..64ed304d19 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastDownOne.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastDownOne.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: -1, isRelative: true} active: {lineNumber: 1, isRelative: true} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastRowFour.yml b/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastRowFour.yml index 1f15d9e279..78cbc4e7d8 100644 --- a/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastRowFour.yml +++ b/src/test/suite/fixtures/recorded/lineNumbers/takeUpOnePastRowFour.yml @@ -10,7 +10,6 @@ command: anchor: {lineNumber: -1, isRelative: true} active: {lineNumber: 3, isRelative: false} extraArgs: [] -marks: {} initialState: documentContents: | @@ -20,6 +19,7 @@ initialState: selections: - anchor: {line: 2, character: 0} active: {line: 2, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/marks/takeSource.yml b/src/test/suite/fixtures/recorded/marks/takeSource.yml index be56742f3b..da79a0e73e 100644 --- a/src/test/suite/fixtures/recorded/marks/takeSource.yml +++ b/src/test/suite/fixtures/recorded/marks/takeSource.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: source} extraArgs: [] -marks: {} initialState: documentContents: | value @@ -17,6 +16,7 @@ initialState: sourceMark: - anchor: {line: 1, character: 6} active: {line: 1, character: 11} + marks: {} finalState: documentContents: | value diff --git a/src/test/suite/fixtures/recorded/marks/takeThat.yml b/src/test/suite/fixtures/recorded/marks/takeThat.yml index 0faeeb7eb7..be69ef3490 100644 --- a/src/test/suite/fixtures/recorded/marks/takeThat.yml +++ b/src/test/suite/fixtures/recorded/marks/takeThat.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: that} extraArgs: [] -marks: {} initialState: documentContents: | value @@ -17,6 +16,7 @@ initialState: thatMark: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} + marks: {} finalState: documentContents: | value diff --git a/src/test/suite/fixtures/recorded/marks/takeThis.yml b/src/test/suite/fixtures/recorded/marks/takeThis.yml index 8527dcc46d..e88be39a35 100644 --- a/src/test/suite/fixtures/recorded/marks/takeThis.yml +++ b/src/test/suite/fixtures/recorded/marks/takeThis.yml @@ -6,7 +6,6 @@ command: - type: primitive mark: {type: cursor} extraArgs: [] -marks: {} initialState: documentContents: | @@ -18,6 +17,7 @@ initialState: active: {line: 1, character: 11} - anchor: {line: 1, character: 15} active: {line: 1, character: 20} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/positions/chuckAfterBlockVest.yml b/src/test/suite/fixtures/recorded/positions/chuckAfterBlockVest.yml index 601f29d7b6..569f02aaf2 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckAfterBlockVest.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckAfterBlockVest.yml @@ -8,10 +8,6 @@ command: selectionType: paragraph mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: |- @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/positions/chuckAfterLineVest.yml b/src/test/suite/fixtures/recorded/positions/chuckAfterLineVest.yml index f248d02ce1..4ce303c055 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckAfterLineVest.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckAfterLineVest.yml @@ -8,10 +8,6 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: |- @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/positions/chuckAfterVest.yml b/src/test/suite/fixtures/recorded/positions/chuckAfterVest.yml index 2e9e97bb06..341acfe964 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckAfterVest.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckAfterVest.yml @@ -7,10 +7,6 @@ command: position: after mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/positions/chuckBeforeBlockAir.yml b/src/test/suite/fixtures/recorded/positions/chuckBeforeBlockAir.yml index 0d31e26378..87ed81105d 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckBeforeBlockAir.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckBeforeBlockAir.yml @@ -8,10 +8,6 @@ command: selectionType: paragraph mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 3, character: 10} - end: {line: 3, character: 15} initialState: documentContents: |- @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 3, character: 10} + end: {line: 3, character: 15} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/positions/chuckBeforeLineAir.yml b/src/test/suite/fixtures/recorded/positions/chuckBeforeLineAir.yml index f9d8694fdf..7d10159f52 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckBeforeLineAir.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckBeforeLineAir.yml @@ -8,10 +8,6 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 3, character: 10} - end: {line: 3, character: 15} initialState: documentContents: |- @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 3, character: 10} + end: {line: 3, character: 15} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/positions/chuckBeforeVest.yml b/src/test/suite/fixtures/recorded/positions/chuckBeforeVest.yml index e360d86b2f..d653d834ef 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckBeforeVest.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckBeforeVest.yml @@ -7,10 +7,6 @@ command: position: before mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/positions/chuckPastAfterLook.yml b/src/test/suite/fixtures/recorded/positions/chuckPastAfterLook.yml index acd2bb7a25..d41789ce95 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckPastAfterLook.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckPastAfterLook.yml @@ -12,15 +12,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.l: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: + default.l: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: hethere selections: diff --git a/src/test/suite/fixtures/recorded/positions/chuckPastBeforeTrap.yml b/src/test/suite/fixtures/recorded/positions/chuckPastBeforeTrap.yml index 91d4177092..bf7c0c56d5 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckPastBeforeTrap.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckPastBeforeTrap.yml @@ -12,15 +12,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.t: - start: {line: 0, character: 6} - end: {line: 0, character: 11} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} + marks: + default.t: + start: {line: 0, character: 6} + end: {line: 0, character: 11} finalState: documentContents: helloere selections: diff --git a/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLine.yml b/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLine.yml index 49ce39c5e0..f19ef724ba 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLine.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLine.yml @@ -9,12 +9,12 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: {} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: he selections: diff --git a/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLook.yml b/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLook.yml index 985ca5f0fd..2501b4b2e1 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLook.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckPastEndOfLook.yml @@ -13,15 +13,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.l: - start: {line: 0, character: 0} - end: {line: 0, character: 5} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: + default.l: + start: {line: 0, character: 0} + end: {line: 0, character: 5} finalState: documentContents: he there selections: diff --git a/src/test/suite/fixtures/recorded/positions/chuckPastStartOfTrap.yml b/src/test/suite/fixtures/recorded/positions/chuckPastStartOfTrap.yml index 57af28686a..9fd0e174a7 100644 --- a/src/test/suite/fixtures/recorded/positions/chuckPastStartOfTrap.yml +++ b/src/test/suite/fixtures/recorded/positions/chuckPastStartOfTrap.yml @@ -13,15 +13,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.t: - start: {line: 0, character: 6} - end: {line: 0, character: 11} initialState: documentContents: hello there selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} + marks: + default.t: + start: {line: 0, character: 6} + end: {line: 0, character: 11} finalState: documentContents: hello ere selections: diff --git a/src/test/suite/fixtures/recorded/positions/replaceAfterVestWithHallo.yml b/src/test/suite/fixtures/recorded/positions/replaceAfterVestWithHallo.yml index 20b73e3384..4726f11ae1 100644 --- a/src/test/suite/fixtures/recorded/positions/replaceAfterVestWithHallo.yml +++ b/src/test/suite/fixtures/recorded/positions/replaceAfterVestWithHallo.yml @@ -8,10 +8,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: - [hallo] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -19,6 +15,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/positions/replaceBeforeVestWithHello.yml b/src/test/suite/fixtures/recorded/positions/replaceBeforeVestWithHello.yml index 5639af6cb6..1ca57fb033 100644 --- a/src/test/suite/fixtures/recorded/positions/replaceBeforeVestWithHello.yml +++ b/src/test/suite/fixtures/recorded/positions/replaceBeforeVestWithHello.yml @@ -8,10 +8,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: - [hello] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -19,6 +15,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/positions/replaceEndOfVestWithHello.yml b/src/test/suite/fixtures/recorded/positions/replaceEndOfVestWithHello.yml index 907ec50b74..e5ddca6569 100644 --- a/src/test/suite/fixtures/recorded/positions/replaceEndOfVestWithHello.yml +++ b/src/test/suite/fixtures/recorded/positions/replaceEndOfVestWithHello.yml @@ -9,10 +9,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: - [hello] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/positions/replaceStartOfVestWithHello.yml b/src/test/suite/fixtures/recorded/positions/replaceStartOfVestWithHello.yml index f06eddee42..efb42df632 100644 --- a/src/test/suite/fixtures/recorded/positions/replaceStartOfVestWithHello.yml +++ b/src/test/suite/fixtures/recorded/positions/replaceStartOfVestWithHello.yml @@ -9,10 +9,6 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: - [hello] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir.yml index 7b2edf6ccf..2459c621ee 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir.yml @@ -7,10 +7,6 @@ command: selectionType: paragraph mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir2.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir2.yml index 27ab86042b..dd5680b95e 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir2.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockAir2.yml @@ -7,10 +7,6 @@ command: selectionType: paragraph mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: |- @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockVest.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockVest.yml index 9ca7f33bad..e44b5a6334 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockVest.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckBlockVest.yml @@ -7,10 +7,6 @@ command: selectionType: paragraph mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckFile.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckFile.yml index 518b0ff742..84be045565 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckFile.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckFile.yml @@ -5,7 +5,6 @@ command: partialTargets: - {type: primitive, selectionType: document} extraArgs: [] -marks: {} initialState: documentContents: | @@ -13,6 +12,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: "" selections: diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest.yml index 5e49b16a7a..bc1e7c1126 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest.yml @@ -7,10 +7,6 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest2.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest2.yml index 6b6011621f..077e64f49a 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest2.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckLineVest2.yml @@ -7,10 +7,6 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -19,6 +15,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/chuckTokenVest.yml b/src/test/suite/fixtures/recorded/selectionTypes/chuckTokenVest.yml index d20f0e194a..a8a56d151f 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/chuckTokenVest.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/chuckTokenVest.yml @@ -7,10 +7,6 @@ command: selectionType: token mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/drinkCell.yml b/src/test/suite/fixtures/recorded/selectionTypes/drinkCell.yml index e21f23e497..f0233f59b8 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/drinkCell.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/drinkCell.yml @@ -5,7 +5,6 @@ command: partialTargets: - {type: primitive, selectionType: notebookCell} extraArgs: [] -marks: {} initialState: documentContents: |- # %% @@ -13,6 +12,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: |- # %% diff --git a/src/test/suite/fixtures/recorded/selectionTypes/drinkCellEach.yml b/src/test/suite/fixtures/recorded/selectionTypes/drinkCellEach.yml index a15449c822..b282b8a888 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/drinkCellEach.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/drinkCellEach.yml @@ -7,10 +7,6 @@ command: selectionType: notebookCell mark: {type: decoratedSymbol, symbolColor: default, character: e} extraArgs: [] -marks: - default.e: - start: {line: 1, character: 7} - end: {line: 1, character: 12} initialState: documentContents: |- # %% @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 4, character: 12} active: {line: 4, character: 12} + marks: + default.e: + start: {line: 1, character: 7} + end: {line: 1, character: 12} finalState: documentContents: |- # %% diff --git a/src/test/suite/fixtures/recorded/selectionTypes/pourCell.yml b/src/test/suite/fixtures/recorded/selectionTypes/pourCell.yml index 769c24aea5..2282aa5fbf 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/pourCell.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/pourCell.yml @@ -5,7 +5,6 @@ command: partialTargets: - {type: primitive, selectionType: notebookCell} extraArgs: [] -marks: {} initialState: documentContents: |- # %% @@ -13,6 +12,7 @@ initialState: selections: - anchor: {line: 1, character: 12} active: {line: 1, character: 12} + marks: {} finalState: documentContents: |- # %% diff --git a/src/test/suite/fixtures/recorded/selectionTypes/pourCellEach.yml b/src/test/suite/fixtures/recorded/selectionTypes/pourCellEach.yml index 2014d1351f..6817199e8a 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/pourCellEach.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/pourCellEach.yml @@ -7,10 +7,6 @@ command: selectionType: notebookCell mark: {type: decoratedSymbol, symbolColor: default, character: e} extraArgs: [] -marks: - default.e: - start: {line: 1, character: 7} - end: {line: 1, character: 12} initialState: documentContents: |- # %% @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 4, character: 12} active: {line: 4, character: 12} + marks: + default.e: + start: {line: 1, character: 7} + end: {line: 1, character: 12} finalState: documentContents: |- # %% diff --git a/src/test/suite/fixtures/recorded/selectionTypes/takeBlockAir.yml b/src/test/suite/fixtures/recorded/selectionTypes/takeBlockAir.yml index 977ea2cb5b..d0c2446b21 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/takeBlockAir.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/takeBlockAir.yml @@ -7,10 +7,6 @@ command: selectionType: paragraph mark: {type: decoratedSymbol, symbolColor: default, character: a} extraArgs: [] -marks: - default.a: - start: {line: 3, character: 6} - end: {line: 3, character: 11} initialState: documentContents: | @@ -21,6 +17,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.a: + start: {line: 3, character: 6} + end: {line: 3, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/takeFile.yml b/src/test/suite/fixtures/recorded/selectionTypes/takeFile.yml index 0a76bb31d0..a0eb6f54e6 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/takeFile.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/takeFile.yml @@ -5,7 +5,6 @@ command: partialTargets: - {type: primitive, selectionType: document} extraArgs: [] -marks: {} initialState: documentContents: | @@ -13,6 +12,7 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: {} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/takeLineVest.yml b/src/test/suite/fixtures/recorded/selectionTypes/takeLineVest.yml index 9882d9d259..9d3fa9fa95 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/takeLineVest.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/takeLineVest.yml @@ -7,10 +7,6 @@ command: selectionType: line mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/selectionTypes/takeTokenVest.yml b/src/test/suite/fixtures/recorded/selectionTypes/takeTokenVest.yml index 0631d5d044..2dcfb10d4a 100644 --- a/src/test/suite/fixtures/recorded/selectionTypes/takeTokenVest.yml +++ b/src/test/suite/fixtures/recorded/selectionTypes/takeTokenVest.yml @@ -7,10 +7,6 @@ command: selectionType: token mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 11} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 11} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/chuckFirstCharVest.yml b/src/test/suite/fixtures/recorded/subtoken/chuckFirstCharVest.yml index c71fea91ec..351b2e54cc 100644 --- a/src/test/suite/fixtures/recorded/subtoken/chuckFirstCharVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/chuckFirstCharVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/chuckFirstWordVest.yml b/src/test/suite/fixtures/recorded/subtoken/chuckFirstWordVest.yml index fca7b51d36..09d937f422 100644 --- a/src/test/suite/fixtures/recorded/subtoken/chuckFirstWordVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/chuckFirstWordVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 0, active: 0} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/chuckLastCharVest.yml b/src/test/suite/fixtures/recorded/subtoken/chuckLastCharVest.yml index a0039c4735..3386224d4e 100644 --- a/src/test/suite/fixtures/recorded/subtoken/chuckLastCharVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/chuckLastCharVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/chuckLastWordVest.yml b/src/test/suite/fixtures/recorded/subtoken/chuckLastWordVest.yml index e726df1678..22620b4bbe 100644 --- a/src/test/suite/fixtures/recorded/subtoken/chuckLastWordVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/chuckLastWordVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: -1, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/chuckSecondWordVest.yml b/src/test/suite/fixtures/recorded/subtoken/chuckSecondWordVest.yml index 83d4c01b58..a6071f49a9 100644 --- a/src/test/suite/fixtures/recorded/subtoken/chuckSecondWordVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/chuckSecondWordVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 1, active: 1} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/chuckSixthCharVest.yml b/src/test/suite/fixtures/recorded/subtoken/chuckSixthCharVest.yml index eb731b11ff..a929925fc3 100644 --- a/src/test/suite/fixtures/recorded/subtoken/chuckSixthCharVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/chuckSixthCharVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 5, active: 5} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/clearFirstCharVest.yml b/src/test/suite/fixtures/recorded/subtoken/clearFirstCharVest.yml index 52ffc7e8d1..b696500ea5 100644 --- a/src/test/suite/fixtures/recorded/subtoken/clearFirstCharVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/clearFirstCharVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/clearFirstWordVest.yml b/src/test/suite/fixtures/recorded/subtoken/clearFirstWordVest.yml index 6bb0079f7a..ecc050e57b 100644 --- a/src/test/suite/fixtures/recorded/subtoken/clearFirstWordVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/clearFirstWordVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 0, active: 0} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/clearLastCharVest.yml b/src/test/suite/fixtures/recorded/subtoken/clearLastCharVest.yml index 93ab2b19ea..4369857140 100644 --- a/src/test/suite/fixtures/recorded/subtoken/clearLastCharVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/clearLastCharVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/clearLastWordVest.yml b/src/test/suite/fixtures/recorded/subtoken/clearLastWordVest.yml index 531b7af682..2fca87e41d 100644 --- a/src/test/suite/fixtures/recorded/subtoken/clearLastWordVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/clearLastWordVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: -1, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/clearSecondWordVest.yml b/src/test/suite/fixtures/recorded/subtoken/clearSecondWordVest.yml index 86575686bb..f13e2a07c3 100644 --- a/src/test/suite/fixtures/recorded/subtoken/clearSecondWordVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/clearSecondWordVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 1, active: 1} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/clearSixthCharVest.yml b/src/test/suite/fixtures/recorded/subtoken/clearSixthCharVest.yml index cd30a3e5d8..563cb85bf3 100644 --- a/src/test/suite/fixtures/recorded/subtoken/clearSixthCharVest.yml +++ b/src/test/suite/fixtures/recorded/subtoken/clearSixthCharVest.yml @@ -7,10 +7,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 5, active: 5} mark: {type: decoratedSymbol, symbolColor: default, character: v} extraArgs: [] -marks: - default.v: - start: {line: 1, character: 6} - end: {line: 1, character: 21} initialState: documentContents: | @@ -18,6 +14,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.v: + start: {line: 1, character: 6} + end: {line: 1, character: 21} finalState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar.yml index 4a78aa7dd7..8d59884ed7 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: //aa selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: //aa selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar2.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar2.yml index 7d8c305754..34fd2e4d71 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar2.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar2.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: aa// selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: aa// selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar3.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar3.yml index 6d2196f033..818cf7886d 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar3.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar3.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: ///** selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: {} finalState: documentContents: ///** selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar4.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar4.yml index aba9d12811..0a6452a427 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar4.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar4.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: //*** selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: //*** selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar5.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar5.yml index 419385b1c4..45c014e7fa 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstChar5.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstChar5.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: //** selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: //** selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastCharHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastCharHarp.yml index 50bf67dec2..05d29e77c9 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastCharHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastCharHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastWordHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastWordHarp.yml index 00980dcca7..4bea4c413a 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastWordHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstPastLastWordHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 0, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstPastSecondWordHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstPastSecondWordHarp.yml index df521fed6b..1837da0cd0 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstPastSecondWordHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstPastSecondWordHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 0, active: 1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstThreeCharHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstThreeCharHarp.yml index fe5e773a44..f9aa0dca15 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstThreeCharHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstThreeCharHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: 2} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstTwoWordHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstTwoWordHarp.yml index ea239b275e..c9814ef88b 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstTwoWordHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstTwoWordHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 0, active: 1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeFirstWord.yml b/src/test/suite/fixtures/recorded/subtoken/takeFirstWord.yml index f05574a7ca..d0dfbfafdd 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeFirstWord.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeFirstWord.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: word, anchor: 0, active: 0} extraArgs: [] -marks: {} initialState: documentContents: ;helloThere; selections: - anchor: {line: 0, character: 11} active: {line: 0, character: 11} + marks: {} finalState: documentContents: ;helloThere; selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstCharHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstCharHarp.yml index 327fcbed94..c929b37471 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstCharHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstCharHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -1, active: 0} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstWordHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstWordHarp.yml index 5e25c32352..d798d5cf9b 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstWordHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeLastPastFirstWordHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: -1, active: 0} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeLastThreeCharHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeLastThreeCharHarp.yml index ddf103c4c9..e0a98cbdb4 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeLastThreeCharHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeLastThreeCharHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -3, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeLastTwoWordHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeLastTwoWordHarp.yml index 1b8a6011c3..791ddc175a 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeLastTwoWordHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeLastTwoWordHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: -2, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastEndOfToken.yml b/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastEndOfToken.yml index 114ccb0d63..b2f52ad662 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastEndOfToken.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastEndOfToken.yml @@ -13,15 +13,15 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.l: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: " hello there" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.l: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: " hello there" selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastSecondCharTrap.yml b/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastSecondCharTrap.yml index 219b635e34..7dc54f538d 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastSecondCharTrap.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeSecondCharLookPastSecondCharTrap.yml @@ -17,18 +17,18 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.l: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.t: - start: {line: 0, character: 10} - end: {line: 0, character: 15} initialState: documentContents: " hello there" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.l: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.t: + start: {line: 0, character: 10} + end: {line: 0, character: 15} finalState: documentContents: " hello there" selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeSecondWord.yml b/src/test/suite/fixtures/recorded/subtoken/takeSecondWord.yml index c0a700246f..aa22f6319f 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeSecondWord.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeSecondWord.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: word, anchor: 1, active: 1} extraArgs: [] -marks: {} initialState: documentContents: ;helloThere; selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 1} + marks: {} finalState: documentContents: ;helloThere; selections: diff --git a/src/test/suite/fixtures/recorded/subtoken/takeThirdPastSecondWordHarp.yml b/src/test/suite/fixtures/recorded/subtoken/takeThirdPastSecondWordHarp.yml index 3c7cafdc2b..66e8dad462 100644 --- a/src/test/suite/fixtures/recorded/subtoken/takeThirdPastSecondWordHarp.yml +++ b/src/test/suite/fixtures/recorded/subtoken/takeThirdPastSecondWordHarp.yml @@ -8,10 +8,6 @@ command: modifier: {type: subpiece, pieceType: word, anchor: 2, active: 1} mark: {type: decoratedSymbol, symbolColor: default, character: h} extraArgs: [] -marks: - default.h: - start: {line: 1, character: 15} - end: {line: 1, character: 33} initialState: documentContents: |+ @@ -20,6 +16,10 @@ initialState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + marks: + default.h: + start: {line: 1, character: 15} + end: {line: 1, character: 33} finalState: documentContents: |+ diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml b/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml index 4ccc7b49cd..8907b12956 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: f"j{fdfhjkd}lkjlkj" selections: - anchor: {line: 0, character: 15} active: {line: 0, character: 15} + marks: {} finalState: documentContents: "" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml b/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml index c5c364637b..58521b52c0 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | def fff(x, y): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} + marks: {} finalState: documentContents: | def fff: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml b/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml index 1933f75c81..9c968b6782 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: |- """fds @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: {} finalState: documentContents: "" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml index b0e34c803b..e0ee0ac993 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} extraArgs: [] -marks: {} initialState: documentContents: "{1: [(1), (2), (3)]}" selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: {} finalState: documentContents: "1: [(1), (2), (3)]" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml index 6df6c8001e..83150a3b3f 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: parentheses, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | class a(object): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 12} active: {line: 0, character: 12} + marks: {} finalState: documentContents: | class a: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml index b023421cdb..a949244b7d 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: curlyBrackets, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: "{1: [(1), (2), (3)]}" selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: {} finalState: documentContents: "{}" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml index c5b5906c61..7a45d541dc 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | class a(object): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 11} active: {line: 0, character: 11} + marks: {} finalState: documentContents: | class a(): diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml index 3ea0b74525..054049cc3a 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 8} active: {line: 1, character: 8} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml index 9d34198bcb..66b6577a23 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: |- @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + marks: {} finalState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml index d0d108326d..b2aa79e3f8 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: import { Point, SyntaxNode } from "web-tree-sitter"; selections: - anchor: {line: 0, character: 19} active: {line: 0, character: 19} + marks: {} finalState: documentContents: import {} from "web-tree-sitter"; selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml index 5d2d155071..d22acb37c7 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: import { Point, SyntaxNode } from "web-tree-sitter"; selections: - anchor: {line: 0, character: 40} active: {line: 0, character: 40} + marks: {} finalState: documentContents: import { Point, SyntaxNode } from ""; selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml index 5352c41420..d8598f7518 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: "{const [bongo, baz] = [foo, bar]}" selections: - anchor: {line: 0, character: 17} active: {line: 0, character: 20} + marks: {} finalState: documentContents: "{const [] = [foo, bar]}" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml index dbf0fa6e76..40bd667ea4 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: "{const [bongo, baz] = [foo, bar]}" selections: - anchor: {line: 0, character: 21} active: {line: 0, character: 24} + marks: {} finalState: documentContents: "{}" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml index 144a686c71..e59aef19a7 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml @@ -6,13 +6,13 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | a[222] selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: {} finalState: documentContents: | a[] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml index dededa62ca..6bb10b5738 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml @@ -6,13 +6,13 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | a[222] selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: | a[] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml index 9fbe9e1e0e..2fcf1c9d41 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml @@ -6,13 +6,13 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | a[222] selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 5} + marks: {} finalState: documentContents: | a[] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml index 89e9f06b9c..f24baf811c 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: f"j{fdfhjkd}lkjlkj" selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} + marks: {} finalState: documentContents: f"j{}lkjlkj" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml index d6c282cc56..b1e879abaa 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: f"j{fdfhjkd}lkjlkj" selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} + marks: {} finalState: documentContents: f"" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml index f94882ad98..17222c5f5b 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: f"j{fdfhjkd}lkjlkj" selections: - anchor: {line: 0, character: 15} active: {line: 0, character: 15} + marks: {} finalState: documentContents: f"" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml index e644b71e35..cd199d3030 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | def fff(x, y): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} + marks: {} finalState: documentContents: | def fff(): diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml index f48ef8ff37..87fd15a7a9 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: |- """fds @@ -16,6 +15,7 @@ initialState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + marks: {} finalState: documentContents: "\"\"\"\"\"\"" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml index 0cd4c6f15b..dfd5d5af40 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} extraArgs: [] -marks: {} initialState: documentContents: "{1: [(1), (2), (3)]}" selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: {} finalState: documentContents: "{1: (1), (2), (3)}" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml index 0cd4c6f15b..dfd5d5af40 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} extraArgs: [] -marks: {} initialState: documentContents: "{1: [(1), (2), (3)]}" selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: {} finalState: documentContents: "{1: (1), (2), (3)}" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml index 14664ff3f2..4d4128fcca 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} extraArgs: [] -marks: {} initialState: documentContents: f"j{fdfhjkd}lkjlkj" selections: - anchor: {line: 0, character: 14} active: {line: 0, character: 14} + marks: {} finalState: documentContents: j{fdfhjkd}lkjlkj selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml index 9e486035d3..435391c571 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} extraArgs: [] -marks: {} initialState: documentContents: | def fff(x, y): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} + marks: {} finalState: documentContents: | def fffx, y: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml index 9bcb745b6b..a3dc50831d 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: curlyBrackets, delimitersOnly: true} extraArgs: [] -marks: {} initialState: documentContents: "{1: [(1), (2), (3)]}" selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: {} finalState: documentContents: "1: [(1), (2), (3)]" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml index f06e58014b..aa1bd3114a 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml @@ -6,7 +6,6 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: parentheses, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | class a(object): @@ -14,6 +13,7 @@ initialState: selections: - anchor: {line: 0, character: 11} active: {line: 0, character: 11} + marks: {} finalState: documentContents: | class a(): diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml index 647119f90b..7801b70b1e 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml @@ -6,13 +6,13 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: | a[222] selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: {} finalState: documentContents: | a[] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml index e444ad1992..68df24e093 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: "{1: [(1), (2), (3)]}" selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: {} finalState: documentContents: "{1: []}" selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml index 9957422e5a..a391d9058f 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: const [bongo, baz] = [foo, bar] selections: - anchor: {line: 0, character: 22} active: {line: 0, character: 22} + marks: {} finalState: documentContents: const [bongo, baz] = [] selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml index 8d25dc7d4d..cd20ca8953 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: const [bongo, baz] = [foo, bar] selections: - anchor: {line: 0, character: 21} active: {line: 0, character: 21} + marks: {} finalState: documentContents: const [bongo, baz] = [] selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml index 01934c4e1e..eea753b891 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml @@ -6,12 +6,12 @@ command: - type: primitive modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} extraArgs: [] -marks: {} initialState: documentContents: const [bongo, baz] = [foo, bar] selections: - anchor: {line: 0, character: 30} active: {line: 0, character: 30} + marks: {} finalState: documentContents: const [bongo, baz] = [] selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml index 1e9aecf3bb..e7f6331968 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml @@ -7,15 +7,15 @@ command: modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} mark: {type: decoratedSymbol, symbolColor: default, character: '['} extraArgs: [] -marks: - default.[: - start: {line: 0, character: 21} - end: {line: 0, character: 22} initialState: documentContents: const [bongo, baz] = [foo, bar] selections: - anchor: {line: 0, character: 26} active: {line: 0, character: 26} + marks: + default.[: + start: {line: 0, character: 21} + end: {line: 0, character: 22} finalState: documentContents: const [bongo, baz] = [] selections: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml b/src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml index 2621a9ed61..07fd82de1a 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml @@ -7,15 +7,15 @@ command: modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} mark: {type: decoratedSymbol, symbolColor: default, character: ']'} extraArgs: [] -marks: - default.]: - start: {line: 0, character: 30} - end: {line: 0, character: 31} initialState: documentContents: const [bongo, baz] = [foo, bar] selections: - anchor: {line: 0, character: 26} active: {line: 0, character: 26} + marks: + default.]: + start: {line: 0, character: 30} + end: {line: 0, character: 31} finalState: documentContents: const [bongo, baz] = [] selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml index 17d1c9c258..3b6aaf7bc3 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFine.yml @@ -12,15 +12,15 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo fooworld selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml index c31800c15d..c1b4342f1b 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThirdCarThis.yml @@ -11,15 +11,15 @@ command: mark: {type: cursor} position: after extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo worfoold whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml index 21d94bfeb1..4cce1eb78b 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis.yml @@ -9,15 +9,15 @@ command: mark: {type: cursor} position: after extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo fooworld selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml index f9aa2e7d50..f56aec41b6 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineAfterThis2.yml @@ -9,15 +9,15 @@ command: mark: {type: cursor} position: after extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo world foo selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml index 6a90ca8f2f..cbabac18d4 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineBeforeThis.yml @@ -9,15 +9,15 @@ command: mark: {type: cursor} position: before extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo foo world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml index 61a82f7928..bb7a1b1cc4 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstCarWhale.yml @@ -10,18 +10,18 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 8} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo fooorld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml index f3176acbd8..f6d5ddb242 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToFirstTwoCar.yml @@ -9,15 +9,15 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo foorld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml index 870447b919..16dbfa2f5e 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastCarWhale.yml @@ -10,18 +10,18 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 8} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo worlfoo whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml index 4907a9e486..da0ad8a41c 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToLastTwoCar.yml @@ -9,15 +9,15 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo worfoo whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml index 5d819c076d..c10dcc1c84 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToThirdCarWhale.yml @@ -10,18 +10,18 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo wofoold whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml index 42c3ab20cd..ec1cc47183 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale.yml @@ -8,18 +8,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo foo selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml index 0d1e5c8cc1..eb970c4039 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale2.yml @@ -8,18 +8,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 5} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo foo selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml index 2634177741..acfef29899 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale3.yml @@ -8,18 +8,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo foo selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml index 46c9ff23d8..d41f0ed53c 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale4.yml @@ -8,18 +8,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 7} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo foo selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml index 4b55a56502..dfecfb3212 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringFineToWhale5.yml @@ -8,18 +8,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 8} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo foo whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml index 94d9a6180c..a1106add93 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToEndOfWhale.yml @@ -10,18 +10,18 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.h: - start: {line: 0, character: 10} - end: {line: 0, character: 18} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo worldwhatever whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml index 7acbdc0cea..c1ad9bb990 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToFourthCarWhalePastSecondCarHarp.yml @@ -19,18 +19,18 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.h: - start: {line: 0, character: 10} - end: {line: 0, character: 18} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo worwhateveratever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml index b13d960985..0fc950a8fc 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarHarp.yml @@ -19,18 +19,18 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.h: - start: {line: 0, character: 10} - end: {line: 0, character: 27} - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world whateverspaghetti selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 27} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: fwhateverspaghettiteverspaghetti selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml index 0203b81357..ff76d437e5 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToSecondCarFinePastThirdCarWhale.yml @@ -19,21 +19,21 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.h: - start: {line: 0, character: 10} - end: {line: 0, character: 18} - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: fwhateverld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml index f5616fd8ce..1c2abb6e72 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringHarpToStartOfWhale.yml @@ -10,18 +10,18 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.h: - start: {line: 0, character: 10} - end: {line: 0, character: 18} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo whateverworld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml index e059d87b22..bc665c8d97 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhale.yml @@ -12,15 +12,15 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: fooworld world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml index faec9379d0..b3f8f33d24 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterFine.yml @@ -9,18 +9,18 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: f} position: after extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: foo world world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml index 86befe5b23..9622ddcb53 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis.yml @@ -9,15 +9,15 @@ command: mark: {type: cursor} position: after extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo world world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml index 86befe5b23..9622ddcb53 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleAfterThis2.yml @@ -9,15 +9,15 @@ command: mark: {type: cursor} position: after extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo world world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml index d7fd883aa1..2eeeab650d 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleBeforeThis.yml @@ -9,15 +9,15 @@ command: mark: {type: cursor} position: before extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: fooworld world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml index 6fab20d410..bc603d7395 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToEndOfFine.yml @@ -10,18 +10,18 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: f} extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: fooworld world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml index ed1fd2a048..9b15e441fe 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/bringWhaleToFine.yml @@ -8,18 +8,18 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: f} extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} initialState: documentContents: foo world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} finalState: documentContents: world world selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml index 93edb73d73..c31aab8059 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstCarWhale.yml @@ -8,15 +8,15 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 8} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo orld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml index 012b5d5b7b..a3c0348f0a 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckFirstPastSecondCar.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1, excludeAnchor: false, excludeActive: false} extraArgs: [] -marks: {} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: {} finalState: documentContents: foo rld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml index 308a86cc84..d206be2206 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckFourthPastFifthCar.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 3, active: 4, excludeAnchor: false, excludeActive: false} extraArgs: [] -marks: {} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: {} finalState: documentContents: foo wor whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml index 481b7e4401..a782e82d6e 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckLastCarWhale.yml @@ -8,15 +8,15 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -1, active: -1, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 8} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: foo worl whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml index e8071ecb92..766f84d86d 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondCarFinePastThirdCarWhale.yml @@ -17,18 +17,18 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.f: - start: {line: 0, character: 0} - end: {line: 0, character: 3} - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.f: + start: {line: 0, character: 0} + end: {line: 0, character: 3} + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} finalState: documentContents: fld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml index 5bd0a6c7a2..439c75fb52 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckSecondPastThirdCar.yml @@ -7,12 +7,12 @@ command: selectionType: token modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false} extraArgs: [] -marks: {} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: {} finalState: documentContents: foo wld whatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml b/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml index e288e7c813..e4d9454140 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/chuckThirdCarWhalePastSecondCarHarp.yml @@ -17,18 +17,18 @@ command: excludeStart: false excludeEnd: false extraArgs: [] -marks: - default.w: - start: {line: 0, character: 4} - end: {line: 0, character: 9} - default.h: - start: {line: 0, character: 10} - end: {line: 0, character: 18} initialState: documentContents: foo world whatever selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 9} + marks: + default.w: + start: {line: 0, character: 4} + end: {line: 0, character: 9} + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 18} finalState: documentContents: foo woatever selections: diff --git a/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml b/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml index cfaec135cc..e7edc40c56 100644 --- a/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml +++ b/src/test/suite/fixtures/recorded/updateSelections/commentTrap.yml @@ -6,10 +6,6 @@ command: - type: primitive mark: {type: decoratedSymbol, symbolColor: default, character: t} extraArgs: [] -marks: - default.t: - start: {line: 1, character: 1} - end: {line: 1, character: 6} initialState: documentContents: |- 'hello' @@ -17,6 +13,10 @@ initialState: selections: - anchor: {line: 0, character: 1} active: {line: 1, character: 6} + marks: + default.t: + start: {line: 1, character: 1} + end: {line: 1, character: 6} finalState: documentContents: |- 'hello' From e9e90d0dc8349b96f3163a164fe6b3ef54fbcf15 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 17:56:29 +0000 Subject: [PATCH 38/48] Get tests working --- src/core/NavigationMap.ts | 7 +++- src/scripts/transformRecordedTests.ts | 10 +++++- src/test/suite/recorded.test.ts | 48 +++++++++++++++++++++------ src/testUtil/takeSnapshot.ts | 5 ++- 4 files changed, 56 insertions(+), 14 deletions(-) diff --git a/src/core/NavigationMap.ts b/src/core/NavigationMap.ts index 6e2af3a899..5eb87b63f2 100644 --- a/src/core/NavigationMap.ts +++ b/src/core/NavigationMap.ts @@ -37,7 +37,12 @@ export default class NavigationMap { } static splitKey(key: string) { - const [hatStyle, character] = key.split("."); + let [hatStyle, character] = key.split("."); + if (character.length === 0) { + // If the character is `.` then it will appear as a zero length string + // due to the way the split on `.` works + character = "."; + } return { hatStyle: hatStyle as HatStyleName, character }; } diff --git a/src/scripts/transformRecordedTests.ts b/src/scripts/transformRecordedTests.ts index 7c87f1cac8..37b6a1469e 100644 --- a/src/scripts/transformRecordedTests.ts +++ b/src/scripts/transformRecordedTests.ts @@ -13,7 +13,7 @@ import canonicalizeActionName from "../util/canonicalizeActionName"; * The transformation to run on all recorded test fixtures. Change this * variable to do a custom bulk transformation. */ -const FIXTURE_TRANSFORMATION = identity; +const FIXTURE_TRANSFORMATION = moveMarksToInitialState; async function main() { const directory = path.join( @@ -44,4 +44,12 @@ function canonicalizeActionNames(fixture: TestCaseFixture) { return update(fixture, { command: { actionName: canonicalizeActionName } }); } +function moveMarksToInitialState(fixture: TestCaseFixture) { + if ((fixture as any).marks != null) { + fixture.initialState.marks = (fixture as any).marks; + (fixture as any).marks = undefined; + } + return fixture; +} + main(); diff --git a/src/test/suite/recorded.test.ts b/src/test/suite/recorded.test.ts index 3738cf6c2a..a8e043babf 100644 --- a/src/test/suite/recorded.test.ts +++ b/src/test/suite/recorded.test.ts @@ -10,13 +10,20 @@ import * as sinon from "sinon"; import { Clipboard } from "../../util/Clipboard"; import { takeSnapshot } from "../../testUtil/takeSnapshot"; import { + marksToPlainObject, PositionPlainObject, rangeToPlainObject, SelectionPlainObject, + SerializedMarks, } from "../../testUtil/toPlainObject"; import { walkFilesSync } from "../../testUtil/walkSync"; -import { getCursorlessApi, getParseTreeApi } from "../../util/getExtensionApi"; +import { + CursorlessApi, + getCursorlessApi, + getParseTreeApi, +} from "../../util/getExtensionApi"; import { enableDebugLog } from "../../util/debug"; +import { extractTargetedMarks } from "../../testUtil/extractTargetedMarks"; function createPosition(position: PositionPlainObject) { return new vscode.Position(position.line, position.character); @@ -99,15 +106,7 @@ async function runTest(file: string) { cursorlessApi.addDecorations(); // Assert that recorded decorations are present - Object.entries(fixture.initialState.marks!).forEach(([key, token]) => { - const { hatStyle, character } = NavigationMap.splitKey(key); - const currentToken = cursorlessApi.navigationMap.getToken( - hatStyle, - character - ); - assert(currentToken != null, `Mark "${hatStyle} ${character}" not found`); - assert.deepStrictEqual(rangeToPlainObject(currentToken.range), token); - }); + checkMarks(fixture.initialState.marks, cursorlessApi.navigationMap); const returnValue = await vscode.commands.executeCommand( "cursorless.command", @@ -117,12 +116,23 @@ async function runTest(file: string) { ...fixture.command.extraArgs ); + const marks = + fixture.finalState.marks == null + ? undefined + : marksToPlainObject( + extractTargetedMarks( + Object.keys(fixture.finalState.marks) as string[], + cursorlessApi.navigationMap + ) + ); + // TODO Visible ranges are not asserted, see: // https://github.com/pokey/cursorless-vscode/issues/160 const { visibleRanges, ...resultState } = await takeSnapshot( cursorlessApi.thatMark, cursorlessApi.sourceMark, - excludeFields + excludeFields, + marks ); if (process.env.CURSORLESS_TEST_UPDATE_FIXTURES === "true") { @@ -142,3 +152,19 @@ async function runTest(file: string) { ); } } + +function checkMarks( + marks: SerializedMarks | undefined, + navigationMap: NavigationMap +) { + if (marks == null) { + return; + } + + Object.entries(marks).forEach(([key, token]) => { + const { hatStyle, character } = NavigationMap.splitKey(key); + const currentToken = navigationMap.getToken(hatStyle, character); + assert(currentToken != null, `Mark "${hatStyle} ${character}" not found`); + assert.deepStrictEqual(rangeToPlainObject(currentToken.range), token); + }); +} diff --git a/src/testUtil/takeSnapshot.ts b/src/testUtil/takeSnapshot.ts index c34cbc63fb..530279faea 100644 --- a/src/testUtil/takeSnapshot.ts +++ b/src/testUtil/takeSnapshot.ts @@ -32,9 +32,12 @@ export async function takeSnapshot( const snapshot: TestCaseSnapshot = { documentContents: activeEditor.document.getText(), selections: activeEditor.selections.map(selectionToPlainObject), - marks, }; + if (marks != null) { + snapshot.marks = marks; + } + if (!excludeFields.includes("clipboard")) { snapshot.clipboard = await Clipboard.readText(); } From 96854ecd5ffcf1d550fda3c521dc86417af2ba9a Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 17:57:34 +0000 Subject: [PATCH 39/48] Remove transient transorm recorded tests --- src/scripts/transformRecordedTests.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/scripts/transformRecordedTests.ts b/src/scripts/transformRecordedTests.ts index 37b6a1469e..7c87f1cac8 100644 --- a/src/scripts/transformRecordedTests.ts +++ b/src/scripts/transformRecordedTests.ts @@ -13,7 +13,7 @@ import canonicalizeActionName from "../util/canonicalizeActionName"; * The transformation to run on all recorded test fixtures. Change this * variable to do a custom bulk transformation. */ -const FIXTURE_TRANSFORMATION = moveMarksToInitialState; +const FIXTURE_TRANSFORMATION = identity; async function main() { const directory = path.join( @@ -44,12 +44,4 @@ function canonicalizeActionNames(fixture: TestCaseFixture) { return update(fixture, { command: { actionName: canonicalizeActionName } }); } -function moveMarksToInitialState(fixture: TestCaseFixture) { - if ((fixture as any).marks != null) { - fixture.initialState.marks = (fixture as any).marks; - (fixture as any).marks = undefined; - } - return fixture; -} - main(); From 12d88743cec1de1d00ec82e7c5fe759be1beb3cf Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 18:00:41 +0000 Subject: [PATCH 40/48] Add docs for navigation map tests --- docs/test-case-recorder.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/test-case-recorder.md b/docs/test-case-recorder.md index 098a516eb5..6648fd04b0 100644 --- a/docs/test-case-recorder.md +++ b/docs/test-case-recorder.md @@ -10,9 +10,15 @@ command run, and the final state, all in the form of a yaml document. See ## Initial setup -1. Add a voice command for recording to your personal talon files: - - `cursorless record: user.vscode("cursorless.recordTestCase")` - - We don't want to commit this so add it to your own repository. +1. Add a voice command for recording to your personal talon files: + - `cursorless record: user.vscode("cursorless.recordTestCase")` + - We don't want to commit this so add it to your own repository. +1. If you'd like to be able to do tests which check the navigation map, you should also add the following to your personal talon files: + + cursorless record navigation: + user.vscode_with_plugin("cursorless.recordTestCase", 1) + + It is quite unlikely you'll need this second step. Most tests don't check the navigation map. ## Recording new tests @@ -39,6 +45,10 @@ command run, and the final state, all in the form of a yaml document. See - `Stopped recording test cases` is shown - You can also just stop the debugger or close the debug window +### Navigation map tests + +If you want to check how the navigation map gets updated in response to changes, you can instead say "cursorless record navigation", and then you need to issue two commands in one phrase each time. The second command should be of the form "take air" (or another decorated mark), and will tell the test case recorder which decorated mark we're checking. + ## Run recorded tests Recorded tests will automatically be picked up and run with the normal tests, From 74ce5656bef6304951ddbc51d6bef89849dd2e31 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 18:12:20 +0000 Subject: [PATCH 41/48] Add more tests --- .../bringCommaToEndOfPointTakePoint.yml | 43 +++++++++++++++++++ .../bringCommaToStartOfPointTakePoint.yml | 43 +++++++++++++++++++ .../bringHarpToEndOfPointTakePoint.yml | 43 +++++++++++++++++++ .../bringHarpToStartOfPointTakePoint.yml | 43 +++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml new file mode 100644 index 0000000000..175aeeab00 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml @@ -0,0 +1,43 @@ +spokenForm: bring comma to end of point take point +languageId: typescript +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: ','} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: .} + extraArgs: [] +initialState: + documentContents: " . , hello" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: + default.,: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + default..: + start: {line: 0, character: 1} + end: {line: 0, character: 2} +finalState: + documentContents: " ., , hello" + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.,: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + default..: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 3} + sourceMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ','}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml new file mode 100644 index 0000000000..cd6133daf5 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml @@ -0,0 +1,43 @@ +spokenForm: bring comma to start of point take point +languageId: typescript +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: ','} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: .} + extraArgs: [] +initialState: + documentContents: " . , hello" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: + default.,: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + default..: + start: {line: 0, character: 1} + end: {line: 0, character: 2} +finalState: + documentContents: " ,. , hello" + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: + default.,: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + default..: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 2} + sourceMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ','}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml new file mode 100644 index 0000000000..504c92b26c --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml @@ -0,0 +1,43 @@ +spokenForm: bring harp to end of point take point +languageId: typescript +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: .} + extraArgs: [] +initialState: + documentContents: " . , hello" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: + default.h: + start: {line: 0, character: 5} + end: {line: 0, character: 10} + default..: + start: {line: 0, character: 1} + end: {line: 0, character: 2} +finalState: + documentContents: " .hello , hello" + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 15} + default..: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 7} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 15} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml new file mode 100644 index 0000000000..bfa30480a2 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml @@ -0,0 +1,43 @@ +spokenForm: bring harp to start of point take point +languageId: typescript +command: + actionName: replaceWithTarget + partialTargets: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: .} + extraArgs: [] +initialState: + documentContents: " . , hello" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: + default.h: + start: {line: 0, character: 5} + end: {line: 0, character: 10} + default..: + start: {line: 0, character: 1} + end: {line: 0, character: 2} +finalState: + documentContents: " hello. , hello" + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: + default.h: + start: {line: 0, character: 10} + end: {line: 0, character: 15} + default..: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 6} + sourceMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 15} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] From 2fd2e2d1b0541e9323264e51c826c0c7487ed5c5 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 18:19:27 +0000 Subject: [PATCH 42/48] Remove unnecessary test --- .../recorded/navigationMap/takeHarp.yml | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml diff --git a/src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml b/src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml deleted file mode 100644 index 807c2d0f49..0000000000 --- a/src/test/suite/fixtures/recorded/navigationMap/takeHarp.yml +++ /dev/null @@ -1,26 +0,0 @@ -spokenForm: take harp -languageId: plaintext -command: - actionName: setSelection - partialTargets: - - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: h} - extraArgs: [] -initialState: - documentContents: hello world - selections: - - anchor: {line: 0, character: 11} - active: {line: 0, character: 11} - marks: - default.h: - start: {line: 0, character: 0} - end: {line: 0, character: 5} -finalState: - documentContents: hello world - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 5} - thatMark: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 5} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] From e057c594de4f7e5b0a6e2075521fcf41deeebd99 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 18:32:55 +0000 Subject: [PATCH 43/48] Add comments --- src/testUtil/TestCase.ts | 3 +++ src/testUtil/TestCaseRecorder.ts | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/testUtil/TestCase.ts b/src/testUtil/TestCase.ts index fa6cb5ed71..82fc688b6d 100644 --- a/src/testUtil/TestCase.ts +++ b/src/testUtil/TestCase.ts @@ -69,6 +69,9 @@ export class TestCase { const { navigationMap } = this.context; if (this.isNavigationMapTest) { + // If we're doing a navigation map test, then we grab the entire + // navigation map because we'll filter it later based on the marks + // referenced in the expected follow up command marks = Object.fromEntries(navigationMap.getEntries()); } else { marks = extractTargetedMarks(this.targetKeys, navigationMap); diff --git a/src/testUtil/TestCaseRecorder.ts b/src/testUtil/TestCaseRecorder.ts index 05427daf09..0162a5892f 100644 --- a/src/testUtil/TestCaseRecorder.ts +++ b/src/testUtil/TestCaseRecorder.ts @@ -43,6 +43,9 @@ export class TestCaseRecorder { async preCommandHook(command: TestCaseCommand, context: TestCaseContext) { if (this.testCase != null) { + // If testCase is not null and we are just before a command, this means + // that this command is the follow up command indicating which marks we + // cared about from the last command invariant( this.testCase.awaitingFinalMarkInfo, () => "expected to be awaiting final mark info" @@ -50,6 +53,7 @@ export class TestCaseRecorder { this.testCase.filterMarks(command, context); await this.finishTestCase(); } else { + // Otherwise, we are starting a new test case this.testCase = new TestCase(command, context, this.isNavigationMapTest); await this.testCase.recordInitialState(); } @@ -57,14 +61,21 @@ export class TestCaseRecorder { async postCommandHook(returnValue: any) { if (this.testCase == null) { + // If test case is null then this means that this was just a follow up + // command for a navigation map test return; } await this.testCase.recordFinalState(returnValue); - if (!this.testCase.awaitingFinalMarkInfo) { - await this.finishTestCase(); + if (this.testCase.awaitingFinalMarkInfo) { + // We don't finish the test case here in the case of a navigation map + // test because we'll do it after we get the follow up command indicating + // which marks we wanted to track + return; } + + await this.finishTestCase(); } async finishTestCase(): Promise { From 801a994048b40a2ea2d3d3877d4f4e3ccf057aec Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 20:26:07 +0000 Subject: [PATCH 44/48] Be more robust to errors in the testcase recording --- src/extension.ts | 1 + src/testUtil/TestCaseRecorder.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index fad9cec939..04e1d62fa2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -201,6 +201,7 @@ export async function activate(context: vscode.ExtensionContext) { // const processedTargets = processTargets(navigationMap!, targets); } catch (e) { + testCaseRecorder.commandErrorHook(); const err = e as Error; vscode.window.showErrorMessage(err.message); console.debug(err.message); diff --git a/src/testUtil/TestCaseRecorder.ts b/src/testUtil/TestCaseRecorder.ts index 0162a5892f..51b8403f95 100644 --- a/src/testUtil/TestCaseRecorder.ts +++ b/src/testUtil/TestCaseRecorder.ts @@ -167,6 +167,10 @@ export class TestCaseRecorder { return filePath; } + + commandErrorHook() { + this.testCase = null; + } } function camelize(str: string) { From c1b4077328ac2f6c30cdbd0bc35a901f0c0e8ae2 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Thu, 4 Nov 2021 23:13:04 +0000 Subject: [PATCH 45/48] Test multiple inserts in one atomic edit --- ...PointToEndOfThisAndEndOfWhaleTakeWhale.yml | 63 +++++++++++++++++ ...AndPointToThisAndStartOfWhaleTakeWhale.yml | 61 +++++++++++++++++ ...OfSecondCarWhaleAndEndOfWhaleTakeWhale.yml | 65 ++++++++++++++++++ ...ngPointAndHarpToEndOfThisAndEndOfWhale.yml | 63 +++++++++++++++++ ...dHarpToEndOfThisAndEndOfWhaleTakeWhale.yml | 63 +++++++++++++++++ ...SecondCarWhaleAndStartOfWhaleTakeWhale.yml | 67 +++++++++++++++++++ ...tAndHarpToThisAndStartOfWhaleTakeWhale.yml | 61 +++++++++++++++++ ...OfSecondCarWhaleAndEndOfWhaleTakeWhale.yml | 57 ++++++++++++++++ ...SecondCarWhaleAndStartOfWhaleTakeWhale.yml | 59 ++++++++++++++++ 9 files changed, 559 insertions(+) create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml create mode 100644 src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..680eeccbc3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml @@ -0,0 +1,63 @@ +spokenForm: bring harp and point to end of this and end of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: list + elements: + - type: primitive + position: after + insideOutsideType: inside + mark: {type: cursor} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. worldhello. + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 17} + thatMark: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 18} + - anchor: {line: 0, character: 12} + active: {line: 0, character: 18} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..1abfc764e3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml @@ -0,0 +1,61 @@ +spokenForm: bring harp and point to this and start of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: list + elements: + - type: primitive + mark: {type: cursor} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. hello.world + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 8} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 13} + - anchor: {line: 0, character: 7} + active: {line: 0, character: 13} + sourceMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..003fb6e180 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml @@ -0,0 +1,65 @@ +spokenForm: bring point and harp to end of second car whale and end of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: list + elements: + - type: primitive + position: after + insideOutsideType: inside + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. wo.rldhello + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 10} + - anchor: {line: 0, character: 13} + active: {line: 0, character: 18} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml new file mode 100644 index 0000000000..5e9fdae6de --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml @@ -0,0 +1,63 @@ +spokenForm: bring point and harp to end of this and end of whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: list + elements: + - type: primitive + position: after + insideOutsideType: inside + mark: {type: cursor} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. world.hello + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 18} + - anchor: {line: 0, character: 12} + active: {line: 0, character: 18} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..bc134176bd --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml @@ -0,0 +1,63 @@ +spokenForm: bring point and harp to end of this and end of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: list + elements: + - type: primitive + position: after + insideOutsideType: inside + mark: {type: cursor} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. world.hello + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 18} + - anchor: {line: 0, character: 12} + active: {line: 0, character: 18} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..3370b6cf97 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml @@ -0,0 +1,67 @@ +spokenForm: >- + bring point and harp to start of second car whale and start of whale take + whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: list + elements: + - type: primitive + position: before + insideOutsideType: inside + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. hellow.orld + selections: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 14} + - anchor: {line: 0, character: 7} + active: {line: 0, character: 12} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..35b7eb1a5f --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml @@ -0,0 +1,61 @@ +spokenForm: bring point and harp to this and start of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: h} + - type: list + elements: + - type: primitive + mark: {type: cursor} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. .helloworld + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.h: + start: {line: 0, character: 0} + end: {line: 0, character: 5} + default.w: + start: {line: 0, character: 8} + end: {line: 0, character: 18} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 13} + - anchor: {line: 0, character: 7} + active: {line: 0, character: 13} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 5} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..32702b8420 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml @@ -0,0 +1,57 @@ +spokenForm: bring point and point to end of second car whale and end of whale take whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: list + elements: + - type: primitive + position: after + insideOutsideType: inside + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + position: after + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. wo.rld. + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 13} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 10} + - anchor: {line: 0, character: 13} + active: {line: 0, character: 14} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml new file mode 100644 index 0000000000..4ac5408d05 --- /dev/null +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml @@ -0,0 +1,59 @@ +spokenForm: >- + bring point and point to start of second car whale and start of whale take + whale +languageId: plaintext +command: + actionName: replaceWithTarget + partialTargets: + - type: list + elements: + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: primitive + mark: {type: decoratedSymbol, symbolColor: default, character: .} + - type: list + elements: + - type: primitive + position: before + insideOutsideType: inside + selectionType: token + modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false} + mark: {type: decoratedSymbol, symbolColor: default, character: w} + - type: primitive + position: before + insideOutsideType: inside + mark: {type: decoratedSymbol, symbolColor: default, character: w} + extraArgs: [] +initialState: + documentContents: hello. world + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 7} + end: {line: 0, character: 12} +finalState: + documentContents: hello. .w.orld + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: + default..: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + default.w: + start: {line: 0, character: 8} + end: {line: 0, character: 14} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 10} + - anchor: {line: 0, character: 7} + active: {line: 0, character: 8} + sourceMark: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 6} +fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] From c60ff42a968412297205fed8f1d6655b490cedcf Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 5 Nov 2021 18:06:25 +0000 Subject: [PATCH 46/48] Take note of marks that we care about --- src/testUtil/TestCase.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/testUtil/TestCase.ts b/src/testUtil/TestCase.ts index 82fc688b6d..91219f6f88 100644 --- a/src/testUtil/TestCase.ts +++ b/src/testUtil/TestCase.ts @@ -34,6 +34,11 @@ export type TestCaseFixture = { returnValue: unknown; /** Inferred full targets added for context; not currently used in testing */ fullTargets: Target[]; + + /** + * A list of marks to check in the case of navigation map test otherwise undefined + */ + marksToCheck?: string[]; }; export class TestCase { @@ -45,6 +50,7 @@ export class TestCase { returnValue: unknown = null; targetKeys: string[]; private _awaitingFinalMarkInfo: boolean; + marksToCheck?: string[]; constructor( private command: TestCaseCommand, @@ -134,6 +140,7 @@ export class TestCase { finalState: this.finalState, returnValue: this.returnValue, fullTargets: this.fullTargets, + marksToCheck: this.marksToCheck, }; return serialize(fixture); } @@ -160,9 +167,8 @@ export class TestCase { } filterMarks(command: TestCaseCommand, context: TestCaseContext) { - const keys = this.targetKeys.concat( - context.targets.map(extractTargetKeys).flat() - ); + const marksToCheck = context.targets.map(extractTargetKeys).flat(); + const keys = this.targetKeys.concat(marksToCheck); this.initialState!.marks = pick( this.initialState!.marks, @@ -174,6 +180,8 @@ export class TestCase { keys ) as SerializedMarks; + this.marksToCheck = marksToCheck; + this._awaitingFinalMarkInfo = false; } From 2f591fcedc832eff3f5a86462b1080d31708094c Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Fri, 5 Nov 2021 18:09:06 +0000 Subject: [PATCH 47/48] Transform test cases --- .../recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml | 1 + .../recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml | 1 + .../recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml | 1 + .../recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml | 1 + .../bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml | 1 + .../bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml | 1 + .../recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml | 1 + .../suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml | 1 + .../recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml | 1 + .../recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml | 1 + .../recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml | 1 + .../navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml | 1 + ...ngPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml | 1 + .../navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml | 1 + .../bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml | 1 + ...intAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml | 1 + .../bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml | 1 + ...gPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml | 1 + ...ntAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml | 1 + .../recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml | 1 + .../recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml | 1 + .../navigationMap/bringPointToThirdCarWhaleTakeWhale.yml | 1 + .../recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml | 1 + .../chuckFourthCarWhalePastThirdCarAirTakeWhale.yml | 1 + .../recorded/navigationMap/chuckHarpPastAirTakeWhale.yml | 1 + .../recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml | 1 + .../navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml | 1 + .../chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml | 1 + .../moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml | 1 + 29 files changed, 29 insertions(+) diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml index 62e58b5046..d60e0caae7 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 20} active: {line: 0, character: 28} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml index 175aeeab00..3817dba8e3 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 4} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ','}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml index cd6133daf5..4d377f6588 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 4} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ','}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml index 5129012315..38030e97d8 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml @@ -40,3 +40,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml index 680eeccbc3..915fad9479 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml @@ -61,3 +61,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml index 1abfc764e3..483a2485c2 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml @@ -59,3 +59,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml index fce80e8603..d453d97d13 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml @@ -40,3 +40,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: null, modifier: {type: identity}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml index a0125e4be8..c6b9f49bc2 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml @@ -43,3 +43,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml index 504c92b26c..e0e3e41759 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 10} active: {line: 0, character: 15} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml index bfa30480a2..d5d57a21ab 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 10} active: {line: 0, character: 15} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml index d790eee711..9606a5fbf9 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml index ffa8480225..e558262b85 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml @@ -42,3 +42,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml index 003fb6e180..402a59d6ec 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml @@ -63,3 +63,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml index 5e9fdae6de..e8500fe087 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml @@ -61,3 +61,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml index bc134176bd..4618cb7932 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml @@ -61,3 +61,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml index 3370b6cf97..ecf8baa0d2 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml @@ -65,3 +65,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml index 35b7eb1a5f..64c973fa28 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml @@ -59,3 +59,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml index 32702b8420..2e06ac406a 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml @@ -55,3 +55,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml index 4ac5408d05..6e7993c35a 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml @@ -57,3 +57,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml index b494fa3499..eb0897ce37 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml index 92b5748200..038e8b6971 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml index 9952aa3313..712aa075bd 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml @@ -41,3 +41,4 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml index a3198f378a..f99f6fbf31 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml @@ -30,3 +30,4 @@ finalState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml index b77f59f11c..60e22d16a1 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml @@ -45,3 +45,4 @@ finalState: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml index 74a891cd54..d4615de806 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml @@ -47,3 +47,4 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: identity}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: identity}}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml index ce7123cc73..535ab71c4c 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml @@ -30,3 +30,4 @@ finalState: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml index a3a950840d..9d1d391ff7 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml @@ -30,3 +30,4 @@ finalState: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml index 79ffcb2be6..049687d99e 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml @@ -45,3 +45,4 @@ finalState: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}] +marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml index 2b1831c9fd..2ea91a2ca8 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml @@ -52,3 +52,4 @@ finalState: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] +marksToCheck: [default.w] From 46b787acdd9e283048018d2e574282bfcc0fd8c7 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Sat, 6 Nov 2021 09:13:18 +0000 Subject: [PATCH 48/48] Reorder fixture fields --- src/scripts/transformRecordedTests.ts | 17 ++++++++++++++++- .../bringAirToThirdCarWhaleTakeWhale.yml | 2 +- .../bringCommaToEndOfPointTakePoint.yml | 2 +- .../bringCommaToStartOfPointTakePoint.yml | 2 +- .../bringHarpAfterWhaleTakeWhale.yml | 2 +- ...ndPointToEndOfThisAndEndOfWhaleTakeWhale.yml | 2 +- ...rpAndPointToThisAndStartOfWhaleTakeWhale.yml | 2 +- .../bringHarpBeforeWhaleTakeWhale.yml | 2 +- .../navigationMap/bringHarpTakeWhale.yml | 2 +- .../bringHarpToEndOfPointTakePoint.yml | 2 +- .../bringHarpToStartOfPointTakePoint.yml | 2 +- .../bringHarpToStartOfWhaleTakeWhale.yml | 2 +- .../bringPointAfterFirstCarWhaleTakeWhale.yml | 2 +- ...ndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml | 2 +- ...ringPointAndHarpToEndOfThisAndEndOfWhale.yml | 2 +- ...AndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml | 2 +- ...OfSecondCarWhaleAndStartOfWhaleTakeWhale.yml | 2 +- ...intAndHarpToThisAndStartOfWhaleTakeWhale.yml | 2 +- ...ndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml | 2 +- ...OfSecondCarWhaleAndStartOfWhaleTakeWhale.yml | 2 +- .../bringPointToEndOfWhaleTakeWhale.yml | 2 +- .../bringPointToStartOfWhaleTakeWhale.yml | 2 +- .../bringPointToThirdCarWhaleTakeWhale.yml | 2 +- .../chuckFirstTwoCarWhaleTakeWhale.yml | 2 +- ...ckFourthCarWhalePastThirdCarAirTakeWhale.yml | 2 +- .../navigationMap/chuckHarpPastAirTakeWhale.yml | 2 +- .../chuckLastTwoCarWhaleTakeWhale.yml | 2 +- .../chuckSecondPastThirdCarWhaleTakeWhale.yml | 2 +- ...kThirdCarHarpPastSecondCarWhaleTakeWhale.yml | 2 +- ...pPastSecondCarWhaleToEndOfWhaleTakeWhale.yml | 2 +- src/testUtil/TestCase.ts | 13 +++++++------ 31 files changed, 52 insertions(+), 36 deletions(-) diff --git a/src/scripts/transformRecordedTests.ts b/src/scripts/transformRecordedTests.ts index 7c87f1cac8..5aea10a01f 100644 --- a/src/scripts/transformRecordedTests.ts +++ b/src/scripts/transformRecordedTests.ts @@ -13,7 +13,9 @@ import canonicalizeActionName from "../util/canonicalizeActionName"; * The transformation to run on all recorded test fixtures. Change this * variable to do a custom bulk transformation. */ -const FIXTURE_TRANSFORMATION = identity; +const FIXTURE_TRANSFORMATION: ( + originalFixture: TestCaseFixture +) => TestCaseFixture = identity; async function main() { const directory = path.join( @@ -44,4 +46,17 @@ function canonicalizeActionNames(fixture: TestCaseFixture) { return update(fixture, { command: { actionName: canonicalizeActionName } }); } +function reorderFields(fixture: TestCaseFixture) { + return { + spokenForm: fixture.spokenForm, + languageId: fixture.languageId, + command: fixture.command, + marksToCheck: fixture.marksToCheck, + initialState: fixture.initialState, + finalState: fixture.finalState, + returnValue: fixture.returnValue, + fullTargets: fixture.fullTargets, + }; +} + main(); diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml index d60e0caae7..937bd26405 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringAirToThirdCarWhaleTakeWhale.yml @@ -10,6 +10,7 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 20} active: {line: 0, character: 28} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml index 3817dba8e3..c48fc74c3c 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToEndOfPointTakePoint.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: .} extraArgs: [] +marksToCheck: [default..] initialState: documentContents: " . , hello" selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 4} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ','}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml index 4d377f6588..eca69672ca 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringCommaToStartOfPointTakePoint.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: .} extraArgs: [] +marksToCheck: [default..] initialState: documentContents: " . , hello" selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 4} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ','}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml index 38030e97d8..abbfd69cc1 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAfterWhaleTakeWhale.yml @@ -9,6 +9,7 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: w} position: after extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world selections: @@ -40,4 +41,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml index 915fad9479..8f37bffdf4 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToEndOfThisAndEndOfWhaleTakeWhale.yml @@ -20,6 +20,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -61,4 +62,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml index 483a2485c2..d49098c787 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpAndPointToThisAndStartOfWhaleTakeWhale.yml @@ -18,6 +18,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -59,4 +60,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml index d453d97d13..6bce8c707f 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpBeforeWhaleTakeWhale.yml @@ -9,6 +9,7 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: w} position: before extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -40,4 +41,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: null, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml index c6b9f49bc2..194c9e8863 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpTakeWhale.yml @@ -12,6 +12,7 @@ command: modifier: {type: identity} insideOutsideType: inside extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world selections: @@ -43,4 +44,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml index e0e3e41759..8271800bdc 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToEndOfPointTakePoint.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: .} extraArgs: [] +marksToCheck: [default..] initialState: documentContents: " . , hello" selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 10} active: {line: 0, character: 15} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml index d5d57a21ab..2484d054e2 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfPointTakePoint.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: .} extraArgs: [] +marksToCheck: [default..] initialState: documentContents: " . , hello" selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 10} active: {line: 0, character: 15} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default..] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml index 9606a5fbf9..fc74728dbe 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringHarpToStartOfWhaleTakeWhale.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml index e558262b85..c91dc9cc19 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAfterFirstCarWhaleTakeWhale.yml @@ -11,6 +11,7 @@ command: mark: {type: decoratedSymbol, symbolColor: default, character: w} position: after extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -42,4 +43,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 0, excludeAnchor: false, excludeActive: false}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml index 402a59d6ec..b7cdefaaec 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml @@ -22,6 +22,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -63,4 +64,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml index e8500fe087..07481657de 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhale.yml @@ -20,6 +20,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -61,4 +62,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml index 4618cb7932..097d18db61 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToEndOfThisAndEndOfWhaleTakeWhale.yml @@ -20,6 +20,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -61,4 +62,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml index ecf8baa0d2..86c0c32271 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml @@ -24,6 +24,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -65,4 +66,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml index 64c973fa28..1fc693d2ef 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndHarpToThisAndStartOfWhaleTakeWhale.yml @@ -18,6 +18,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -59,4 +60,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 5} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml index 2e06ac406a..474e355a75 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToEndOfSecondCarWhaleAndEndOfWhaleTakeWhale.yml @@ -22,6 +22,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -55,4 +56,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml index 6e7993c35a..b9817d01c9 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointAndPointToStartOfSecondCarWhaleAndStartOfWhaleTakeWhale.yml @@ -24,6 +24,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world selections: @@ -57,4 +58,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}]}, {type: list, elements: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}]}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml index eb0897ce37..d488b6f9c2 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToEndOfWhaleTakeWhale.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml index 038e8b6971..7bfc932e76 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToStartOfWhaleTakeWhale.yml @@ -10,6 +10,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: before, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml index 712aa075bd..23a0c5c3ee 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/bringPointToThirdCarWhaleTakeWhale.yml @@ -10,6 +10,7 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -41,4 +42,3 @@ finalState: - anchor: {line: 0, character: 5} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: .}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml index f99f6fbf31..3737d8dffc 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckFirstTwoCarWhaleTakeWhale.yml @@ -8,6 +8,7 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world selections: @@ -30,4 +31,3 @@ finalState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 0, active: 1}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml index 60e22d16a1..9e79b55e4c 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckFourthCarWhalePastThirdCarAirTakeWhale.yml @@ -17,6 +17,7 @@ command: excludeStart: false excludeEnd: false extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world whatever selections: @@ -45,4 +46,3 @@ finalState: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml index d4615de806..a57c75a739 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckHarpPastAirTakeWhale.yml @@ -13,6 +13,7 @@ command: excludeStart: false excludeEnd: false extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world whatever selections: @@ -47,4 +48,3 @@ finalState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: identity}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: identity}}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml index 535ab71c4c..63e6219c12 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckLastTwoCarWhaleTakeWhale.yml @@ -8,6 +8,7 @@ command: modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -30,4 +31,3 @@ finalState: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: -2, active: -1}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml index 9d1d391ff7..5111678d47 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckSecondPastThirdCarWhaleTakeWhale.yml @@ -8,6 +8,7 @@ command: modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false} mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello. world whatever selections: @@ -30,4 +31,3 @@ finalState: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 2, excludeAnchor: false, excludeActive: false}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml index 049687d99e..a9e6f8a4c6 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/chuckThirdCarHarpPastSecondCarWhaleTakeWhale.yml @@ -17,6 +17,7 @@ command: excludeStart: false excludeEnd: false extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world whatever selections: @@ -45,4 +46,3 @@ finalState: - anchor: {line: 0, character: 2} active: {line: 0, character: 2} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 2, active: 2, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}] -marksToCheck: [default.w] diff --git a/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml b/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml index 2ea91a2ca8..e3ab2821c6 100644 --- a/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml +++ b/src/test/suite/fixtures/recorded/navigationMap/moveFourthCarHarpPastSecondCarWhaleToEndOfWhaleTakeWhale.yml @@ -21,6 +21,7 @@ command: insideOutsideType: inside mark: {type: decoratedSymbol, symbolColor: default, character: w} extraArgs: [] +marksToCheck: [default.w] initialState: documentContents: hello world whatever selections: @@ -52,4 +53,3 @@ finalState: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} fullTargets: [{type: range, excludeAnchor: false, excludeActive: false, anchor: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: h}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 3, active: 3, excludeAnchor: false, excludeActive: false}}, active: {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: subpiece, pieceType: character, anchor: 1, active: 1, excludeAnchor: false, excludeActive: false}}}, {type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: w}, selectionType: token, position: after, insideOutsideType: inside, modifier: {type: identity}}] -marksToCheck: [default.w] diff --git a/src/testUtil/TestCase.ts b/src/testUtil/TestCase.ts index 91219f6f88..5bbe0d169c 100644 --- a/src/testUtil/TestCase.ts +++ b/src/testUtil/TestCase.ts @@ -29,16 +29,17 @@ export type TestCaseFixture = { spokenForm: string; command: TestCaseCommand; languageId: string; - initialState: TestCaseSnapshot; - finalState: TestCaseSnapshot; - returnValue: unknown; - /** Inferred full targets added for context; not currently used in testing */ - fullTargets: Target[]; /** * A list of marks to check in the case of navigation map test otherwise undefined */ marksToCheck?: string[]; + + initialState: TestCaseSnapshot; + finalState: TestCaseSnapshot; + returnValue: unknown; + /** Inferred full targets added for context; not currently used in testing */ + fullTargets: Target[]; }; export class TestCase { @@ -136,11 +137,11 @@ export class TestCase { spokenForm: this.spokenForm, languageId: this.languageId, command: this.command, + marksToCheck: this.marksToCheck, initialState: this.initialState, finalState: this.finalState, returnValue: this.returnValue, fullTargets: this.fullTargets, - marksToCheck: this.marksToCheck, }; return serialize(fixture); }