From 20b07c1b7979d95ac8692de8ed51339536536e80 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 3 Sep 2026 20:05:14 +0200 Subject: [PATCH 1/3] added setting to persist hat map to recorded test fixtures --- .../app-vscode/src/constructTestHelpers.ts | 3 + .../app-web-docs/src/docs/components/Code.css | 27 +++++++- .../components/RecordedTestVisualizer.tsx | 63 ++++--------------- .../src/testUtil/TestCaseSnapshot.ts | 2 + .../src/testUtil/getSnapshotForComparison.ts | 4 ++ packages/lib-common/src/types/HatTokenMap.ts | 2 + packages/lib-common/src/types/TestHelpers.ts | 3 +- packages/lib-common/src/util/toPlainObject.ts | 18 ++++++ .../lib-engine/src/core/IndividualHatMap.ts | 5 ++ .../disabledComponents/DisabledHatTokenMap.ts | 3 + .../src/RecordTestCaseCommandOptions.ts | 5 ++ .../lib-test-case-recorder/src/TestCase.ts | 4 ++ .../src/TestCaseRecorder.ts | 14 +++++ .../src/takeSnapshot.ts | 7 +++ .../recorded/docs/actions/moveToTarget2.yml | 2 + resources/fixtures/recorded/docs/config.json | 3 + 16 files changed, 112 insertions(+), 53 deletions(-) create mode 100644 resources/fixtures/recorded/docs/config.json diff --git a/packages/app-vscode/src/constructTestHelpers.ts b/packages/app-vscode/src/constructTestHelpers.ts index e2e8280576..0a7e29f52f 100644 --- a/packages/app-vscode/src/constructTestHelpers.ts +++ b/packages/app-vscode/src/constructTestHelpers.ts @@ -6,6 +6,7 @@ import type { HatTokenMap, IDE, NormalizedIDE, + ReadOnlyHatMap, ScopeProvider, SerializedMarks, StoredTargetKey, @@ -64,6 +65,7 @@ export function constructTestHelpers( editor: TextEditor, ide: IDE, marks: SerializedMarks | undefined, + hatTokenMap: ReadOnlyHatMap | undefined, ): Promise { return takeSnapshot( storedTargets, @@ -72,6 +74,7 @@ export function constructTestHelpers( editor, ide, marks, + hatTokenMap, undefined, undefined, ); diff --git a/packages/app-web-docs/src/docs/components/Code.css b/packages/app-web-docs/src/docs/components/Code.css index 1dc13f277d..cb5ea84479 100644 --- a/packages/app-web-docs/src/docs/components/Code.css +++ b/packages/app-web-docs/src/docs/components/Code.css @@ -125,7 +125,7 @@ position: relative; } -.code-hat-default::before { +.code-hat::before { content: ""; position: absolute; top: 0.15em; @@ -133,7 +133,30 @@ width: 0.3em; height: 0.3em; border-radius: 50%; - background-color: #b9b6cd; transform: translate(-50%, -100%); pointer-events: none; } + +.code-hat-default::before { + background-color: #b9b6cd; +} + +.code-hat-blue::before { + background-color: #089ad3; +} + +.code-hat-green::before { + background-color: #36b33f; +} + +.code-hat-red::before { + background-color: #e02d28; +} + +.code-hat-pink::before { + background-color: #e06caa; +} + +.code-hat-yellow::before { + background-color: #e5c02c; +} diff --git a/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx b/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx index 9937d27e0e..bce4bde072 100644 --- a/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx +++ b/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx @@ -4,10 +4,9 @@ import { createContext, useContext, useMemo, useState } from "react"; import type { DecorationItem } from "shiki"; import type { SelectionPlainObject, - SerializedMarks, TestCaseSnapshot, } from "@cursorless/lib-common"; -import { plainObjectToSelection, splitKey } from "@cursorless/lib-common"; +import { plainObjectToSelection } from "@cursorless/lib-common"; import { Code } from "./Code"; import type { RecordedTest } from "./types"; @@ -139,11 +138,8 @@ function CodeState({ state, }: CodeStateProps): JSX.Element { const decorations = useMemo( - () => [ - ...state.selections.map(toDecoration), - ...toMarkDecorations(state.marks, state.documentContents), - ], - [state.selections, state.marks, state.documentContents], + () => [...state.selections.map(toDecoration), ...toHatDecorations(state)], + [state], ); return ( <> @@ -187,52 +183,19 @@ function toDecoration(plainSelection: SelectionPlainObject): DecorationItem { }; } -/** - * Converts serialized token marks to Shiki decorations around the first - * occurrence of each mark's decorated character within its token. - */ -function toMarkDecorations( - marks: SerializedMarks | undefined, - documentContents: string, -): DecorationItem[] { - if (marks == null) { +function toHatDecorations(state: TestCaseSnapshot): DecorationItem[] { + if (state.hatTokenMap == null) { return []; } - const lines = documentContents.split(/\r?\n/u); - - return Object.entries(marks).map(([key, range]) => { - if (range.start.line !== range.end.line) { - throw new Error(`Mark ${key} spans multiple lines`); - } - - const line = lines[range.start.line]; - - if (line == null) { - throw new Error(`Mark ${key} is outside the document`); - } - - const { hatStyle, character } = splitKey(key); - const tokenText = line.slice(range.start.character, range.end.character); - const characterOffset = tokenText.indexOf(character); - const characterStart = range.start.character + characterOffset; - - if (characterOffset === -1) { - throw new Error(`Mark ${key} does not occur in its token`); - } - - return { - start: { line: range.start.line, character: characterStart }, - end: { - line: range.start.line, - character: characterStart + character.length, - }, - alwaysWrap: true, - properties: { - className: ["code-hat", `code-hat-${hatStyle}`], - }, - }; - }); + return state.hatTokenMap.map(({ hatStyle, hatRange }) => ({ + start: hatRange.start, + end: hatRange.end, + alwaysWrap: true, + properties: { + className: ["code-hat", `code-hat-${hatStyle}`], + }, + })); } function useRecordedTestVisualizer(): RecordedTestVisualizerContextValue { diff --git a/packages/lib-common/src/testUtil/TestCaseSnapshot.ts b/packages/lib-common/src/testUtil/TestCaseSnapshot.ts index 07ea134248..47b538c15d 100644 --- a/packages/lib-common/src/testUtil/TestCaseSnapshot.ts +++ b/packages/lib-common/src/testUtil/TestCaseSnapshot.ts @@ -3,6 +3,7 @@ import type { RangePlainObject, SelectionPlainObject, SerializedMarks, + SimpleTokenHat, TargetPlainObject, } from "../util/toPlainObject"; @@ -18,6 +19,7 @@ export interface TestCaseSnapshot extends MarkKeys { // https://github.com/cursorless-dev/cursorless/issues/160 visibleRanges?: RangePlainObject[]; marks?: SerializedMarks; + hatTokenMap?: SimpleTokenHat[]; timeOffsetSeconds?: number; /** diff --git a/packages/lib-common/src/testUtil/getSnapshotForComparison.ts b/packages/lib-common/src/testUtil/getSnapshotForComparison.ts index ac5d5d1c5a..97737a06d5 100644 --- a/packages/lib-common/src/testUtil/getSnapshotForComparison.ts +++ b/packages/lib-common/src/testUtil/getSnapshotForComparison.ts @@ -36,6 +36,9 @@ export async function getSnapshotForComparison( extractTargetedMarks(Object.keys(finalState.marks), readableHatMap), ); + const hatTokenMap = + finalState?.hatTokenMap != null ? readableHatMap : undefined; + if (finalState?.clipboard == null) { excludeFields.push("clipboard"); } @@ -61,6 +64,7 @@ export async function getSnapshotForComparison( editor, spyIde, marks, + hatTokenMap, ); return resultState; diff --git a/packages/lib-common/src/types/HatTokenMap.ts b/packages/lib-common/src/types/HatTokenMap.ts index d3660c53e9..9b51885b27 100644 --- a/packages/lib-common/src/types/HatTokenMap.ts +++ b/packages/lib-common/src/types/HatTokenMap.ts @@ -18,6 +18,8 @@ export interface TokenHat { } export interface ReadOnlyHatMap { + /** Returns the complete read-only hat assignments in this map. */ + getTokenHats(): readonly Readonly[]; getEntries(): readonly [string, Token][]; getToken(hatStyle: HatStyleName, character: string): Token | undefined; } diff --git a/packages/lib-common/src/types/TestHelpers.ts b/packages/lib-common/src/types/TestHelpers.ts index 97e3a38b1f..fce3abd091 100644 --- a/packages/lib-common/src/types/TestHelpers.ts +++ b/packages/lib-common/src/types/TestHelpers.ts @@ -6,7 +6,7 @@ import type { TestCaseSnapshot, } from "../testUtil/TestCaseSnapshot"; import type { SerializedMarks, TargetPlainObject } from "../util/toPlainObject"; -import type { HatTokenMap } from "./HatTokenMap"; +import type { HatTokenMap, ReadOnlyHatMap } from "./HatTokenMap"; import type { TextEditor } from "./TextEditor"; export interface TestHelpers { @@ -20,6 +20,7 @@ export interface TestHelpers { editor: TextEditor, ide: IDE, marks: SerializedMarks | undefined, + hatTokenMap: ReadOnlyHatMap | undefined, ): Promise; setStoredTarget( diff --git a/packages/lib-common/src/util/toPlainObject.ts b/packages/lib-common/src/util/toPlainObject.ts index 41f3793d17..013624623b 100644 --- a/packages/lib-common/src/util/toPlainObject.ts +++ b/packages/lib-common/src/util/toPlainObject.ts @@ -1,10 +1,12 @@ import type { FlashStyle } from "../ide/types/FlashDescriptor"; +import type { HatStyleName } from "../ide/types/hatStyles.types"; import type { CharacterRange, GeneralizedRange, LineRange, } from "../types/GeneralizedRange"; import { isLineRange } from "../types/GeneralizedRange"; +import type { ReadOnlyHatMap } from "../types/HatTokenMap"; import type { Selection } from "../types/Selection"; import type { Token } from "../types/Token"; @@ -92,6 +94,12 @@ interface SimpleRange { end: SimplePosition; } +export interface SimpleTokenHat { + hatStyle: HatStyleName; + grapheme: string; + hatRange: SimpleRange; +} + export function rangeToPlainObject(range: SimpleRange): RangePlainObject { return { start: positionToPlainObject(range.start), @@ -140,3 +148,13 @@ export function characterRangeToPlainObject( end: positionToPlainObject(range.end), }; } + +export function tokenHatToPlainObject( + hatMap: ReadOnlyHatMap, +): SimpleTokenHat[] { + return hatMap.getTokenHats().map((hat) => ({ + hatStyle: hat.hatStyle, + grapheme: hat.grapheme, + hatRange: rangeToPlainObject(hat.hatRange), + })); +} diff --git a/packages/lib-engine/src/core/IndividualHatMap.ts b/packages/lib-engine/src/core/IndividualHatMap.ts index daa3eda0cd..d967b998ff 100644 --- a/packages/lib-engine/src/core/IndividualHatMap.ts +++ b/packages/lib-engine/src/core/IndividualHatMap.ts @@ -33,6 +33,11 @@ export class IndividualHatMap implements ReadOnlyHatMap { return this._tokenHats; } + getTokenHats(): readonly Readonly[] { + this.checkExpired(); + return this._tokenHats; + } + constructor( private ide: IDE, private tokenGraphemeSplitter: TokenGraphemeSplitter, diff --git a/packages/lib-engine/src/disabledComponents/DisabledHatTokenMap.ts b/packages/lib-engine/src/disabledComponents/DisabledHatTokenMap.ts index 66ac5799bc..f91666916e 100644 --- a/packages/lib-engine/src/disabledComponents/DisabledHatTokenMap.ts +++ b/packages/lib-engine/src/disabledComponents/DisabledHatTokenMap.ts @@ -7,6 +7,9 @@ export class DisabledHatTokenMap implements HatTokenMap { getReadableMap() { return Promise.resolve({ + getTokenHats() { + return []; + }, getEntries() { return []; }, diff --git a/packages/lib-test-case-recorder/src/RecordTestCaseCommandOptions.ts b/packages/lib-test-case-recorder/src/RecordTestCaseCommandOptions.ts index 48b0c66485..c68b265057 100644 --- a/packages/lib-test-case-recorder/src/RecordTestCaseCommandOptions.ts +++ b/packages/lib-test-case-recorder/src/RecordTestCaseCommandOptions.ts @@ -49,4 +49,9 @@ export interface RecordTestCaseCommandOptions { * Whether to capture the `that` mark returned by the action. */ captureFinalThatMark?: boolean; + + /** + * Whether to capture the hat token map in the test case snapshot. + */ + captureHatTokenMap?: boolean; } diff --git a/packages/lib-test-case-recorder/src/TestCase.ts b/packages/lib-test-case-recorder/src/TestCase.ts index 8cc38efe72..66f1979211 100644 --- a/packages/lib-test-case-recorder/src/TestCase.ts +++ b/packages/lib-test-case-recorder/src/TestCase.ts @@ -55,6 +55,7 @@ export class TestCase { private isDecorationsTest: boolean, private startTimestamp: bigint, private captureFinalThatMark: boolean, + private captureHatTokenMap: boolean, private extraSnapshotFields?: ExtraSnapshotField[], public readonly spokenFormError?: string, ) { @@ -169,7 +170,9 @@ export class TestCase { this.spyIde.activeTextEditor!, this.spyIde, this.getMarks(), + this.captureHatTokenMap ? this.hatTokenMap : undefined, { startTimestamp: this.startTimestamp }, + undefined, ); } @@ -190,6 +193,7 @@ export class TestCase { this.spyIde.activeTextEditor!, this.spyIde, this.isHatTokenMapTest ? this.getMarks() : undefined, + this.captureHatTokenMap ? this.hatTokenMap : undefined, { startTimestamp: this.startTimestamp }, ); this.recordSpyIdeValues(); diff --git a/packages/lib-test-case-recorder/src/TestCaseRecorder.ts b/packages/lib-test-case-recorder/src/TestCaseRecorder.ts index 0e4ab674ba..b6a3131f5a 100644 --- a/packages/lib-test-case-recorder/src/TestCaseRecorder.ts +++ b/packages/lib-test-case-recorder/src/TestCaseRecorder.ts @@ -66,6 +66,7 @@ export class TestCaseRecorder { /** We use this variable to capture editor settings and then restore them */ private originalTextEditorOptions: TextEditorOptions = {}; private captureFinalThatMark: boolean = false; + private captureHatTokenMap: boolean = false; private spyIde: SpyIDE | undefined; private originalIde: IDE | undefined; private spokenFormGenerator = new SpokenFormGenerator(defaultSpokenFormMap); @@ -135,6 +136,8 @@ export class TestCaseRecorder { usePrePhraseSnapshot: boolean, ) { let marks: SerializedMarks | undefined; + let hatTokenMap: ReadOnlyHatMap | undefined; + if (targetedMarks.length > 0) { const keys = targetedMarks.map(({ character, symbolColor }) => getKey(symbolColor, character), @@ -142,8 +145,15 @@ export class TestCaseRecorder { const readableHatMap = await this.hatTokenMap.getReadableMap(usePrePhraseSnapshot); marks = marksToPlainObject(extractTargetedMarks(keys, readableHatMap)); + if (this.captureHatTokenMap) { + hatTokenMap = readableHatMap; + } } else { marks = undefined; + if (this.captureHatTokenMap) { + hatTokenMap = + await this.hatTokenMap.getReadableMap(usePrePhraseSnapshot); + } } const snapshot = await takeSnapshot( @@ -153,6 +163,7 @@ export class TestCaseRecorder { this.ide.activeTextEditor!, this.ide, marks, + hatTokenMap, this.active ? { startTimestamp: this.startTimestamp } : undefined, metadata, ); @@ -215,6 +226,7 @@ export class TestCaseRecorder { showCalibrationDisplay = false, recordErrors: isErrorTest = false, captureFinalThatMark = false, + captureHatTokenMap = false, } = config; this.active = true; @@ -224,6 +236,7 @@ export class TestCaseRecorder { ); this.isHatTokenMapTest = isHatTokenMapTest; this.captureFinalThatMark = captureFinalThatMark; + this.captureHatTokenMap = captureHatTokenMap; this.isDecorationsTest = isDecorationsTest; this.isSilent = isSilent; this.extraSnapshotFields = extraSnapshotFields; @@ -319,6 +332,7 @@ export class TestCaseRecorder { this.isDecorationsTest, this.startTimestamp!, this.captureFinalThatMark, + this.captureHatTokenMap, this.extraSnapshotFields, spokenForm.type === "error" ? spokenForm.reason : undefined, ); diff --git a/packages/lib-test-case-recorder/src/takeSnapshot.ts b/packages/lib-test-case-recorder/src/takeSnapshot.ts index ea928af60b..3f6b009775 100644 --- a/packages/lib-test-case-recorder/src/takeSnapshot.ts +++ b/packages/lib-test-case-recorder/src/takeSnapshot.ts @@ -3,6 +3,7 @@ import type { ExtraContext, ExtraSnapshotField, IDE, + ReadOnlyHatMap, SerializedMarks, TestCaseSnapshot, TextEditor, @@ -11,6 +12,7 @@ import { rangeToPlainObject, selectionToPlainObject, storedTargetKeys, + tokenHatToPlainObject, } from "@cursorless/lib-common"; import type { StoredTargetMap } from "@cursorless/lib-engine"; import { hrtimeBigintToSeconds } from "./timeUtils"; @@ -22,6 +24,7 @@ export async function takeSnapshot( editor: TextEditor, ide: IDE, marks?: SerializedMarks, + hatTokenMap?: ReadOnlyHatMap, extraContext?: ExtraContext, metadata?: unknown, ) { @@ -34,6 +37,10 @@ export async function takeSnapshot( snapshot.marks = marks; } + if (hatTokenMap != null) { + snapshot.hatTokenMap = tokenHatToPlainObject(hatTokenMap); + } + if (metadata != null) { snapshot.metadata = metadata; } diff --git a/resources/fixtures/recorded/docs/actions/moveToTarget2.yml b/resources/fixtures/recorded/docs/actions/moveToTarget2.yml index e5f6a497b6..c6091d32ba 100644 --- a/resources/fixtures/recorded/docs/actions/moveToTarget2.yml +++ b/resources/fixtures/recorded/docs/actions/moveToTarget2.yml @@ -26,8 +26,10 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: [] finalState: documentContents: // aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: [] diff --git a/resources/fixtures/recorded/docs/config.json b/resources/fixtures/recorded/docs/config.json new file mode 100644 index 0000000000..cbbb7bf962 --- /dev/null +++ b/resources/fixtures/recorded/docs/config.json @@ -0,0 +1,3 @@ +{ + "captureHatTokenMap": true +} From 22adfeeb91293bc8ece715ddaf49db457de91624 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 4 Sep 2026 02:18:07 +0200 Subject: [PATCH 2/3] Add hat token map to docs tests --- .../src/testUtil/getSnapshotForComparison.ts | 17 +- packages/lib-common/src/types/HatTokenMap.ts | 4 +- packages/lib-common/src/util/toPlainObject.ts | 10 +- packages/lib-engine/src/core/HatAllocator.ts | 2 +- .../lib-engine/src/core/IndividualHatMap.ts | 11 +- .../lib-node-common/src/runRecordedTest.ts | 29 +++- .../lib-test-case-recorder/src/TestCase.ts | 14 +- .../src/TestCaseRecorder.ts | 9 +- .../src/takeSnapshot.ts | 4 +- .../suite/tutorial/tutorial.vscode.test.ts | 5 +- .../src/renderRecordedTestVisualizer.ts | 7 + .../recorded/docs/actions/addSelection.yml | 32 ++++ .../docs/actions/addSelectionAfter.yml | 32 ++++ .../docs/actions/addSelectionBefore.yml | 32 ++++ .../recorded/docs/actions/applyFormatter.yml | 22 +++ .../recorded/docs/actions/applyFormatter2.yml | 22 +++ .../recorded/docs/actions/applyFormatter3.yml | 17 ++ .../recorded/docs/actions/breakLine.yml | 32 ++++ .../recorded/docs/actions/callAsFunction.yml | 47 ++++++ .../recorded/docs/actions/callAsFunction2.yml | 47 ++++++ .../recorded/docs/actions/callAsFunction3.yml | 47 ++++++ .../docs/actions/clearAndSetSelection.yml | 27 ++++ .../recorded/docs/actions/copyToClipboard.yml | 22 +++ .../recorded/docs/actions/cutToClipboard.yml | 12 ++ .../recorded/docs/actions/decrement.yml | 32 ++++ .../recorded/docs/actions/decrement2.yml | 32 ++++ .../recorded/docs/actions/decrement3.yml | 32 ++++ .../recorded/docs/actions/deselect.yml | 32 ++++ .../docs/actions/editNewLineAfter.yml | 32 ++++ .../docs/actions/editNewLineAfter2.yml | 32 ++++ .../docs/actions/editNewLineBefore.yml | 32 ++++ .../docs/actions/editNewLineBefore2.yml | 32 ++++ .../recorded/docs/actions/increment.yml | 32 ++++ .../recorded/docs/actions/increment2.yml | 32 ++++ .../recorded/docs/actions/increment3.yml | 32 ++++ .../recorded/docs/actions/indentLine.yml | 32 ++++ .../recorded/docs/actions/insertCopyAfter.yml | 47 ++++++ .../docs/actions/insertCopyAfter2.yml | 37 +++++ .../docs/actions/insertCopyBefore.yml | 47 ++++++ .../docs/actions/insertCopyBefore2.yml | 37 +++++ .../docs/actions/insertEmptyLineAfter.yml | 32 ++++ .../docs/actions/insertEmptyLineAfter2.yml | 32 ++++ .../docs/actions/insertEmptyLineBefore.yml | 32 ++++ .../docs/actions/insertEmptyLineBefore2.yml | 32 ++++ .../docs/actions/insertEmptyLinesAround.yml | 32 ++++ .../docs/actions/insertEmptyLinesAround2.yml | 32 ++++ .../recorded/docs/actions/insertSnippet.yml | 77 +++++++++ .../recorded/docs/actions/joinLines.yml | 32 ++++ .../recorded/docs/actions/moveToTarget.yml | 32 ++++ .../recorded/docs/actions/moveToTarget2.yml | 29 +++- .../recorded/docs/actions/moveToTarget3.yml | 32 ++++ .../recorded/docs/actions/moveToTarget4.yml | 32 ++++ .../recorded/docs/actions/moveToTarget5.yml | 42 +++++ .../recorded/docs/actions/nextHomophone.yml | 22 +++ .../recorded/docs/actions/nextHomophone2.yml | 22 +++ .../recorded/docs/actions/outdentLine.yml | 32 ++++ .../docs/actions/pasteFromClipboard.yml | 32 ++++ .../docs/actions/pasteFromClipboard2.yml | 37 +++++ .../docs/actions/pasteFromClipboard3.yml | 37 +++++ .../docs/actions/randomizeTargets.yml | 2 + .../fixtures/recorded/docs/actions/remove.yml | 27 ++++ .../docs/actions/replaceWithTarget.yml | 37 +++++ .../docs/actions/replaceWithTarget2.yml | 32 ++++ .../docs/actions/replaceWithTarget3.yml | 37 +++++ .../docs/actions/replaceWithTarget4.yml | 37 +++++ .../docs/actions/replaceWithTarget5.yml | 42 +++++ .../docs/actions/replaceWithTarget6.yml | 52 ++++++ .../recorded/docs/actions/reverseTargets.yml | 72 +++++++++ .../actions/rewrapWithPairedDelimiter.yml | 52 ++++++ .../recorded/docs/actions/setSelection.yml | 32 ++++ .../docs/actions/setSelectionAfter.yml | 32 ++++ .../docs/actions/setSelectionBefore.yml | 32 ++++ .../recorded/docs/actions/sortTargets.yml | 72 +++++++++ .../recorded/docs/actions/swapTargets.yml | 32 ++++ .../recorded/docs/actions/swapTargets2.yml | 52 ++++++ .../docs/actions/toggleLineComment.yml | 27 ++++ .../docs/actions/toggleLineComment2.yml | 27 ++++ .../docs/actions/wrapWithPairedDelimiter.yml | 42 +++++ .../docs/actions/wrapWithPairedDelimiter2.yml | 77 +++++++++ .../recorded/docs/modifiers/ancestor.yml | 152 ++++++++++++++++++ .../recorded/docs/modifiers/ancestor2.yml | 152 ++++++++++++++++++ .../docs/modifiers/containingScope.yml | 32 ++++ .../recorded/docs/modifiers/endOf.yml | 32 ++++ .../recorded/docs/modifiers/everyScope.yml | 72 +++++++++ .../docs/modifiers/excludeInterior.yml | 72 +++++++++ .../docs/modifiers/excludeInterior2.yml | 22 +++ .../docs/modifiers/extendThroughEndOf.yml | 32 ++++ .../docs/modifiers/extendThroughStartOf.yml | 32 ++++ .../docs/modifiers/inferPreviousMark.yml | 52 ++++++ .../docs/modifiers/inferPreviousMark2.yml | 32 ++++ .../docs/modifiers/inferPreviousMark3.yml | 52 ++++++ .../recorded/docs/modifiers/interiorOnly.yml | 72 +++++++++ .../docs/modifiers/keepContentFilter.yml | 42 +++++ .../docs/modifiers/keepEmptyFilter.yml | 42 +++++ .../recorded/docs/modifiers/leading.yml | 32 ++++ .../recorded/docs/modifiers/leading2.yml | 72 +++++++++ .../recorded/docs/modifiers/ordinalScope.yml | 72 +++++++++ .../recorded/docs/modifiers/ordinalScope2.yml | 72 +++++++++ .../recorded/docs/modifiers/ordinalScope3.yml | 72 +++++++++ .../recorded/docs/modifiers/ordinalScope4.yml | 72 +++++++++ .../recorded/docs/modifiers/ordinalScope5.yml | 72 +++++++++ .../recorded/docs/modifiers/ordinalScope6.yml | 72 +++++++++ .../recorded/docs/modifiers/relativeScope.yml | 72 +++++++++ .../docs/modifiers/relativeScope2.yml | 72 +++++++++ .../docs/modifiers/relativeScope3.yml | 72 +++++++++ .../docs/modifiers/relativeScope4.yml | 72 +++++++++ .../recorded/docs/modifiers/startOf.yml | 32 ++++ .../docs/modifiers/toRawSelection.yml | 27 ++++ .../recorded/docs/modifiers/trailing.yml | 32 ++++ .../recorded/docs/modifiers/trailing2.yml | 72 +++++++++ 110 files changed, 4367 insertions(+), 30 deletions(-) diff --git a/packages/lib-common/src/testUtil/getSnapshotForComparison.ts b/packages/lib-common/src/testUtil/getSnapshotForComparison.ts index 97737a06d5..7aa903a8bd 100644 --- a/packages/lib-common/src/testUtil/getSnapshotForComparison.ts +++ b/packages/lib-common/src/testUtil/getSnapshotForComparison.ts @@ -14,7 +14,8 @@ import type { * * @param finalState The final state of the test case; we only use this to * decide which fields we care about - * @param readableHatMap The hat map for extractin the marks + * @param initialHatTokenMap The hat map for extractin the marks + * @param getFinalHatTokenMap Gets the hat map after the command has run * @param spyIde The spy IDE * @param takeSnapshot A function that takes a snapshot of the current state of * the editor @@ -23,8 +24,9 @@ import type { */ export async function getSnapshotForComparison( finalState: TestCaseSnapshot | undefined, - readableHatMap: ReadOnlyHatMap, + initialHatTokenMap: ReadOnlyHatMap, spyIde: SpyIDE, + getFinalHatTokenMap: () => Promise, takeSnapshot: TestHelpers["takeSnapshot"], ): Promise> { const excludeFields: ExcludableSnapshotField[] = []; @@ -33,11 +35,14 @@ export async function getSnapshotForComparison( finalState?.marks == null ? undefined : marksToPlainObject( - extractTargetedMarks(Object.keys(finalState.marks), readableHatMap), + extractTargetedMarks( + Object.keys(finalState.marks), + initialHatTokenMap, + ), ); - const hatTokenMap = - finalState?.hatTokenMap != null ? readableHatMap : undefined; + const finalHatTokenMap = + finalState?.hatTokenMap == null ? undefined : await getFinalHatTokenMap(); if (finalState?.clipboard == null) { excludeFields.push("clipboard"); @@ -64,7 +69,7 @@ export async function getSnapshotForComparison( editor, spyIde, marks, - hatTokenMap, + finalHatTokenMap, ); return resultState; diff --git a/packages/lib-common/src/types/HatTokenMap.ts b/packages/lib-common/src/types/HatTokenMap.ts index 9b51885b27..8076a97922 100644 --- a/packages/lib-common/src/types/HatTokenMap.ts +++ b/packages/lib-common/src/types/HatTokenMap.ts @@ -1,5 +1,6 @@ import type { HatStyleName } from "../ide/types/hatStyles.types"; import type { Range } from "./Range"; +import type { TextEditor } from "./TextEditor"; import type { Token } from "./Token"; /** @@ -18,8 +19,7 @@ export interface TokenHat { } export interface ReadOnlyHatMap { - /** Returns the complete read-only hat assignments in this map. */ - getTokenHats(): readonly Readonly[]; + getTokenHats(editor: TextEditor): readonly Readonly[]; getEntries(): readonly [string, Token][]; getToken(hatStyle: HatStyleName, character: string): Token | undefined; } diff --git a/packages/lib-common/src/util/toPlainObject.ts b/packages/lib-common/src/util/toPlainObject.ts index 013624623b..b433158b72 100644 --- a/packages/lib-common/src/util/toPlainObject.ts +++ b/packages/lib-common/src/util/toPlainObject.ts @@ -6,7 +6,7 @@ import type { LineRange, } from "../types/GeneralizedRange"; import { isLineRange } from "../types/GeneralizedRange"; -import type { ReadOnlyHatMap } from "../types/HatTokenMap"; +import type { TokenHat } from "../types/HatTokenMap"; import type { Selection } from "../types/Selection"; import type { Token } from "../types/Token"; @@ -149,12 +149,10 @@ export function characterRangeToPlainObject( }; } -export function tokenHatToPlainObject( - hatMap: ReadOnlyHatMap, -): SimpleTokenHat[] { - return hatMap.getTokenHats().map((hat) => ({ +export function tokenHatToPlainObject(hat: TokenHat): SimpleTokenHat { + return { hatStyle: hat.hatStyle, grapheme: hat.grapheme, hatRange: rangeToPlainObject(hat.hatRange), - })); + }; } diff --git a/packages/lib-engine/src/core/HatAllocator.ts b/packages/lib-engine/src/core/HatAllocator.ts index 3a2afbdad5..38b564ff3e 100644 --- a/packages/lib-engine/src/core/HatAllocator.ts +++ b/packages/lib-engine/src/core/HatAllocator.ts @@ -70,7 +70,7 @@ export class HatAllocator { tokenGraphemeSplitter: this.tokenGraphemeSplitter, enabledHatStyles: this.hats.enabledHatStyles, forceTokenHats: normalizedForceTokenHats, - oldTokenHats: activeMap.tokenHats, + oldTokenHats: activeMap.getStaleTokenHats(), hatStability: this.ide.configuration.getOwnConfiguration( "experimental.hatStability", ), diff --git a/packages/lib-engine/src/core/IndividualHatMap.ts b/packages/lib-engine/src/core/IndividualHatMap.ts index d967b998ff..1718fa7918 100644 --- a/packages/lib-engine/src/core/IndividualHatMap.ts +++ b/packages/lib-engine/src/core/IndividualHatMap.ts @@ -3,6 +3,7 @@ import type { IDE, ReadOnlyHatMap, TextDocument, + TextEditor, Token, TokenHat, } from "@cursorless/lib-common"; @@ -29,13 +30,17 @@ export class IndividualHatMap implements ReadOnlyHatMap { private _tokenHats: readonly TokenHat[] = []; - get tokenHats() { + /** + * Returns the previous allocation for use while computing its replacement. + * Unlike the read-only-map API, this internal accessor permits stale hats. + */ + getStaleTokenHats(): readonly TokenHat[] { return this._tokenHats; } - getTokenHats(): readonly Readonly[] { + getTokenHats(editor: TextEditor): readonly Readonly[] { this.checkExpired(); - return this._tokenHats; + return this._tokenHats.filter((hat) => hat.token.editor.isEqual(editor)); } constructor( diff --git a/packages/lib-node-common/src/runRecordedTest.ts b/packages/lib-node-common/src/runRecordedTest.ts index 2155cfe8b2..f385ba9c00 100644 --- a/packages/lib-node-common/src/runRecordedTest.ts +++ b/packages/lib-node-common/src/runRecordedTest.ts @@ -9,6 +9,7 @@ import type { ReadOnlyHatMap, SelectionPlainObject, SerializedMarks, + SimpleTokenHat, SpyIDE, TestCaseFixtureLegacy, TestHelpers, @@ -27,6 +28,7 @@ import { splitKey, spyIDERecordedValuesToPlainObject, storedTargetKeys, + tokenHatToPlainObject, } from "@cursorless/lib-common"; import { loadFixture } from "./loadFixture"; @@ -147,10 +149,12 @@ export async function runRecordedTest({ ), ); - const readableHatMap = await hatTokenMap.getReadableMap(usePrePhraseSnapshot); + const initialHatTokenMap = + await hatTokenMap.getReadableMap(usePrePhraseSnapshot); // Assert that recorded decorations are present - checkMarks(fixture.initialState.marks, readableHatMap); + checkMarks(fixture.initialState.marks, initialHatTokenMap); + checkHats(editor, fixture.initialState.hatTokenMap, initialHatTokenMap); let returnValue: unknown; let fallback: Fallback | undefined; @@ -199,10 +203,16 @@ export async function runRecordedTest({ await sleepWithBackoff(fixture.postCommandSleepTimeMs); } + const getFinalHatTokenMap = async () => { + await hatTokenMap.allocateHats(); + return hatTokenMap.getReadableMap(false); + }; + const resultState = await getSnapshotForComparison( fixture.finalState, - readableHatMap, + initialHatTokenMap, spyIde, + getFinalHatTokenMap, takeSnapshot, ); @@ -266,3 +276,16 @@ function checkMarks( assert.deepEqual(rangeToPlainObject(currentToken.range), token); } } + +function checkHats( + editor: TextEditor, + hats: SimpleTokenHat[] | undefined, + hatTokenMap: ReadOnlyHatMap, +) { + if (hats == null) { + return; + } + + const expected = hatTokenMap.getTokenHats(editor).map(tokenHatToPlainObject); + assert.deepEqual(expected, hats, "Unexpected hats"); +} diff --git a/packages/lib-test-case-recorder/src/TestCase.ts b/packages/lib-test-case-recorder/src/TestCase.ts index 66f1979211..dc9285422a 100644 --- a/packages/lib-test-case-recorder/src/TestCase.ts +++ b/packages/lib-test-case-recorder/src/TestCase.ts @@ -176,7 +176,10 @@ export class TestCase { ); } - async recordFinalState(returnValue: CommandResponse) { + async recordFinalState( + returnValue: CommandResponse, + getFinalHatTokenMap: () => Promise, + ) { const excludeFields = this.getExcludedFields(false); if ("returnValue" in returnValue) { @@ -186,14 +189,19 @@ export class TestCase { this.fallback = returnValue.fallback; } + const marks = this.isHatTokenMapTest ? this.getMarks() : undefined; + const hatTokenMap = this.captureHatTokenMap + ? await getFinalHatTokenMap() + : undefined; + this.finalState = await takeSnapshot( this.storedTargets, excludeFields, this.extraSnapshotFields, this.spyIde.activeTextEditor!, this.spyIde, - this.isHatTokenMapTest ? this.getMarks() : undefined, - this.captureHatTokenMap ? this.hatTokenMap : undefined, + marks, + hatTokenMap, { startTimestamp: this.startTimestamp }, ); this.recordSpyIdeValues(); diff --git a/packages/lib-test-case-recorder/src/TestCaseRecorder.ts b/packages/lib-test-case-recorder/src/TestCaseRecorder.ts index b6a3131f5a..7db3ef1081 100644 --- a/packages/lib-test-case-recorder/src/TestCaseRecorder.ts +++ b/packages/lib-test-case-recorder/src/TestCaseRecorder.ts @@ -362,7 +362,12 @@ export class TestCaseRecorder { return; } - await this.testCase.recordFinalState(returnValue); + const getFinalHatTokenMap = async () => { + await this.hatTokenMap.allocateHats(); + return this.hatTokenMap.getReadableMap(false); + }; + + await this.testCase.recordFinalState(returnValue, getFinalHatTokenMap); if (this.testCase.awaitingFinalMarkInfo) { // We don't finish the test case here in the case of a navigation map @@ -371,7 +376,7 @@ export class TestCaseRecorder { return; } - await this.finishTestCase(); + this.finishTestCase(); } finishTestCase(): void { diff --git a/packages/lib-test-case-recorder/src/takeSnapshot.ts b/packages/lib-test-case-recorder/src/takeSnapshot.ts index 3f6b009775..14ee23a7e0 100644 --- a/packages/lib-test-case-recorder/src/takeSnapshot.ts +++ b/packages/lib-test-case-recorder/src/takeSnapshot.ts @@ -38,7 +38,9 @@ export async function takeSnapshot( } if (hatTokenMap != null) { - snapshot.hatTokenMap = tokenHatToPlainObject(hatTokenMap); + snapshot.hatTokenMap = hatTokenMap + .getTokenHats(editor) + .map(tokenHatToPlainObject); } if (metadata != null) { diff --git a/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts b/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts index 53a100f369..893dcdc20b 100644 --- a/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts @@ -57,11 +57,14 @@ async function runBasicTutorialTest(spyIde: SpyIDE) { ); const checkStepSetup = async (fixture: TestCaseFixtureLegacy) => { + const readableHatTokenMap = await hatTokenMap.getReadableMap(false); + const getFinalHatTokenMap = () => Promise.resolve(readableHatTokenMap); assert.deepEqual( await getSnapshotForComparison( fixture.initialState, - await hatTokenMap.getReadableMap(false), + readableHatTokenMap, spyIde, + getFinalHatTokenMap, takeSnapshot, ), fixture.initialState, diff --git a/packages/tool-meta-updater/src/renderRecordedTestVisualizer.ts b/packages/tool-meta-updater/src/renderRecordedTestVisualizer.ts index c87a713b7e..b4b8a95f94 100644 --- a/packages/tool-meta-updater/src/renderRecordedTestVisualizer.ts +++ b/packages/tool-meta-updater/src/renderRecordedTestVisualizer.ts @@ -26,6 +26,13 @@ export async function renderRecordedTestVisualizer( throw new Error(`Fixture ${path.name} has no spoken form`); } + if ( + fixture.initialState.hatTokenMap == null || + fixture.finalState?.hatTokenMap == null + ) { + throw new Error(`Fixture ${path.name} is missing hatTokenMap`); + } + lines.push( `### \`"${fixture.command.spokenForm}"\``, "", diff --git a/resources/fixtures/recorded/docs/actions/addSelection.yml b/resources/fixtures/recorded/docs/actions/addSelection.yml index be100c1ebd..5156da405b 100644 --- a/resources/fixtures/recorded/docs/actions/addSelection.yml +++ b/resources/fixtures/recorded/docs/actions/addSelection.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb aaa selections: @@ -24,3 +40,19 @@ finalState: active: {line: 0, character: 6} - anchor: {line: 0, character: 7} active: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/addSelectionAfter.yml b/resources/fixtures/recorded/docs/actions/addSelectionAfter.yml index b7960cfffa..3bb35ed309 100644 --- a/resources/fixtures/recorded/docs/actions/addSelectionAfter.yml +++ b/resources/fixtures/recorded/docs/actions/addSelectionAfter.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb aaa selections: @@ -24,3 +40,19 @@ finalState: active: {line: 0, character: 6} - anchor: {line: 0, character: 10} active: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/addSelectionBefore.yml b/resources/fixtures/recorded/docs/actions/addSelectionBefore.yml index ca6b552a73..994a07ccf1 100644 --- a/resources/fixtures/recorded/docs/actions/addSelectionBefore.yml +++ b/resources/fixtures/recorded/docs/actions/addSelectionBefore.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb aaa selections: @@ -24,3 +40,19 @@ finalState: active: {line: 0, character: 6} - anchor: {line: 0, character: 7} active: {line: 0, character: 7} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/applyFormatter.yml b/resources/fixtures/recorded/docs/actions/applyFormatter.yml index ccc694fcd3..a86d5236a3 100644 --- a/resources/fixtures/recorded/docs/actions/applyFormatter.yml +++ b/resources/fixtures/recorded/docs/actions/applyFormatter.yml @@ -22,8 +22,30 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbbAaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/docs/actions/applyFormatter2.yml b/resources/fixtures/recorded/docs/actions/applyFormatter2.yml index b74ae57f5c..c8f5a11753 100644 --- a/resources/fixtures/recorded/docs/actions/applyFormatter2.yml +++ b/resources/fixtures/recorded/docs/actions/applyFormatter2.yml @@ -22,8 +22,30 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb_aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/docs/actions/applyFormatter3.yml b/resources/fixtures/recorded/docs/actions/applyFormatter3.yml index 1c6e3c07ee..85cb95e4e7 100644 --- a/resources/fixtures/recorded/docs/actions/applyFormatter3.yml +++ b/resources/fixtures/recorded/docs/actions/applyFormatter3.yml @@ -21,8 +21,25 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} finalState: documentContents: aaaBbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} diff --git a/resources/fixtures/recorded/docs/actions/breakLine.yml b/resources/fixtures/recorded/docs/actions/breakLine.yml index 534d9b49ec..44da2e928d 100644 --- a/resources/fixtures/recorded/docs/actions/breakLine.yml +++ b/resources/fixtures/recorded/docs/actions/breakLine.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: |- // bbb @@ -24,3 +40,19 @@ finalState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} diff --git a/resources/fixtures/recorded/docs/actions/callAsFunction.yml b/resources/fixtures/recorded/docs/actions/callAsFunction.yml index a667726581..d2929c5d5d 100644 --- a/resources/fixtures/recorded/docs/actions/callAsFunction.yml +++ b/resources/fixtures/recorded/docs/actions/callAsFunction.yml @@ -18,8 +18,55 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: aaa()// bbb aaa selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} diff --git a/resources/fixtures/recorded/docs/actions/callAsFunction2.yml b/resources/fixtures/recorded/docs/actions/callAsFunction2.yml index 8d51255dee..981c99f058 100644 --- a/resources/fixtures/recorded/docs/actions/callAsFunction2.yml +++ b/resources/fixtures/recorded/docs/actions/callAsFunction2.yml @@ -18,8 +18,55 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa(bbb) aaa selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/callAsFunction3.yml b/resources/fixtures/recorded/docs/actions/callAsFunction3.yml index 3ef7060d95..1a37fb1752 100644 --- a/resources/fixtures/recorded/docs/actions/callAsFunction3.yml +++ b/resources/fixtures/recorded/docs/actions/callAsFunction3.yml @@ -23,8 +23,55 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa(bbb) aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} diff --git a/resources/fixtures/recorded/docs/actions/clearAndSetSelection.yml b/resources/fixtures/recorded/docs/actions/clearAndSetSelection.yml index 152d3cee8e..f29abe562f 100644 --- a/resources/fixtures/recorded/docs/actions/clearAndSetSelection.yml +++ b/resources/fixtures/recorded/docs/actions/clearAndSetSelection.yml @@ -17,8 +17,35 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: "// bbb " selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 7} + hatTokenMap: + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/copyToClipboard.yml b/resources/fixtures/recorded/docs/actions/copyToClipboard.yml index 08b28057c4..275e73a3d8 100644 --- a/resources/fixtures/recorded/docs/actions/copyToClipboard.yml +++ b/resources/fixtures/recorded/docs/actions/copyToClipboard.yml @@ -16,9 +16,31 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} finalState: documentContents: Hello there selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} clipboard: Hello there diff --git a/resources/fixtures/recorded/docs/actions/cutToClipboard.yml b/resources/fixtures/recorded/docs/actions/cutToClipboard.yml index 7576065197..5df32c0cac 100644 --- a/resources/fixtures/recorded/docs/actions/cutToClipboard.yml +++ b/resources/fixtures/recorded/docs/actions/cutToClipboard.yml @@ -16,9 +16,21 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} finalState: documentContents: "" selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: [] clipboard: Hello there diff --git a/resources/fixtures/recorded/docs/actions/decrement.yml b/resources/fixtures/recorded/docs/actions/decrement.yml index 6d7cd07028..5629cb247a 100644 --- a/resources/fixtures/recorded/docs/actions/decrement.yml +++ b/resources/fixtures/recorded/docs/actions/decrement.yml @@ -17,8 +17,40 @@ initialState: default.5: start: {line: 0, character: 3} end: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} finalState: documentContents: // 4 aaa10 selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "4" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/docs/actions/decrement2.yml b/resources/fixtures/recorded/docs/actions/decrement2.yml index 73e8f4fdfe..075475f2fc 100644 --- a/resources/fixtures/recorded/docs/actions/decrement2.yml +++ b/resources/fixtures/recorded/docs/actions/decrement2.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 5} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} finalState: documentContents: // 5 aaa9 selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/docs/actions/decrement3.yml b/resources/fixtures/recorded/docs/actions/decrement3.yml index a4c905f4b2..914c4fe9ac 100644 --- a/resources/fixtures/recorded/docs/actions/decrement3.yml +++ b/resources/fixtures/recorded/docs/actions/decrement3.yml @@ -16,8 +16,40 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} finalState: documentContents: // 4 aaa9 selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "4" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/docs/actions/deselect.yml b/resources/fixtures/recorded/docs/actions/deselect.yml index b0846a4ed0..7d0045aac8 100644 --- a/resources/fixtures/recorded/docs/actions/deselect.yml +++ b/resources/fixtures/recorded/docs/actions/deselect.yml @@ -19,8 +19,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/editNewLineAfter.yml b/resources/fixtures/recorded/docs/actions/editNewLineAfter.yml index b861119b92..53881c4101 100644 --- a/resources/fixtures/recorded/docs/actions/editNewLineAfter.yml +++ b/resources/fixtures/recorded/docs/actions/editNewLineAfter.yml @@ -17,9 +17,41 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: | // bbb aaa selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/editNewLineAfter2.yml b/resources/fixtures/recorded/docs/actions/editNewLineAfter2.yml index d70389851d..4d0aca532c 100644 --- a/resources/fixtures/recorded/docs/actions/editNewLineAfter2.yml +++ b/resources/fixtures/recorded/docs/actions/editNewLineAfter2.yml @@ -20,8 +20,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: "// bbb aaa " selections: - anchor: {line: 0, character: 11} active: {line: 0, character: 11} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/editNewLineBefore.yml b/resources/fixtures/recorded/docs/actions/editNewLineBefore.yml index 46155139c2..3a6db7ef1e 100644 --- a/resources/fixtures/recorded/docs/actions/editNewLineBefore.yml +++ b/resources/fixtures/recorded/docs/actions/editNewLineBefore.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: |- @@ -24,3 +40,19 @@ finalState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 1, character: 0} + end: {line: 1, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 1, character: 4} + end: {line: 1, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 8} + end: {line: 1, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/editNewLineBefore2.yml b/resources/fixtures/recorded/docs/actions/editNewLineBefore2.yml index 9a772efc6c..19f8ab57dd 100644 --- a/resources/fixtures/recorded/docs/actions/editNewLineBefore2.yml +++ b/resources/fixtures/recorded/docs/actions/editNewLineBefore2.yml @@ -20,8 +20,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 7} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/increment.yml b/resources/fixtures/recorded/docs/actions/increment.yml index 1fd2a4a7d7..1d0757a072 100644 --- a/resources/fixtures/recorded/docs/actions/increment.yml +++ b/resources/fixtures/recorded/docs/actions/increment.yml @@ -17,8 +17,40 @@ initialState: default.5: start: {line: 0, character: 3} end: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} finalState: documentContents: // 6 aaa10 selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "6" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/docs/actions/increment2.yml b/resources/fixtures/recorded/docs/actions/increment2.yml index f4ab773b88..c00e6660ed 100644 --- a/resources/fixtures/recorded/docs/actions/increment2.yml +++ b/resources/fixtures/recorded/docs/actions/increment2.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 5} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} finalState: documentContents: // 5 aaa11 selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/docs/actions/increment3.yml b/resources/fixtures/recorded/docs/actions/increment3.yml index 6f8faa9f95..63adac76cd 100644 --- a/resources/fixtures/recorded/docs/actions/increment3.yml +++ b/resources/fixtures/recorded/docs/actions/increment3.yml @@ -16,8 +16,40 @@ initialState: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "5" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} finalState: documentContents: // 6 aaa11 selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "6" + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} diff --git a/resources/fixtures/recorded/docs/actions/indentLine.yml b/resources/fixtures/recorded/docs/actions/indentLine.yml index cbee024dbc..9758c8e466 100644 --- a/resources/fixtures/recorded/docs/actions/indentLine.yml +++ b/resources/fixtures/recorded/docs/actions/indentLine.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: " // bbb aaa" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/insertCopyAfter.yml b/resources/fixtures/recorded/docs/actions/insertCopyAfter.yml index f38569ba5f..8e410bc4fb 100644 --- a/resources/fixtures/recorded/docs/actions/insertCopyAfter.yml +++ b/resources/fixtures/recorded/docs/actions/insertCopyAfter.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: |- // bbb aaa @@ -24,3 +40,34 @@ finalState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 1, character: 0} + end: {line: 1, character: 1} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 1, character: 4} + end: {line: 1, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 8} + end: {line: 1, character: 9} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/insertCopyAfter2.yml b/resources/fixtures/recorded/docs/actions/insertCopyAfter2.yml index 87e4184b2d..4655f1d72e 100644 --- a/resources/fixtures/recorded/docs/actions/insertCopyAfter2.yml +++ b/resources/fixtures/recorded/docs/actions/insertCopyAfter2.yml @@ -20,8 +20,45 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/insertCopyBefore.yml b/resources/fixtures/recorded/docs/actions/insertCopyBefore.yml index 7ade55ce3c..7d62afa93f 100644 --- a/resources/fixtures/recorded/docs/actions/insertCopyBefore.yml +++ b/resources/fixtures/recorded/docs/actions/insertCopyBefore.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: |- // bbb aaa @@ -24,3 +40,34 @@ finalState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 1, character: 0} + end: {line: 1, character: 1} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 1, character: 4} + end: {line: 1, character: 5} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 1, character: 8} + end: {line: 1, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/insertCopyBefore2.yml b/resources/fixtures/recorded/docs/actions/insertCopyBefore2.yml index ce79fed4c0..c25edd7691 100644 --- a/resources/fixtures/recorded/docs/actions/insertCopyBefore2.yml +++ b/resources/fixtures/recorded/docs/actions/insertCopyBefore2.yml @@ -20,8 +20,45 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter.yml b/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter.yml index 80eb93bc96..cf683d7832 100644 --- a/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter.yml +++ b/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter.yml @@ -17,9 +17,41 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: | // bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter2.yml b/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter2.yml index e443fa2124..652cea4cee 100644 --- a/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter2.yml +++ b/resources/fixtures/recorded/docs/actions/insertEmptyLineAfter2.yml @@ -20,8 +20,40 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} diff --git a/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore.yml b/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore.yml index 88fd4af013..9bc7b5ba8a 100644 --- a/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore.yml +++ b/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: |- @@ -24,3 +40,19 @@ finalState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + hatTokenMap: + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 1, character: 0} + end: {line: 1, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 1, character: 4} + end: {line: 1, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 8} + end: {line: 1, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore2.yml b/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore2.yml index 106948d8e8..d9550565ac 100644 --- a/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore2.yml +++ b/resources/fixtures/recorded/docs/actions/insertEmptyLineBefore2.yml @@ -20,8 +20,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} diff --git a/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround.yml b/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround.yml index 45250d5a0b..049ba236d4 100644 --- a/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround.yml +++ b/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround.yml @@ -17,6 +17,22 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: | @@ -24,3 +40,19 @@ finalState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 1, character: 0} + end: {line: 1, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 1, character: 4} + end: {line: 1, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 8} + end: {line: 1, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround2.yml b/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround2.yml index 32366a0dec..b28c4d7c64 100644 --- a/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround2.yml +++ b/resources/fixtures/recorded/docs/actions/insertEmptyLinesAround2.yml @@ -20,8 +20,40 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} diff --git a/resources/fixtures/recorded/docs/actions/insertSnippet.yml b/resources/fixtures/recorded/docs/actions/insertSnippet.yml index 4b6ebd4ff3..96a1bfd2a7 100644 --- a/resources/fixtures/recorded/docs/actions/insertSnippet.yml +++ b/resources/fixtures/recorded/docs/actions/insertSnippet.yml @@ -40,6 +40,32 @@ initialState: default.a: start: {line: 0, character: 6} end: {line: 0, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} finalState: documentContents: |- const aaa = 0; @@ -49,3 +75,54 @@ finalState: selections: - anchor: {line: 1, character: 4} active: {line: 1, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 1, character: 4} + end: {line: 1, character: 5} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 1, character: 3} + end: {line: 1, character: 4} + - hatStyle: default + grapheme: "{" + hatRange: + start: {line: 1, character: 6} + end: {line: 1, character: 7} + - hatStyle: default + grapheme: f + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} + - hatStyle: default + grapheme: "}" + hatRange: + start: {line: 3, character: 0} + end: {line: 3, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/joinLines.yml b/resources/fixtures/recorded/docs/actions/joinLines.yml index 824e246d07..6b9b1a060b 100644 --- a/resources/fixtures/recorded/docs/actions/joinLines.yml +++ b/resources/fixtures/recorded/docs/actions/joinLines.yml @@ -19,8 +19,40 @@ initialState: default.a: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} finalState: documentContents: // aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/moveToTarget.yml b/resources/fixtures/recorded/docs/actions/moveToTarget.yml index 3ae1f1d177..15e4a968e4 100644 --- a/resources/fixtures/recorded/docs/actions/moveToTarget.yml +++ b/resources/fixtures/recorded/docs/actions/moveToTarget.yml @@ -18,8 +18,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: aaa// bbb selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} diff --git a/resources/fixtures/recorded/docs/actions/moveToTarget2.yml b/resources/fixtures/recorded/docs/actions/moveToTarget2.yml index c6091d32ba..74035eca2c 100644 --- a/resources/fixtures/recorded/docs/actions/moveToTarget2.yml +++ b/resources/fixtures/recorded/docs/actions/moveToTarget2.yml @@ -26,10 +26,35 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} - hatTokenMap: [] + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} - hatTokenMap: [] + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/docs/actions/moveToTarget3.yml b/resources/fixtures/recorded/docs/actions/moveToTarget3.yml index b9628e1f97..a8ce2e6232 100644 --- a/resources/fixtures/recorded/docs/actions/moveToTarget3.yml +++ b/resources/fixtures/recorded/docs/actions/moveToTarget3.yml @@ -26,8 +26,40 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/moveToTarget4.yml b/resources/fixtures/recorded/docs/actions/moveToTarget4.yml index 8f61f89518..58a3a5a6db 100644 --- a/resources/fixtures/recorded/docs/actions/moveToTarget4.yml +++ b/resources/fixtures/recorded/docs/actions/moveToTarget4.yml @@ -26,8 +26,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/moveToTarget5.yml b/resources/fixtures/recorded/docs/actions/moveToTarget5.yml index 0467593511..f33d75a1eb 100644 --- a/resources/fixtures/recorded/docs/actions/moveToTarget5.yml +++ b/resources/fixtures/recorded/docs/actions/moveToTarget5.yml @@ -40,8 +40,50 @@ initialState: default.d: start: {line: 0, character: 15} end: {line: 0, character: 18} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: c + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: d + hatRange: + start: {line: 0, character: 16} + end: {line: 0, character: 17} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/nextHomophone.yml b/resources/fixtures/recorded/docs/actions/nextHomophone.yml index 4e732883e1..d84f913aed 100644 --- a/resources/fixtures/recorded/docs/actions/nextHomophone.yml +++ b/resources/fixtures/recorded/docs/actions/nextHomophone.yml @@ -22,8 +22,30 @@ initialState: default.i: start: {line: 0, character: 3} end: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: i + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // rite selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: i + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/docs/actions/nextHomophone2.yml b/resources/fixtures/recorded/docs/actions/nextHomophone2.yml index 4a804ce53c..64c31973bf 100644 --- a/resources/fixtures/recorded/docs/actions/nextHomophone2.yml +++ b/resources/fixtures/recorded/docs/actions/nextHomophone2.yml @@ -22,8 +22,30 @@ initialState: default.i: start: {line: 0, character: 3} end: {line: 0, character: 7} + hatTokenMap: + - hatStyle: default + grapheme: i + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // write selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: i + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} diff --git a/resources/fixtures/recorded/docs/actions/outdentLine.yml b/resources/fixtures/recorded/docs/actions/outdentLine.yml index 7805b8df1c..cc51c5d5c4 100644 --- a/resources/fixtures/recorded/docs/actions/outdentLine.yml +++ b/resources/fixtures/recorded/docs/actions/outdentLine.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 11} end: {line: 0, character: 14} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/pasteFromClipboard.yml b/resources/fixtures/recorded/docs/actions/pasteFromClipboard.yml index 0df4724706..17fed1e600 100644 --- a/resources/fixtures/recorded/docs/actions/pasteFromClipboard.yml +++ b/resources/fixtures/recorded/docs/actions/pasteFromClipboard.yml @@ -21,8 +21,40 @@ initialState: start: {line: 0, character: 7} end: {line: 0, character: 10} clipboard: clipboard + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb clipboard selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: l + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/pasteFromClipboard2.yml b/resources/fixtures/recorded/docs/actions/pasteFromClipboard2.yml index d856121e1e..761f36b5cf 100644 --- a/resources/fixtures/recorded/docs/actions/pasteFromClipboard2.yml +++ b/resources/fixtures/recorded/docs/actions/pasteFromClipboard2.yml @@ -21,8 +21,45 @@ initialState: start: {line: 0, character: 7} end: {line: 0, character: 10} clipboard: clipboard + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb clipboard aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: l + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 18} + end: {line: 0, character: 19} diff --git a/resources/fixtures/recorded/docs/actions/pasteFromClipboard3.yml b/resources/fixtures/recorded/docs/actions/pasteFromClipboard3.yml index 4175274023..8007a9da63 100644 --- a/resources/fixtures/recorded/docs/actions/pasteFromClipboard3.yml +++ b/resources/fixtures/recorded/docs/actions/pasteFromClipboard3.yml @@ -21,8 +21,45 @@ initialState: start: {line: 0, character: 7} end: {line: 0, character: 10} clipboard: clipboard + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa clipboard selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: l + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/randomizeTargets.yml b/resources/fixtures/recorded/docs/actions/randomizeTargets.yml index 9020599fdb..e56c4ecf40 100644 --- a/resources/fixtures/recorded/docs/actions/randomizeTargets.yml +++ b/resources/fixtures/recorded/docs/actions/randomizeTargets.yml @@ -16,8 +16,10 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: [] finalState: documentContents: "[2, 3, 1]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + hatTokenMap: [] diff --git a/resources/fixtures/recorded/docs/actions/remove.yml b/resources/fixtures/recorded/docs/actions/remove.yml index 657c1cec20..74230b55f6 100644 --- a/resources/fixtures/recorded/docs/actions/remove.yml +++ b/resources/fixtures/recorded/docs/actions/remove.yml @@ -17,8 +17,35 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} diff --git a/resources/fixtures/recorded/docs/actions/replaceWithTarget.yml b/resources/fixtures/recorded/docs/actions/replaceWithTarget.yml index 4efcb9a2b7..90021f1564 100644 --- a/resources/fixtures/recorded/docs/actions/replaceWithTarget.yml +++ b/resources/fixtures/recorded/docs/actions/replaceWithTarget.yml @@ -18,8 +18,45 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: aaa// bbb aaa selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/docs/actions/replaceWithTarget2.yml b/resources/fixtures/recorded/docs/actions/replaceWithTarget2.yml index 5bd0b97064..f83e57e55c 100644 --- a/resources/fixtures/recorded/docs/actions/replaceWithTarget2.yml +++ b/resources/fixtures/recorded/docs/actions/replaceWithTarget2.yml @@ -26,8 +26,40 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/replaceWithTarget3.yml b/resources/fixtures/recorded/docs/actions/replaceWithTarget3.yml index e2856054da..c99db9407f 100644 --- a/resources/fixtures/recorded/docs/actions/replaceWithTarget3.yml +++ b/resources/fixtures/recorded/docs/actions/replaceWithTarget3.yml @@ -26,8 +26,45 @@ initialState: default.b: start: {line: 0, character: 3} end: {line: 0, character: 6} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/replaceWithTarget4.yml b/resources/fixtures/recorded/docs/actions/replaceWithTarget4.yml index 29f0796956..2f9c46bb39 100644 --- a/resources/fixtures/recorded/docs/actions/replaceWithTarget4.yml +++ b/resources/fixtures/recorded/docs/actions/replaceWithTarget4.yml @@ -26,8 +26,45 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/replaceWithTarget5.yml b/resources/fixtures/recorded/docs/actions/replaceWithTarget5.yml index 59c1148810..411383b647 100644 --- a/resources/fixtures/recorded/docs/actions/replaceWithTarget5.yml +++ b/resources/fixtures/recorded/docs/actions/replaceWithTarget5.yml @@ -33,8 +33,50 @@ initialState: default.c: start: {line: 0, character: 11} end: {line: 0, character: 14} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: c + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa aaa aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: green + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} diff --git a/resources/fixtures/recorded/docs/actions/replaceWithTarget6.yml b/resources/fixtures/recorded/docs/actions/replaceWithTarget6.yml index f652ba28f5..86db435577 100644 --- a/resources/fixtures/recorded/docs/actions/replaceWithTarget6.yml +++ b/resources/fixtures/recorded/docs/actions/replaceWithTarget6.yml @@ -40,8 +40,60 @@ initialState: default.d: start: {line: 0, character: 15} end: {line: 0, character: 18} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: c + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: d + hatRange: + start: {line: 0, character: 16} + end: {line: 0, character: 17} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // aaa bbb aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 16} + end: {line: 0, character: 17} diff --git a/resources/fixtures/recorded/docs/actions/reverseTargets.yml b/resources/fixtures/recorded/docs/actions/reverseTargets.yml index 6f6a17c3ea..ed2dd59335 100644 --- a/resources/fixtures/recorded/docs/actions/reverseTargets.yml +++ b/resources/fixtures/recorded/docs/actions/reverseTargets.yml @@ -16,8 +16,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[3, 2, 1]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: blue + grapheme: "3" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: blue + grapheme: "1" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/rewrapWithPairedDelimiter.yml b/resources/fixtures/recorded/docs/actions/rewrapWithPairedDelimiter.yml index 1dae3d9cb4..93ef39bf57 100644 --- a/resources/fixtures/recorded/docs/actions/rewrapWithPairedDelimiter.yml +++ b/resources/fixtures/recorded/docs/actions/rewrapWithPairedDelimiter.yml @@ -19,8 +19,60 @@ initialState: default.a: start: {line: 0, character: 8} end: {line: 0, character: 11} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} finalState: documentContents: // bbb {aaa} selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "{" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: "}" + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/docs/actions/setSelection.yml b/resources/fixtures/recorded/docs/actions/setSelection.yml index 8704124a98..73831fe204 100644 --- a/resources/fixtures/recorded/docs/actions/setSelection.yml +++ b/resources/fixtures/recorded/docs/actions/setSelection.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/setSelectionAfter.yml b/resources/fixtures/recorded/docs/actions/setSelectionAfter.yml index d93009856f..ad80e0e006 100644 --- a/resources/fixtures/recorded/docs/actions/setSelectionAfter.yml +++ b/resources/fixtures/recorded/docs/actions/setSelectionAfter.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/setSelectionBefore.yml b/resources/fixtures/recorded/docs/actions/setSelectionBefore.yml index 6b18bb3138..8031aeb1fe 100644 --- a/resources/fixtures/recorded/docs/actions/setSelectionBefore.yml +++ b/resources/fixtures/recorded/docs/actions/setSelectionBefore.yml @@ -17,8 +17,40 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 7} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/actions/sortTargets.yml b/resources/fixtures/recorded/docs/actions/sortTargets.yml index d53f045031..c6eaf18d31 100644 --- a/resources/fixtures/recorded/docs/actions/sortTargets.yml +++ b/resources/fixtures/recorded/docs/actions/sortTargets.yml @@ -16,8 +16,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: blue + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: blue + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/swapTargets.yml b/resources/fixtures/recorded/docs/actions/swapTargets.yml index fdd42a5e58..6ea44f83ee 100644 --- a/resources/fixtures/recorded/docs/actions/swapTargets.yml +++ b/resources/fixtures/recorded/docs/actions/swapTargets.yml @@ -23,8 +23,40 @@ initialState: default.b: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/swapTargets2.yml b/resources/fixtures/recorded/docs/actions/swapTargets2.yml index a78d9c5f63..ff02b87403 100644 --- a/resources/fixtures/recorded/docs/actions/swapTargets2.yml +++ b/resources/fixtures/recorded/docs/actions/swapTargets2.yml @@ -37,8 +37,60 @@ initialState: default.d: start: {line: 0, character: 15} end: {line: 0, character: 18} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: c + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: d + hatRange: + start: {line: 0, character: 16} + end: {line: 0, character: 17} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // ccc ddd aaa bbb selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: c + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: d + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: blue + grapheme: b + hatRange: + start: {line: 0, character: 16} + end: {line: 0, character: 17} diff --git a/resources/fixtures/recorded/docs/actions/toggleLineComment.yml b/resources/fixtures/recorded/docs/actions/toggleLineComment.yml index 62adf06e69..445fa3fab9 100644 --- a/resources/fixtures/recorded/docs/actions/toggleLineComment.yml +++ b/resources/fixtures/recorded/docs/actions/toggleLineComment.yml @@ -17,8 +17,35 @@ initialState: default.a: start: {line: 0, character: 4} end: {line: 0, character: 7} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} finalState: documentContents: // bbb aaa selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/actions/toggleLineComment2.yml b/resources/fixtures/recorded/docs/actions/toggleLineComment2.yml index 56801a17c7..f78c00d1e3 100644 --- a/resources/fixtures/recorded/docs/actions/toggleLineComment2.yml +++ b/resources/fixtures/recorded/docs/actions/toggleLineComment2.yml @@ -17,8 +17,35 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: bbb aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} diff --git a/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter.yml b/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter.yml index eb75606187..bf4af42691 100644 --- a/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter.yml +++ b/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter.yml @@ -19,8 +19,50 @@ initialState: default.a: start: {line: 0, character: 7} end: {line: 0, character: 10} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: // bbb (aaa) selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: b + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter2.yml b/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter2.yml index cf80b101a6..e85b0a16a1 100644 --- a/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter2.yml +++ b/resources/fixtures/recorded/docs/actions/wrapWithPairedDelimiter2.yml @@ -37,6 +37,32 @@ initialState: default.a: start: {line: 0, character: 6} end: {line: 0, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 12} + end: {line: 0, character: 13} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} finalState: documentContents: |- if () { @@ -45,3 +71,54 @@ finalState: selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 3} + end: {line: 0, character: 4} + - hatStyle: default + grapheme: "{" + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: f + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 1, character: 5} + end: {line: 1, character: 6} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 11} + end: {line: 1, character: 12} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 1, character: 14} + end: {line: 1, character: 15} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 1, character: 16} + end: {line: 1, character: 17} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 1, character: 17} + end: {line: 1, character: 18} + - hatStyle: default + grapheme: "}" + hatRange: + start: {line: 2, character: 0} + end: {line: 2, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/ancestor.yml b/resources/fixtures/recorded/docs/modifiers/ancestor.yml index e1f399b875..c214771bc1 100644 --- a/resources/fixtures/recorded/docs/modifiers/ancestor.yml +++ b/resources/fixtures/recorded/docs/modifiers/ancestor.yml @@ -17,8 +17,160 @@ initialState: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} + - hatStyle: blue + grapheme: "[" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "]" + hatRange: + start: {line: 0, character: 14} + end: {line: 0, character: 15} + - hatStyle: green + grapheme: "," + hatRange: + start: {line: 0, character: 15} + end: {line: 0, character: 16} + - hatStyle: red + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "4" + hatRange: + start: {line: 0, character: 17} + end: {line: 0, character: 18} + - hatStyle: green + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: green + grapheme: "]" + hatRange: + start: {line: 0, character: 18} + end: {line: 0, character: 19} finalState: documentContents: "[0, [1, [2], 3], 4]" selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 11} + hatTokenMap: + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: "]" + hatRange: + start: {line: 0, character: 14} + end: {line: 0, character: 15} + - hatStyle: green + grapheme: "," + hatRange: + start: {line: 0, character: 15} + end: {line: 0, character: 16} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "4" + hatRange: + start: {line: 0, character: 17} + end: {line: 0, character: 18} + - hatStyle: blue + grapheme: "[" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: green + grapheme: "]" + hatRange: + start: {line: 0, character: 18} + end: {line: 0, character: 19} + - hatStyle: red + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: green + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/ancestor2.yml b/resources/fixtures/recorded/docs/modifiers/ancestor2.yml index dd004fbb7a..5df226c544 100644 --- a/resources/fixtures/recorded/docs/modifiers/ancestor2.yml +++ b/resources/fixtures/recorded/docs/modifiers/ancestor2.yml @@ -17,8 +17,160 @@ initialState: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} + - hatStyle: blue + grapheme: "[" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "]" + hatRange: + start: {line: 0, character: 14} + end: {line: 0, character: 15} + - hatStyle: green + grapheme: "," + hatRange: + start: {line: 0, character: 15} + end: {line: 0, character: 16} + - hatStyle: red + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "4" + hatRange: + start: {line: 0, character: 17} + end: {line: 0, character: 18} + - hatStyle: green + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: green + grapheme: "]" + hatRange: + start: {line: 0, character: 18} + end: {line: 0, character: 19} finalState: documentContents: "[0, [1, [2], 3], 4]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 15} + hatTokenMap: + - hatStyle: green + grapheme: "," + hatRange: + start: {line: 0, character: 15} + end: {line: 0, character: 16} + - hatStyle: blue + grapheme: "]" + hatRange: + start: {line: 0, character: 14} + end: {line: 0, character: 15} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 13} + end: {line: 0, character: 14} + - hatStyle: default + grapheme: "4" + hatRange: + start: {line: 0, character: 17} + end: {line: 0, character: 18} + - hatStyle: green + grapheme: "]" + hatRange: + start: {line: 0, character: 18} + end: {line: 0, character: 19} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 10} + end: {line: 0, character: 11} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 9} + end: {line: 0, character: 10} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "[" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: red + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: green + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/containingScope.yml b/resources/fixtures/recorded/docs/modifiers/containingScope.yml index bab69e2129..6f4e2f307b 100644 --- a/resources/fixtures/recorded/docs/modifiers/containingScope.yml +++ b/resources/fixtures/recorded/docs/modifiers/containingScope.yml @@ -16,8 +16,40 @@ initialState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/endOf.yml b/resources/fixtures/recorded/docs/modifiers/endOf.yml index 3076b94d3c..02acaf42e3 100644 --- a/resources/fixtures/recorded/docs/modifiers/endOf.yml +++ b/resources/fixtures/recorded/docs/modifiers/endOf.yml @@ -17,8 +17,40 @@ initialState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/everyScope.yml b/resources/fixtures/recorded/docs/modifiers/everyScope.yml index 5a32f5e82c..47fb7a20f2 100644 --- a/resources/fixtures/recorded/docs/modifiers/everyScope.yml +++ b/resources/fixtures/recorded/docs/modifiers/everyScope.yml @@ -16,6 +16,42 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: @@ -25,3 +61,39 @@ finalState: active: {line: 0, character: 5} - anchor: {line: 0, character: 7} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/modifiers/excludeInterior.yml b/resources/fixtures/recorded/docs/modifiers/excludeInterior.yml index bf53857e52..638e51b3cc 100644 --- a/resources/fixtures/recorded/docs/modifiers/excludeInterior.yml +++ b/resources/fixtures/recorded/docs/modifiers/excludeInterior.yml @@ -15,6 +15,42 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: @@ -22,3 +58,39 @@ finalState: active: {line: 0, character: 1} - anchor: {line: 0, character: 8} active: {line: 0, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/modifiers/excludeInterior2.yml b/resources/fixtures/recorded/docs/modifiers/excludeInterior2.yml index 35a644fa8e..a52c38036c 100644 --- a/resources/fixtures/recorded/docs/modifiers/excludeInterior2.yml +++ b/resources/fixtures/recorded/docs/modifiers/excludeInterior2.yml @@ -19,8 +19,30 @@ initialState: default.a: start: {line: 0, character: 1} end: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: ( + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: ) + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} finalState: documentContents: aaa selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} diff --git a/resources/fixtures/recorded/docs/modifiers/extendThroughEndOf.yml b/resources/fixtures/recorded/docs/modifiers/extendThroughEndOf.yml index cb3ef46b82..acdc1c4ba2 100644 --- a/resources/fixtures/recorded/docs/modifiers/extendThroughEndOf.yml +++ b/resources/fixtures/recorded/docs/modifiers/extendThroughEndOf.yml @@ -15,8 +15,40 @@ initialState: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 15} + hatTokenMap: + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/extendThroughStartOf.yml b/resources/fixtures/recorded/docs/modifiers/extendThroughStartOf.yml index f0f58b10c1..62c7c5d9c6 100644 --- a/resources/fixtures/recorded/docs/modifiers/extendThroughStartOf.yml +++ b/resources/fixtures/recorded/docs/modifiers/extendThroughStartOf.yml @@ -15,8 +15,40 @@ initialState: - anchor: {line: 0, character: 9} active: {line: 0, character: 9} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 9} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/docs/modifiers/inferPreviousMark.yml b/resources/fixtures/recorded/docs/modifiers/inferPreviousMark.yml index 3f57f4530e..db0bafdde4 100644 --- a/resources/fixtures/recorded/docs/modifiers/inferPreviousMark.yml +++ b/resources/fixtures/recorded/docs/modifiers/inferPreviousMark.yml @@ -30,6 +30,32 @@ initialState: default.a: start: {line: 1, character: 6} end: {line: 1, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 7} + end: {line: 1, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 1, character: 10} + end: {line: 1, character: 11} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 1, character: 12} + end: {line: 1, character: 13} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 1, character: 13} + end: {line: 1, character: 14} finalState: documentContents: |- @@ -37,3 +63,29 @@ finalState: selections: - anchor: {line: 1, character: 6} active: {line: 1, character: 14} + hatTokenMap: + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 1, character: 13} + end: {line: 1, character: 14} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 1, character: 12} + end: {line: 1, character: 13} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 1, character: 10} + end: {line: 1, character: 11} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 7} + end: {line: 1, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} diff --git a/resources/fixtures/recorded/docs/modifiers/inferPreviousMark2.yml b/resources/fixtures/recorded/docs/modifiers/inferPreviousMark2.yml index c1d6977daa..a7b3481cda 100644 --- a/resources/fixtures/recorded/docs/modifiers/inferPreviousMark2.yml +++ b/resources/fixtures/recorded/docs/modifiers/inferPreviousMark2.yml @@ -28,6 +28,32 @@ initialState: default.a: start: {line: 1, character: 6} end: {line: 1, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 7} + end: {line: 1, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 1, character: 10} + end: {line: 1, character: 11} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 1, character: 12} + end: {line: 1, character: 13} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 1, character: 13} + end: {line: 1, character: 14} finalState: documentContents: |- @@ -35,3 +61,9 @@ finalState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} diff --git a/resources/fixtures/recorded/docs/modifiers/inferPreviousMark3.yml b/resources/fixtures/recorded/docs/modifiers/inferPreviousMark3.yml index 9036c50b44..7b379e3f19 100644 --- a/resources/fixtures/recorded/docs/modifiers/inferPreviousMark3.yml +++ b/resources/fixtures/recorded/docs/modifiers/inferPreviousMark3.yml @@ -28,6 +28,32 @@ initialState: default.a: start: {line: 1, character: 6} end: {line: 1, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 7} + end: {line: 1, character: 8} + - hatStyle: default + grapheme: o + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 1, character: 10} + end: {line: 1, character: 11} + - hatStyle: default + grapheme: "0" + hatRange: + start: {line: 1, character: 12} + end: {line: 1, character: 13} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 1, character: 13} + end: {line: 1, character: 14} finalState: documentContents: |- @@ -35,3 +61,29 @@ finalState: selections: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: o + hatRange: + start: {line: 1, character: 1} + end: {line: 1, character: 2} + - hatStyle: default + grapheme: a + hatRange: + start: {line: 1, character: 7} + end: {line: 1, character: 8} + - hatStyle: default + grapheme: "=" + hatRange: + start: {line: 1, character: 10} + end: {line: 1, character: 11} + - hatStyle: blue + grapheme: a + hatRange: + start: {line: 1, character: 13} + end: {line: 1, character: 14} + - hatStyle: default + grapheme: ; + hatRange: + start: {line: 1, character: 15} + end: {line: 1, character: 16} diff --git a/resources/fixtures/recorded/docs/modifiers/interiorOnly.yml b/resources/fixtures/recorded/docs/modifiers/interiorOnly.yml index e8791b34c8..ff86c40d12 100644 --- a/resources/fixtures/recorded/docs/modifiers/interiorOnly.yml +++ b/resources/fixtures/recorded/docs/modifiers/interiorOnly.yml @@ -15,8 +15,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/keepContentFilter.yml b/resources/fixtures/recorded/docs/modifiers/keepContentFilter.yml index 16a09c9458..d8aa52714e 100644 --- a/resources/fixtures/recorded/docs/modifiers/keepContentFilter.yml +++ b/resources/fixtures/recorded/docs/modifiers/keepContentFilter.yml @@ -22,6 +22,27 @@ initialState: - anchor: {line: 2, character: 0} active: {line: 2, character: 8} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 2, character: 5} + end: {line: 2, character: 6} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 2, character: 0} + end: {line: 2, character: 1} finalState: documentContents: |- // Hello @@ -32,3 +53,24 @@ finalState: active: {line: 0, character: 8} - anchor: {line: 2, character: 0} active: {line: 2, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 2, character: 5} + end: {line: 2, character: 6} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 2, character: 0} + end: {line: 2, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/keepEmptyFilter.yml b/resources/fixtures/recorded/docs/modifiers/keepEmptyFilter.yml index d17f11884b..3ddddce9a7 100644 --- a/resources/fixtures/recorded/docs/modifiers/keepEmptyFilter.yml +++ b/resources/fixtures/recorded/docs/modifiers/keepEmptyFilter.yml @@ -22,6 +22,27 @@ initialState: - anchor: {line: 2, character: 0} active: {line: 2, character: 8} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 2, character: 5} + end: {line: 2, character: 6} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 2, character: 0} + end: {line: 2, character: 1} finalState: documentContents: |- // Hello @@ -30,3 +51,24 @@ finalState: selections: - anchor: {line: 1, character: 0} active: {line: 1, character: 0} + hatTokenMap: + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: / + hatRange: + start: {line: 2, character: 0} + end: {line: 2, character: 1} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 2, character: 5} + end: {line: 2, character: 6} diff --git a/resources/fixtures/recorded/docs/modifiers/leading.yml b/resources/fixtures/recorded/docs/modifiers/leading.yml index 892b5485a0..fd38d2580c 100644 --- a/resources/fixtures/recorded/docs/modifiers/leading.yml +++ b/resources/fixtures/recorded/docs/modifiers/leading.yml @@ -15,8 +15,40 @@ initialState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/docs/modifiers/leading2.yml b/resources/fixtures/recorded/docs/modifiers/leading2.yml index 510b5a5584..f342abfb50 100644 --- a/resources/fixtures/recorded/docs/modifiers/leading2.yml +++ b/resources/fixtures/recorded/docs/modifiers/leading2.yml @@ -17,8 +17,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 2} active: {line: 0, character: 4} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/modifiers/ordinalScope.yml b/resources/fixtures/recorded/docs/modifiers/ordinalScope.yml index c0baf16248..991ad0f454 100644 --- a/resources/fixtures/recorded/docs/modifiers/ordinalScope.yml +++ b/resources/fixtures/recorded/docs/modifiers/ordinalScope.yml @@ -18,8 +18,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 2} + hatTokenMap: + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/modifiers/ordinalScope2.yml b/resources/fixtures/recorded/docs/modifiers/ordinalScope2.yml index dde71ff245..1f7f42db23 100644 --- a/resources/fixtures/recorded/docs/modifiers/ordinalScope2.yml +++ b/resources/fixtures/recorded/docs/modifiers/ordinalScope2.yml @@ -18,8 +18,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/ordinalScope3.yml b/resources/fixtures/recorded/docs/modifiers/ordinalScope3.yml index a2bbecfe38..a2a81fad1c 100644 --- a/resources/fixtures/recorded/docs/modifiers/ordinalScope3.yml +++ b/resources/fixtures/recorded/docs/modifiers/ordinalScope3.yml @@ -18,8 +18,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 5} + hatTokenMap: + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/ordinalScope4.yml b/resources/fixtures/recorded/docs/modifiers/ordinalScope4.yml index 3f4fa887a9..7008c9ea90 100644 --- a/resources/fixtures/recorded/docs/modifiers/ordinalScope4.yml +++ b/resources/fixtures/recorded/docs/modifiers/ordinalScope4.yml @@ -18,8 +18,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/ordinalScope5.yml b/resources/fixtures/recorded/docs/modifiers/ordinalScope5.yml index b791f60427..9883818326 100644 --- a/resources/fixtures/recorded/docs/modifiers/ordinalScope5.yml +++ b/resources/fixtures/recorded/docs/modifiers/ordinalScope5.yml @@ -27,8 +27,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 5} + hatTokenMap: + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/ordinalScope6.yml b/resources/fixtures/recorded/docs/modifiers/ordinalScope6.yml index 5a5c374d9e..48006de03d 100644 --- a/resources/fixtures/recorded/docs/modifiers/ordinalScope6.yml +++ b/resources/fixtures/recorded/docs/modifiers/ordinalScope6.yml @@ -27,8 +27,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/relativeScope.yml b/resources/fixtures/recorded/docs/modifiers/relativeScope.yml index e5d6a955a3..b69741c76f 100644 --- a/resources/fixtures/recorded/docs/modifiers/relativeScope.yml +++ b/resources/fixtures/recorded/docs/modifiers/relativeScope.yml @@ -19,8 +19,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 7} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/relativeScope2.yml b/resources/fixtures/recorded/docs/modifiers/relativeScope2.yml index 30a1f299aa..e798761348 100644 --- a/resources/fixtures/recorded/docs/modifiers/relativeScope2.yml +++ b/resources/fixtures/recorded/docs/modifiers/relativeScope2.yml @@ -19,8 +19,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 2} + hatTokenMap: + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} diff --git a/resources/fixtures/recorded/docs/modifiers/relativeScope3.yml b/resources/fixtures/recorded/docs/modifiers/relativeScope3.yml index 0a167f471f..0bebff729c 100644 --- a/resources/fixtures/recorded/docs/modifiers/relativeScope3.yml +++ b/resources/fixtures/recorded/docs/modifiers/relativeScope3.yml @@ -19,8 +19,80 @@ initialState: - anchor: {line: 0, character: 1} active: {line: 0, character: 1} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 4} active: {line: 0, character: 8} + hatTokenMap: + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/relativeScope4.yml b/resources/fixtures/recorded/docs/modifiers/relativeScope4.yml index 3f5b865b77..4b85fafe1f 100644 --- a/resources/fixtures/recorded/docs/modifiers/relativeScope4.yml +++ b/resources/fixtures/recorded/docs/modifiers/relativeScope4.yml @@ -19,8 +19,80 @@ initialState: - anchor: {line: 0, character: 7} active: {line: 0, character: 7} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 1} active: {line: 0, character: 5} + hatTokenMap: + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/startOf.yml b/resources/fixtures/recorded/docs/modifiers/startOf.yml index 114206779c..06e798f5b9 100644 --- a/resources/fixtures/recorded/docs/modifiers/startOf.yml +++ b/resources/fixtures/recorded/docs/modifiers/startOf.yml @@ -17,8 +17,40 @@ initialState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} diff --git a/resources/fixtures/recorded/docs/modifiers/toRawSelection.yml b/resources/fixtures/recorded/docs/modifiers/toRawSelection.yml index 268a4e593a..f1a95641a1 100644 --- a/resources/fixtures/recorded/docs/modifiers/toRawSelection.yml +++ b/resources/fixtures/recorded/docs/modifiers/toRawSelection.yml @@ -17,8 +17,35 @@ initialState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // world selections: - anchor: {line: 0, character: 3} active: {line: 0, character: 3} + hatTokenMap: + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 6} + end: {line: 0, character: 7} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/trailing.yml b/resources/fixtures/recorded/docs/modifiers/trailing.yml index 58849c086e..bafe2d3815 100644 --- a/resources/fixtures/recorded/docs/modifiers/trailing.yml +++ b/resources/fixtures/recorded/docs/modifiers/trailing.yml @@ -15,8 +15,40 @@ initialState: - anchor: {line: 0, character: 6} active: {line: 0, character: 6} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} finalState: documentContents: // Hello world selections: - anchor: {line: 0, character: 8} active: {line: 0, character: 9} + hatTokenMap: + - hatStyle: default + grapheme: r + hatRange: + start: {line: 0, character: 11} + end: {line: 0, character: 12} + - hatStyle: default + grapheme: e + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: / + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} diff --git a/resources/fixtures/recorded/docs/modifiers/trailing2.yml b/resources/fixtures/recorded/docs/modifiers/trailing2.yml index 73985cd35e..75ff58eb9b 100644 --- a/resources/fixtures/recorded/docs/modifiers/trailing2.yml +++ b/resources/fixtures/recorded/docs/modifiers/trailing2.yml @@ -17,8 +17,80 @@ initialState: - anchor: {line: 0, character: 4} active: {line: 0, character: 4} marks: {} + hatTokenMap: + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} finalState: documentContents: "[1, 2, 3]" selections: - anchor: {line: 0, character: 5} active: {line: 0, character: 7} + hatTokenMap: + - hatStyle: default + grapheme: "3" + hatRange: + start: {line: 0, character: 7} + end: {line: 0, character: 8} + - hatStyle: default + grapheme: "]" + hatRange: + start: {line: 0, character: 8} + end: {line: 0, character: 9} + - hatStyle: default + grapheme: "," + hatRange: + start: {line: 0, character: 5} + end: {line: 0, character: 6} + - hatStyle: default + grapheme: "2" + hatRange: + start: {line: 0, character: 4} + end: {line: 0, character: 5} + - hatStyle: blue + grapheme: "," + hatRange: + start: {line: 0, character: 2} + end: {line: 0, character: 3} + - hatStyle: default + grapheme: "1" + hatRange: + start: {line: 0, character: 1} + end: {line: 0, character: 2} + - hatStyle: default + grapheme: "[" + hatRange: + start: {line: 0, character: 0} + end: {line: 0, character: 1} From 1d45603fe918fe4e3191f2c6c442888d2dd5cdfe Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 4 Sep 2026 03:07:37 +0200 Subject: [PATCH 3/3] Pulse mark hats --- .../app-web-docs/src/docs/components/Code.css | 19 ++++ .../components/RecordedTestVisualizer.tsx | 107 +++++++++++++++--- 2 files changed, 110 insertions(+), 16 deletions(-) diff --git a/packages/app-web-docs/src/docs/components/Code.css b/packages/app-web-docs/src/docs/components/Code.css index cb5ea84479..dfcb7e4619 100644 --- a/packages/app-web-docs/src/docs/components/Code.css +++ b/packages/app-web-docs/src/docs/components/Code.css @@ -160,3 +160,22 @@ .code-hat-yellow::before { background-color: #e5c02c; } + +/* Code hat referenced */ + +.code-hat-referenced::before { + animation: code-hat-referenced-pulse 2s ease-in-out infinite; +} + +@keyframes code-hat-referenced-pulse { + 50% { + background-color: var(--code-hat-referenced-color); + } +} + +@media (prefers-reduced-motion: reduce) { + .code-hat-referenced::before { + background-color: var(--code-hat-referenced-color); + animation: none; + } +} diff --git a/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx b/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx index bce4bde072..186086c78a 100644 --- a/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx +++ b/packages/app-web-docs/src/docs/components/RecordedTestVisualizer.tsx @@ -3,11 +3,16 @@ import type { Dispatch, JSX, ReactNode, SetStateAction } from "react"; import { createContext, useContext, useMemo, useState } from "react"; import type { DecorationItem } from "shiki"; import type { - SelectionPlainObject, + Position, + Selection, TestCaseSnapshot, } from "@cursorless/lib-common"; -import { plainObjectToSelection } from "@cursorless/lib-common"; +import { + plainObjectToRange, + plainObjectToSelection, +} from "@cursorless/lib-common"; import { Code } from "./Code"; +import { highlightColors } from "./highlightColors"; import type { RecordedTest } from "./types"; interface RecordedTestVisualizerContextValue { @@ -97,12 +102,17 @@ export function RecordedTestVisualizer({ url: `https://github.com/cursorless-dev/cursorless/blob/main/resources/fixtures/recorded/docs/${path}`, }; + const renderHats = + fixture.initialState.marks != null && + Object.keys(fixture.initialState.marks).length > 0; + return (
Input [...state.selections.map(toDecoration), ...toHatDecorations(state)], - [state], + () => toDecorations(state, renderHats), + [state, renderHats], ); return ( <> @@ -162,9 +175,7 @@ function CodeState({ ); } -function toDecoration(plainSelection: SelectionPlainObject): DecorationItem { - const selection = plainObjectToSelection(plainSelection); - +function toDecoration(selection: Selection): DecorationItem { const cursorClassName = selection.isReversed ? "code-cursor-before" : "code-cursor-after"; @@ -183,19 +194,83 @@ function toDecoration(plainSelection: SelectionPlainObject): DecorationItem { }; } -function toHatDecorations(state: TestCaseSnapshot): DecorationItem[] { - if (state.hatTokenMap == null) { +function toDecorations( + state: TestCaseSnapshot, + renderHats: boolean, +): DecorationItem[] { + const selections = state.selections.map(plainObjectToSelection); + const hatRanges = renderHats + ? (state.hatTokenMap ?? []).map(({ hatRange }) => + plainObjectToRange(hatRange), + ) + : []; + + // Shiki rejects intersecting decorations. A zero-width cursor at the end of + // a hat range intersects the hat decoration, so render both on one wrapper. + // We only merge at the end because code-cursor-after recreates that exact + // boundary without competing with the hat's ::before pseudo-element. + const mergedCursorPositions = selections + .filter( + (selection) => + selection.isEmpty && + hatRanges.some(({ end }) => end.isEqual(selection.active)), + ) + .map(({ active }) => active); + + return [ + // Omit cursors that the corresponding hat decoration will render instead. + ...selections + .filter( + (selection) => + !selection.isEmpty || + !mergedCursorPositions.some((position) => + position.isEqual(selection.active), + ), + ) + .map(toDecoration), + ...toHatDecorations(state, renderHats, mergedCursorPositions), + ]; +} + +function toHatDecorations( + state: TestCaseSnapshot, + renderHats: boolean, + mergedCursorPositions: readonly Position[], +): DecorationItem[] { + if (!renderHats || state.hatTokenMap == null) { return []; } - return state.hatTokenMap.map(({ hatStyle, hatRange }) => ({ - start: hatRange.start, - end: hatRange.end, - alwaysWrap: true, - properties: { + const markRanges = Object.values(state.marks ?? {}).map(plainObjectToRange); + + return state.hatTokenMap.map(({ hatStyle, hatRange }) => { + const range = plainObjectToRange(hatRange); + const properties: DecorationItem["properties"] = { className: ["code-hat", `code-hat-${hatStyle}`], - }, - })); + }; + + const isReferenced = markRanges.some((markRange) => + markRange.contains(range), + ); + + if (isReferenced) { + properties.className?.push("code-hat-referenced"); + properties.style = `--code-hat-referenced-color: ${highlightColors.content.background};`; + } + + if (mergedCursorPositions.some((position) => position.isEqual(range.end))) { + // The hat uses ::before and the cursor uses ::after, allowing both + // visuals to share this wrapper without overlapping Shiki decorations. + properties.className?.push("code-cursor-after"); + } + + return { + start: hatRange.start, + end: hatRange.end, + alwaysWrap: true, + properties, + }; + }); } function useRecordedTestVisualizer(): RecordedTestVisualizerContextValue {