diff --git a/src/core/tokenizer.ts b/src/core/tokenizer.ts index 17b5a21891..0bf8e41c64 100644 --- a/src/core/tokenizer.ts +++ b/src/core/tokenizer.ts @@ -1,3 +1,5 @@ +import { matchAll } from "../util/regex"; + const REPEATABLE_SYMBOLS = [ "+", "-", @@ -55,7 +57,7 @@ export function tokenize( text: string, mapfn: (v: RegExpMatchArray, k: number) => T ) { - return Array.from(text.matchAll(TOKEN_MATCHER), mapfn); + return matchAll(text, TOKEN_MATCHER, mapfn); } //https://stackoverflow.com/a/6969486 diff --git a/src/errors.ts b/src/errors.ts new file mode 100644 index 0000000000..05ce1de02e --- /dev/null +++ b/src/errors.ts @@ -0,0 +1,8 @@ +export class UnsupportedLanguageError extends Error { + constructor(languageId: string) { + super( + `Language '${languageId}' is not implemented yet; See https://github.com/pokey/cursorless-vscode/blob/main/docs/adding-a-new-language.md` + ); + this.name = "UnsupportedLanguageError"; + } +} diff --git a/src/languages/index.ts b/src/languages/index.ts index 64e8fa9723..30458856b6 100644 --- a/src/languages/index.ts +++ b/src/languages/index.ts @@ -13,6 +13,7 @@ import java from "./java"; import json from "./json"; import python from "./python"; import typescript from "./typescript"; +import { UnsupportedLanguageError } from "../errors"; const languageMatchers: Record> = { c: cpp, @@ -36,9 +37,7 @@ export function getNodeMatcher( const matchers = languageMatchers[languageId]; if (matchers == null) { - throw Error( - `Language '${languageId}' is not implemented yet; See https://github.com/pokey/cursorless-vscode/blob/main/docs/adding-a-new-language.md` - ); + throw new UnsupportedLanguageError(languageId); } const matcher = matchers[scopeType]; diff --git a/src/languages/surroundingPair.ts b/src/languages/surroundingPair.ts deleted file mode 100644 index ec972cf47e..0000000000 --- a/src/languages/surroundingPair.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { maxBy, zip } from "lodash"; -import { Position, Selection } from "vscode"; -import { Point, SyntaxNode } from "web-tree-sitter"; -import { - Delimiter, - NodeMatcher, - NodeMatcherValue, - SelectionWithEditor, -} from "../typings/Types"; - -function positionFromPoint(point: Point): Position { - return new Position(point.row, point.column); -} - -const delimiterToText: Record = { - squareBrackets: ["[", "]"], - curlyBrackets: ["{", "}"], - angleBrackets: ["<", ">"], - parentheses: ["(", ")"], - singleQuotes: ["'", "'"], - doubleQuotes: ['"', '"'], - backtickQuotes: ["`", "`"], - whitespace: [" ", " "], // TODO: Fix this to handle tabs / newlines - escapedSingleQuotes: ["\\'", "\\'"], - escapedDoubleQuotes: ['\\"', '\\"'], -}; - -const leftToRightMap: Record = Object.fromEntries( - Object.values(delimiterToText) -); - -export function createSurroundingPairMatcher( - delimiter: Delimiter | null, - delimitersOnly: boolean -): NodeMatcher { - return function nodeMatcher( - selection: SelectionWithEditor, - node: SyntaxNode - ) { - const delimitersToCheck = - delimiter == null ? Object.keys(delimiterToText) : [delimiter]; - - const leftDelimiterTypes = delimitersToCheck.map( - (delimiter) => delimiterToText[delimiter][0] - ); - - const leftDelimiterNodes = node.children.filter( - (child) => - leftDelimiterTypes.includes(child.type) && - positionFromPoint(child.startPosition).isBeforeOrEqual( - selection.selection.start - ) - ); - - if (leftDelimiterNodes.length === 0) { - return null; - } - - const leftDelimiterNode = leftDelimiterNodes[leftDelimiterNodes.length - 1]; - const rightDelimiterType = leftToRightMap[leftDelimiterNode.type]; - - const rightDelimiterNode = node.children.find( - (child) => - child.type === rightDelimiterType && child !== leftDelimiterNode - ); - - if (rightDelimiterNode == null) { - return null; - } - - return extractSelection( - leftDelimiterNode, - rightDelimiterNode, - delimitersOnly - ); - }; -} - -function extractSelection( - leftDelimiterNode: SyntaxNode, - rightDelimiterNode: SyntaxNode, - delimitersOnly: boolean -): NodeMatcherValue[] { - if (delimitersOnly === false) { - return [ - { - node: leftDelimiterNode, - selection: { - selection: new Selection( - positionFromPoint(leftDelimiterNode.endPosition), - positionFromPoint(rightDelimiterNode.startPosition) - ), - context: { - outerSelection: new Selection( - positionFromPoint(leftDelimiterNode.startPosition), - positionFromPoint(rightDelimiterNode.endPosition) - ), - }, - }, - }, - ]; - } else { - return [ - { - node: leftDelimiterNode, - selection: { - selection: new Selection( - positionFromPoint(leftDelimiterNode.startPosition), - positionFromPoint(leftDelimiterNode.endPosition) - ), - context: {}, - }, - }, - { - node: rightDelimiterNode, - selection: { - selection: new Selection( - positionFromPoint(rightDelimiterNode.startPosition), - positionFromPoint(rightDelimiterNode.endPosition) - ), - context: {}, - }, - }, - ]; - } -} diff --git a/src/processTargets/index.ts b/src/processTargets/index.ts index f71367b9f7..0fdd07c028 100644 --- a/src/processTargets/index.ts +++ b/src/processTargets/index.ts @@ -9,7 +9,7 @@ import { TypedSelection, } from "../typings/Types"; import processMark from "./processMark"; -import processModifier from "./processModifier"; +import processModifier from "./modifiers/processModifier"; import processPosition from "./processPosition"; import processSelectionType from "./processSelectionType"; import { isForward as getIsForward } from "../util/selectionUtils"; diff --git a/src/processTargets/processModifier.ts b/src/processTargets/modifiers/processModifier.ts similarity index 85% rename from src/processTargets/processModifier.ts rename to src/processTargets/modifiers/processModifier.ts index e4384920dc..8a793b22b3 100644 --- a/src/processTargets/processModifier.ts +++ b/src/processTargets/modifiers/processModifier.ts @@ -2,10 +2,9 @@ import update from "immutability-helper"; import { range } from "lodash"; import { Location, Position, Range, Selection } from "vscode"; import { SyntaxNode } from "web-tree-sitter"; -import { SUBWORD_MATCHER } from "../core/constants"; -import { getNodeMatcher } from "../languages"; -import { createSurroundingPairMatcher } from "../languages/surroundingPair"; -import { selectionWithEditorFromRange } from "../util/selectionUtils"; +import { SUBWORD_MATCHER } from "../../core/constants"; +import { getNodeMatcher } from "../../languages"; +import { selectionWithEditorFromRange } from "../../util/selectionUtils"; import { ContainingScopeModifier, HeadModifier, @@ -15,11 +14,11 @@ import { SelectionContext, SelectionWithEditor, SubTokenModifier, - SurroundingPairModifier, TailModifier, -} from "../typings/Types"; +} from "../../typings/Types"; +import { processSurroundingPair } from "./surroundingPair"; -type SelectionWithContext = { +export type SelectionWithEditorWithContext = { selection: SelectionWithEditor; context: SelectionContext; }; @@ -28,7 +27,7 @@ export default function ( context: ProcessedTargetsContext, target: PrimitiveTarget, selection: SelectionWithEditor -): SelectionWithContext[] { +): SelectionWithEditorWithContext[] { const { modifier } = target; let result; @@ -66,7 +65,7 @@ function processScopeType( context: ProcessedTargetsContext, selection: SelectionWithEditor, modifier: ContainingScopeModifier -): SelectionWithContext[] | null { +): SelectionWithEditorWithContext[] | null { const nodeMatcher = getNodeMatcher( selection.editor.document.languageId, modifier.scopeType, @@ -93,7 +92,7 @@ function processSubToken( context: ProcessedTargetsContext, selection: SelectionWithEditor, modifier: SubTokenModifier -): SelectionWithContext[] | null { +): SelectionWithEditorWithContext[] | null { const token = selection.editor.document.getText(selection.selection); let pieces: { start: number; end: number }[] = []; @@ -190,7 +189,7 @@ function processHeadTail( context: ProcessedTargetsContext, selection: SelectionWithEditor, modifier: HeadModifier | TailModifier -): SelectionWithContext[] | null { +): SelectionWithEditorWithContext[] | null { let anchor: Position, active: Position; if (modifier.type === "head") { anchor = selection.selection.end; @@ -210,22 +209,7 @@ function processHeadTail( ]; } -function processSurroundingPair( - context: ProcessedTargetsContext, - selection: SelectionWithEditor, - modifier: SurroundingPairModifier -): SelectionWithContext[] | null { - const node: SyntaxNode | null = context.getNodeAtLocation( - new Location(selection.editor.document.uri, selection.selection) - ); - const nodeMatcher = createSurroundingPairMatcher( - modifier.delimiter, - modifier.delimitersOnly - ); - return findNearestContainingAncestorNode(node, nodeMatcher, selection); -} - -function findNearestContainingAncestorNode( +export function findNearestContainingAncestorNode( startNode: SyntaxNode, nodeMatcher: NodeMatcher, selection: SelectionWithEditor diff --git a/src/processTargets/modifiers/surroundingPair/constants.ts b/src/processTargets/modifiers/surroundingPair/constants.ts new file mode 100644 index 0000000000..ddea06bf64 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/constants.ts @@ -0,0 +1,14 @@ +// XXX: Make this language-specific if it starts to get unwieldy +/** + * A list of node types that are allowed to be parents of an angle bracket. + * Having this list allows us to avoid trying to treat a greater-than sign as an + * angle bracket + */ +export const ALLOWABLE_ANGLE_BRACKET_PARENTS = [ + "end_tag", + "jsx_closing_element", + "jsx_opening_element", + "jsx_self_closing_element", + "self_closing_tag", + "start_tag", +]; diff --git a/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts b/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts new file mode 100644 index 0000000000..d973ac8866 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/delimiterMaps.ts @@ -0,0 +1,38 @@ +import { + ComplexSurroundingPairName, + SimpleSurroundingPairName, +} from "../../../typings/Types"; + +type IndividualDelimiterText = string | string[]; + +export const delimiterToText: Record< + SimpleSurroundingPairName, + [IndividualDelimiterText, IndividualDelimiterText] +> = { + angleBrackets: ["<", ">"], + backtickQuotes: ["`", "`"], + curlyBrackets: [["{", "${"], "}"], + doubleQuotes: ['"', '"'], + escapedDoubleQuotes: ['\\"', '\\"'], + escapedParentheses: ["\\(", "\\)"], + escapedSingleQuotes: ["\\'", "\\'"], + parentheses: [["(", "$("], ")"], + singleQuotes: ["'", "'"], + squareBrackets: ["[", "]"], +}; + +export const leftToRightMap: Record = Object.fromEntries( + Object.values(delimiterToText) +); + +/** + * Some surrounding pair scope types are really just shorthand for multiple + * acceptable delimiters. This map defines these surrounding pairs. + */ +export const complexDelimiterMap: Record< + ComplexSurroundingPairName, + SimpleSurroundingPairName[] +> = { + any: Object.keys(delimiterToText), + string: ["singleQuotes", "doubleQuotes", "backtickQuotes"], +}; diff --git a/src/processTargets/modifiers/surroundingPair/extractSelectionFromSurroundingPairOffsets.ts b/src/processTargets/modifiers/surroundingPair/extractSelectionFromSurroundingPairOffsets.ts new file mode 100644 index 0000000000..65f655eeb7 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/extractSelectionFromSurroundingPairOffsets.ts @@ -0,0 +1,82 @@ +import { Selection, TextDocument } from "vscode"; +import { + DelimiterInclusion, + SelectionWithContext, +} from "../../../typings/Types"; +import { SurroundingPairOffsets } from "./types"; + +/** + * Given offsets describing a surrounding pair, returns a selection + * + * @param document The document containing the pairs + * @param baseOffset The base offset to be added to all given offsets + * @param surroundingPairOffsets A pair of start/end offsets corresponding to a delimiter pair + * @param delimiterInclusion Whether to include / exclude the delimiters themselves + * @returns A selection corresponding to the delimiter pair + */ +export function extractSelectionFromSurroundingPairOffsets( + document: TextDocument, + baseOffset: number, + surroundingPairOffsets: SurroundingPairOffsets, + delimiterInclusion: DelimiterInclusion +): SelectionWithContext[] { + // If delimiter inclusion is null, do default behavior and include the + // delimiters + if (delimiterInclusion == null) { + return [ + { + selection: new Selection( + document.positionAt( + baseOffset + surroundingPairOffsets.leftDelimiter.start + ), + document.positionAt( + baseOffset + surroundingPairOffsets.rightDelimiter.end + ) + ), + context: {}, + }, + ]; + } + + switch (delimiterInclusion) { + case "interiorOnly": + return [ + { + selection: new Selection( + document.positionAt( + baseOffset + surroundingPairOffsets.leftDelimiter.end + ), + document.positionAt( + baseOffset + surroundingPairOffsets.rightDelimiter.start + ) + ), + context: {}, + }, + ]; + case "excludeInterior": + return [ + { + selection: new Selection( + document.positionAt( + baseOffset + surroundingPairOffsets.leftDelimiter.start + ), + document.positionAt( + baseOffset + surroundingPairOffsets.leftDelimiter.end + ) + ), + context: {}, + }, + { + selection: new Selection( + document.positionAt( + baseOffset + surroundingPairOffsets.rightDelimiter.start + ), + document.positionAt( + baseOffset + surroundingPairOffsets.rightDelimiter.end + ) + ), + context: {}, + }, + ]; + } +} diff --git a/src/processTargets/modifiers/surroundingPair/findDelimiterPairAdjacentToSelection.ts b/src/processTargets/modifiers/surroundingPair/findDelimiterPairAdjacentToSelection.ts new file mode 100644 index 0000000000..42ad36b765 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/findDelimiterPairAdjacentToSelection.ts @@ -0,0 +1,67 @@ +import { getSurroundingPairOffsets } from "./getSurroundingPairOffsets"; +import { + SurroundingPairOffsets, + Offsets, + PossibleDelimiterOccurrence, + DelimiterOccurrence, +} from "./types"; +import { findOppositeDelimiter } from "./findOppositeDelimiter"; + +/** + * Looks for a surrounding pair where one of its delimiters contains the entire selection. + * + * @param initialIndex The index of the first delimiter to try within the delimiter occurrences list. Expected to be + * the index of the first delimiter whose end offset is greater than or equal to + * the end offset of the selection. + * @param delimiterOccurrences A list of delimiter occurrences. Expected to be sorted by offsets + * @param selectionOffsets The offsets of the selection + * @param bailOnUnmatchedAdjacent If `true`, immediately return null if we find + * an adjacent delimiter that we can't find a match for. This variable will + * be true if the current iteration can't see the full document. In that + * case, we'd like to fail and let a subsequent pass try again in case + * the matching delimiter is outside the range we're looking. + * @returns The offsets of a surrounding pair, one of whose delimiters is + * adjacent to or containing the selection. Returns `null` if such a pair + * can't be found in the given list of delimiter occurrences. + */ +export function findDelimiterPairAdjacentToSelection( + initialIndex: number, + delimiterOccurrences: PossibleDelimiterOccurrence[], + selectionOffsets: Offsets, + forceDirection: "left" | "right" | undefined, + bailOnUnmatchedAdjacent: boolean = false +): SurroundingPairOffsets | null { + const indicesToTry = [initialIndex + 1, initialIndex]; + + for (const index of indicesToTry) { + const delimiterOccurrence = delimiterOccurrences[index]; + + if ( + delimiterOccurrence != null && + delimiterOccurrence.offsets.start <= selectionOffsets.start && + delimiterOccurrence.offsets.end >= selectionOffsets.end + ) { + const { delimiterInfo } = delimiterOccurrence; + + if (delimiterInfo != null) { + const possibleMatch = findOppositeDelimiter( + delimiterOccurrences, + index, + delimiterInfo, + forceDirection + ); + + if (possibleMatch != null) { + return getSurroundingPairOffsets( + delimiterOccurrence as DelimiterOccurrence, + possibleMatch + ); + } else if (bailOnUnmatchedAdjacent) { + return null; + } + } + } + } + + return null; +} diff --git a/src/processTargets/modifiers/surroundingPair/findDelimiterPairContainingSelection.ts b/src/processTargets/modifiers/surroundingPair/findDelimiterPairContainingSelection.ts new file mode 100644 index 0000000000..6d10a5ad3a --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/findDelimiterPairContainingSelection.ts @@ -0,0 +1,95 @@ +import { getSurroundingPairOffsets } from "./getSurroundingPairOffsets"; +import { + SurroundingPairOffsets, + PossibleDelimiterOccurrence, + Offsets, +} from "./types"; +import { generateUnmatchedDelimiters } from "./generateUnmatchedDelimiters"; +import { SimpleSurroundingPairName } from "../../../typings/Types"; + +/** + * Looks for a surrounding pair that contains the selection, returning null if none is found. + * + * Our approach is to first initialize two generators, one scanning rightwards + * and one scanning leftwards. The generator scanning rightwards starts at the + * first delimiter whose end offset is greater than or equal to the end offset + * of the selection. The generator scanning leftwards starts at the token just + * prior to the start token for the rightward scanner. + * + * We start with the right generator, proceeding until we find any acceptable + * unmatched closing delimiter. We then advance the left generator, looking + * only for an unmatched opening delimiter that matches the closing delimiter + * we found in our rightward scan. + * + * If the delimiter found by our leftward scan is before or equal to the start + * of the selection, we return the delimiter pair. If not, we loop back and + * scan left / right again, repeating the process until our leftward or + * rightward scan runs out of delimiters. + * + * @param initialIndex The index of the first delimiter to try within the delimiter occurrences list. Expected to be + * the index of the first delimiter whose end offset is greater than or equal to + * the end offset of the selection. + * @param delimiterOccurrences A list of delimiter occurrences. Expected to be sorted by offsets + * @param acceptableDelimiters A list of names of acceptable delimiters to look for + * @param selectionOffsets The offsets of the selection + * @returns The offsets of the surrounding pair containing the selection, or + * null if none is found + */ +export function findDelimiterPairContainingSelection( + initialIndex: number, + delimiterOccurrences: PossibleDelimiterOccurrence[], + acceptableDelimiters: SimpleSurroundingPairName[], + selectionOffsets: Offsets +): SurroundingPairOffsets | null { + // Accept any delimiter when scanning right + const acceptableRightDelimiters = acceptableDelimiters; + + // When scanning left, we'll populate this list with just the delimiter we + // found on our rightward pass. + let acceptableLeftDelimiters: SimpleSurroundingPairName[] = []; + + const rightDelimiterGenerator = generateUnmatchedDelimiters( + delimiterOccurrences, + initialIndex, + () => acceptableRightDelimiters, + true + ); + + // Start just to the left of the delimiter we start from in our rightward + // pass + const leftDelimiterGenerator = generateUnmatchedDelimiters( + delimiterOccurrences, + initialIndex - 1, + () => acceptableLeftDelimiters, + false + ); + + while (true) { + // Scan right until we find an acceptable unmatched closing delimiter + let rightNext = rightDelimiterGenerator.next(); + if (rightNext.done) { + return null; + } + let rightDelimiterOccurrence = rightNext.value!; + + // Then scan left until we find an unmatched delimiter matching the + // delimiter we found in our rightward pass. + acceptableLeftDelimiters = [ + rightDelimiterOccurrence.delimiterInfo.delimiter, + ]; + let leftNext = leftDelimiterGenerator.next(); + if (leftNext.done) { + return null; + } + let leftDelimiterOccurrence = leftNext.value!; + + // If left delimiter is left of our selection, we return it. Otherwise + // loop back and continue scanning outwards. + if (leftDelimiterOccurrence.offsets.start <= selectionOffsets.start) { + return getSurroundingPairOffsets( + leftDelimiterOccurrence, + rightDelimiterOccurrence + ); + } + } +} diff --git a/src/processTargets/modifiers/surroundingPair/findOppositeDelimiter.ts b/src/processTargets/modifiers/surroundingPair/findOppositeDelimiter.ts new file mode 100644 index 0000000000..c2e6342725 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/findOppositeDelimiter.ts @@ -0,0 +1,66 @@ +import { SurroundingPairDirection } from "../../../typings/Types"; +import { findUnmatchedDelimiter } from "./generateUnmatchedDelimiters"; +import { + DelimiterOccurrence, + DelimiterSide, + IndividualDelimiter, + PossibleDelimiterOccurrence, +} from "./types"; + +/** + * Given a delimiter, scans in the appropriate direction for a matching + * opposite delimiter. If we don't know which direction the delimiter is facing + * (eg for a `"`), we first scan right, then left if nothing is found to the + * right. This algorithm will get confused in text files, but keep in mind + * that for languages with a parse tree, the delimiter occurrence will usually + * know which direction it is based on where it sits in the parse tree. That + * information will be reflected on the `IndividualDelimiter` itself. + * + * @param delimiterOccurrences A list of delimiter occurrences. Expected to be sorted by offsets + * @param index The index of the delimiter whose opposite we're looking for + * @param delimiterInfo The delimiter info for the delimiter occurrence at the + * given index. Just passed through for efficiency rather than having to + * look it up again. Equivalent to `delimiterOccurrences[index].delimiterInfo` + * @returns The opposite delimiter, if found; otherwise `null` + */ +export function findOppositeDelimiter( + delimiterOccurrences: PossibleDelimiterOccurrence[], + index: number, + delimiterInfo: IndividualDelimiter, + forceDirection: "left" | "right" | undefined +): DelimiterOccurrence | null { + const { side, delimiter } = delimiterInfo; + + for (const direction of getDirections(side, forceDirection)) { + const unmatchedDelimiter = findUnmatchedDelimiter( + delimiterOccurrences, + direction === "right" ? index + 1 : index - 1, + [delimiter], + direction === "right" + ); + + if (unmatchedDelimiter != null) { + return unmatchedDelimiter; + } + } + + return null; +} + +function getDirections( + side: DelimiterSide, + forceDirection: SurroundingPairDirection | undefined +): SurroundingPairDirection[] { + if (forceDirection != null) { + return [forceDirection]; + } + + switch (side) { + case "left": + return ["right"]; + case "right": + return ["left"]; + case "unknown": + return ["right", "left"]; + } +} diff --git a/src/processTargets/modifiers/surroundingPair/findSurroundingPairCore.ts b/src/processTargets/modifiers/surroundingPair/findSurroundingPairCore.ts new file mode 100644 index 0000000000..9cf1d883d3 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/findSurroundingPairCore.ts @@ -0,0 +1,75 @@ +import { sortedIndexBy } from "lodash"; +import { SimpleSurroundingPairName } from "../../../typings/Types"; +import { findDelimiterPairAdjacentToSelection } from "./findDelimiterPairAdjacentToSelection"; +import { findDelimiterPairContainingSelection } from "./findDelimiterPairContainingSelection"; +import { + SurroundingPairOffsets, + Offsets, + PossibleDelimiterOccurrence, +} from "./types"; + +/** + * This function implements the core high-level surrounding pair algorithm + * shared by both the parse tree and textual implementations. + * + * We first look for any delimiter pair where one of the delimiters itself + * contains our selection, for example if the user refers to a mark which is a + * delimiter token, or if the user's cursor is right next to a delimiter. + * + * If we don't find a delimiter pair that way, we instead look for the smallest + * delimiter pair that contains the selection. + * + * @param delimiterOccurrences A list of delimiter occurrences. Expected to be sorted by offsets + * @param acceptableDelimiters A list of names of acceptable delimiters to look for + * @param selectionOffsets The offsets of the selection + * @param bailOnUnmatchedAdjacent If `true`, immediately return null if we find + * an adjacent delimiter that we can't find a match for. This variable will + * be true if the current iteration can't see the full document. In that + * case, we'd like to fail and let a subsequent pass try again in case + * the matching delimiter is outside the range we're looking. + * @returns + */ +export function findSurroundingPairCore( + forceDirection: "left" | "right" | undefined, + delimiterOccurrences: PossibleDelimiterOccurrence[], + acceptableDelimiters: SimpleSurroundingPairName[], + selectionOffsets: Offsets, + bailOnUnmatchedAdjacent: boolean = false +): SurroundingPairOffsets | null { + /** + * The initial index from which to start both of our searches. We set this + * index to the index of the first delimiter whose end offset is greater than + * or equal to the end offset of the selection. + */ + const initialIndex = sortedIndexBy<{ + offsets: Offsets; + }>( + delimiterOccurrences, + { + offsets: selectionOffsets, + }, + "offsets.end" + ); + + // First look for delimiter pair where one delimiter contains the selection. + const delimiterPairAdjacentToSelection: SurroundingPairOffsets | null = + findDelimiterPairAdjacentToSelection( + initialIndex, + delimiterOccurrences, + selectionOffsets, + forceDirection, + bailOnUnmatchedAdjacent + ); + + if (delimiterPairAdjacentToSelection != null) { + return delimiterPairAdjacentToSelection; + } + + // Then look for the smallest delimiter pair containing the selection. + return findDelimiterPairContainingSelection( + initialIndex, + delimiterOccurrences, + acceptableDelimiters, + selectionOffsets + ); +} diff --git a/src/processTargets/modifiers/surroundingPair/findSurroundingPairParseTreeBased.ts b/src/processTargets/modifiers/surroundingPair/findSurroundingPairParseTreeBased.ts new file mode 100644 index 0000000000..b47869bbff --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/findSurroundingPairParseTreeBased.ts @@ -0,0 +1,259 @@ +import { Selection, TextDocument, TextEditor } from "vscode"; +import { SyntaxNode } from "web-tree-sitter"; +import { + SimpleSurroundingPairName, + DelimiterInclusion, + SurroundingPairDirection, +} from "../../../typings/Types"; +import { getNodeRange } from "../../../util/nodeSelectors"; +import { ALLOWABLE_ANGLE_BRACKET_PARENTS } from "./constants"; +import { extractSelectionFromSurroundingPairOffsets } from "./extractSelectionFromSurroundingPairOffsets"; +import { findSurroundingPairCore } from "./findSurroundingPairCore"; +import { getIndividualDelimiters } from "./getIndividualDelimiters"; +import { + DelimiterSide, + IndividualDelimiter, + Offsets, + PossibleDelimiterOccurrence, +} from "./types"; + +/** + * Implements the version of the surrounding pair finding algorithm that + * leverages the parse tree. We use this algorithm when we are in a language + * for which we have parser support, unless we are in a string or comment, where + * we revert to text-based. + * + * The approach is actually roughly the same as the approach we use when we do + * not have access to a parse tree. In both cases we create a list of + * candidate delimiters in the region of the selection, and then pass them to + * the core algorithm, implemented by findSurroundingPairCore. + * + * To generate a list of delimiters to pass to findSurroundingPairCore, we repeatedly walk up the parse tree starting at the given node. Each time, we ask for all descendant tokens whose type is that of one of the delimiters that we're looking for. + * repeatedly walk up the parse tree starting at the given node. Each time, we + * ask for all descendant tokens whose type is that of one of the delimiters + * that we're looking for, and pass this list of tokens to + * findSurroundingPairCore. + * + * Note that walking up the hierarchy one parent at a time is just an + * optimization to avoid handling the entire file if we don't need to. The + * result would be the same if we just operated on the root node of the parse + * tree, just slower if our delimiter pair is actually contained in a small + * piece of a large file. + * + * The main benefits of the parse tree-based approach over the text-based + * approach are the following: + * + * - We can leverage the lexer to ensure that we only consider proper language tokens + * - We can let the language normalize surface forms of delimiter types, so eg + * in Python the leading `f"` on an f-string just has type `"` like any other + * string. + * - We can more easily narrow the scope of our search by walking up the parse tree + * - The actual lexing is done in fast wasm code rather than using a regex + * - We can disambiguate delimiters whose opening and closing symbol is the + * same (eg `"`). Without a parse tree we have to guess whether it is an + * opening or closing quote. + * + * @param editor The text editor containing the selection + * @param selection The selection to find surrounding pair around + * @param node A parse tree node overlapping with the selection + * @param delimiters The acceptable surrounding pair names + * @param delimiterInclusion Whether to include / exclude the delimiters themselves + * @returns The newly expanded selection, including editor info + */ +export function findSurroundingPairParseTreeBased( + editor: TextEditor, + selection: Selection, + node: SyntaxNode, + delimiters: SimpleSurroundingPairName[], + delimiterInclusion: DelimiterInclusion, + forceDirection: "left" | "right" | undefined +) { + const document: TextDocument = editor.document; + + const individualDelimiters = getIndividualDelimiters(delimiters); + + const delimiterTextToDelimiterInfoMap = Object.fromEntries( + individualDelimiters.map((individualDelimiter) => [ + individualDelimiter.text, + individualDelimiter, + ]) + ); + + const selectionOffsets = { + start: document.offsetAt(selection.start), + end: document.offsetAt(selection.end), + }; + + /** + * Context to pass to nested call + */ + const context: Context = { + delimiterTextToDelimiterInfoMap, + individualDelimiters, + delimiters, + selectionOffsets, + forceDirection, + }; + + // Walk up the parse tree from parent to parent until we find a node whose + // descendants contain an appropriate matching pair. + for ( + let currentNode: SyntaxNode | null = node; + currentNode != null; + currentNode = currentNode.parent + ) { + // Just bail early if the node doesn't completely contain our selection as + // it is a lost cause. + if (!getNodeRange(currentNode).contains(selection)) { + continue; + } + + // Here we apply the core algorithm + const pairOffsets = findSurroundingPairContainedInNode( + context, + currentNode + ); + + // And then perform postprocessing + if (pairOffsets != null) { + return extractSelectionFromSurroundingPairOffsets( + document, + 0, + pairOffsets, + delimiterInclusion + ).map(({ selection, context }) => ({ + selection: { selection, editor }, + context, + })); + } + } + + return null; +} + +/** + * Context to pass to nested call + */ +interface Context { + /** + * Map from raw text to info about the delimiter at that point + */ + delimiterTextToDelimiterInfoMap: { + [k: string]: IndividualDelimiter; + }; + + /** + * A list of all opening / closing delimiters that we are considering + */ + individualDelimiters: IndividualDelimiter[]; + + /** + * The names of the delimiters that we're considering + */ + delimiters: SimpleSurroundingPairName[]; + + /** + * The offsets of the selection + */ + selectionOffsets: Offsets; + + forceDirection: SurroundingPairDirection | undefined; +} + +/** + * This function is called at each node as we walk up the ancestor hierarchy + * from our start node. It finds all possible delimiters descending from the + * node and passes them to the findSurroundingPairCore algorithm. + * + * @param context Extra context to be used by this function + * @param node The current node to consider + * @returns The offsets of the matching surrounding pair, or `null` if none is found + */ +function findSurroundingPairContainedInNode( + context: Context, + node: SyntaxNode +) { + const { + delimiterTextToDelimiterInfoMap, + individualDelimiters, + delimiters, + selectionOffsets, + forceDirection, + } = context; + + /** + * A list of all delimiter nodes descending from `node`, as determined by + * their type + */ + const possibleDelimiterNodes = node.descendantsOfType( + individualDelimiters.map(({ text }) => text) + ); + + /** + * A list of all delimiter occurrences, generated from the delimiter nodes. + */ + const delimiterOccurrences: PossibleDelimiterOccurrence[] = + possibleDelimiterNodes.map((delimiterNode) => { + return { + offsets: { + start: delimiterNode.startIndex, + end: delimiterNode.endIndex, + }, + get delimiterInfo() { + const delimiterInfo = + delimiterTextToDelimiterInfoMap[delimiterNode.type]; + + // Distinguish between a greater-than sign and an angle bracket by + // looking at its parent type + if ( + delimiterInfo.delimiter === "angleBrackets" && + !ALLOWABLE_ANGLE_BRACKET_PARENTS.includes( + delimiterNode.parent?.type! + ) + ) { + return undefined; + } + + // NB: If side is `"unknown"`, ie we cannot determine whether + // something is a left or right delimiter based on its text / type + // alone (eg `"`), we assume it is a left delimiter if it is the + // first child of its parent, and right delimiter otherwise. This + // approach might not always work, but seems to work in the + // languages we've tried. + let side = + delimiterInfo.side === "unknown" && forceDirection == null + ? inferDelimiterSide(delimiterNode) + : delimiterInfo.side; + + return { + ...delimiterInfo, + side, + }; + }, + }; + }); + + // Just run core algorithm once we have our list of delimiters. + return findSurroundingPairCore( + forceDirection, + delimiterOccurrences, + delimiters, + selectionOffsets, + + // If we're not the root node of the parse tree (ie `node.parent != + // null`), we tell `findSurroundingPairCore` to bail if it finds a + // delimiter adjacent to our selection, but doesn't find its opposite + // delimiter within our list. We do so because it's possible that the + // adjacent delimiter's opposite might be found when we run again on a + // parent node later. + node.parent != null + ); +} + +function inferDelimiterSide(delimiterNode: SyntaxNode) { + return delimiterNode.parent?.firstChild?.equals(delimiterNode) + ? "left" + : delimiterNode.parent?.lastChild?.equals(delimiterNode) + ? "right" + : ("unknown" as const); +} diff --git a/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts b/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts new file mode 100644 index 0000000000..962b98e668 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/findSurroundingPairTextBased.ts @@ -0,0 +1,363 @@ +import { escapeRegExp, findLast, uniq } from "lodash"; +import { Range, Selection, TextDocument, TextEditor } from "vscode"; +import { + SimpleSurroundingPairName, + DelimiterInclusion, + SurroundingPairName, + SurroundingPairDirection, +} from "../../../typings/Types"; +import { getDocumentRange } from "../../../util/range"; +import { matchAll } from "../../../util/regex"; +import { extractSelectionFromSurroundingPairOffsets } from "./extractSelectionFromSurroundingPairOffsets"; +import { findSurroundingPairCore } from "./findSurroundingPairCore"; +import { getIndividualDelimiters } from "./getIndividualDelimiters"; +import { + Offsets, + SurroundingPairOffsets, + PossibleDelimiterOccurrence, + IndividualDelimiter, + DelimiterSide, +} from "./types"; + +/** + * The initial range length that we start by scanning + */ +const INITIAL_SCAN_LENGTH = 200; + +/** + * The maximum range we're willing to scan + */ +const MAX_SCAN_LENGTH = 50000; + +/** + * The factor by which to expand the search range at each iteration + */ +const SCAN_EXPANSION_FACTOR = 3; + +/** + * Implements the version of the surrounding pair finding algorithm that + * just looks at text. We use this algorithm when we are in a language + * for which we do not have parser support, or if we have parse tree support + * but the selection is in a string or comment. + * + * The approach is to create a list of candidate delimiters in the given range, + * and then pass them to the core algorithm, implemented by + * findSurroundingPairCore. + * + * To generate a list of delimiters to pass to findSurroundingPairCore, we + * run a regex on the entire range to find all delimiter texts, using a + * negative lookbehind to ensure they're not preceded by `\`. + * + * The main drawbacks of the text-based approach are the following: + * + * - We can get confused by delimiters whose opening and closing symbol is the + * same (eg `"`). Without a parse tree we have to guess whether it is an + * opening or closing quote. + * - We need to parse the whole range from the start because otherwise it is + * difficult to handle the case where one delimiter text is a subset of + * another, eg `"` and `\"`. We could handle this another way if performance + * becomes a bottleneck. + * - We cannot understand special features of a language, eg that `f"` is a + * form of opening quote in Python. + * + * @param editor The text editor containing the selection + * @param selection The selection to find surrounding pair around + * @param allowableRange The range in which to look for delimiters, or the + * entire document if `null` + * @param delimiters The acceptable surrounding pair names + * @param delimiterInclusion Whether to include / exclude the delimiters themselves + * @returns The newly expanded selection, including editor info + */ +export function findSurroundingPairTextBased( + editor: TextEditor, + selection: Selection, + allowableRange: Range | null, + delimiters: SimpleSurroundingPairName[], + delimiterInclusion: DelimiterInclusion, + forceDirection: "left" | "right" | undefined +) { + const document: TextDocument = editor.document; + const fullRange = allowableRange ?? getDocumentRange(document); + + const individualDelimiters = getIndividualDelimiters(delimiters); + + const delimiterTextToDelimiterInfoMap = Object.fromEntries( + individualDelimiters.map((individualDelimiter) => [ + individualDelimiter.text, + individualDelimiter, + ]) + ); + + /** + * Regex to use to find delimiters + */ + const delimiterRegex = getDelimiterRegex(individualDelimiters); + + /** + * The offset of the allowable range within the document. All offsets are + * taken relative to this range. + */ + const fullRangeOffsets = { + start: document.offsetAt(fullRange.start), + end: document.offsetAt(fullRange.end), + }; + const selectionOffsets = { + start: document.offsetAt(selection.start), + end: document.offsetAt(selection.end), + }; + + /** + * Context to pass to nested call + */ + const context: Context = { + forceDirection, + delimiterRegex, + delimiters, + delimiterTextToDelimiterInfoMap, + }; + + for ( + let scanLength = INITIAL_SCAN_LENGTH; + scanLength < MAX_SCAN_LENGTH; + scanLength *= SCAN_EXPANSION_FACTOR + ) { + /** + * The current range in which to look. Here we take the full range and + * restrict it based on the current scan length + */ + const currentRangeOffsets = { + start: Math.max( + fullRangeOffsets.start, + selectionOffsets.end - scanLength / 2 + ), + end: Math.min( + fullRangeOffsets.end, + selectionOffsets.end + scanLength / 2 + ), + }; + + const currentRange = new Range( + document.positionAt(currentRangeOffsets.start), + document.positionAt(currentRangeOffsets.end) + ); + + // Just bail early if the range doesn't completely contain our selection as + // it is a lost cause. + if (!currentRange.contains(selection)) { + continue; + } + + // Here we apply the core algorithm. This algorithm operates relative to the + // string that it receives so we need to adjust the selection range before + // we pass it in and then later we will adjust to the offsets that it + // returns + const adjustedSelectionOffsets = { + start: selectionOffsets.start - currentRangeOffsets.start, + end: selectionOffsets.end - currentRangeOffsets.start, + }; + + const pairOffsets = getDelimiterPairOffsets( + context, + document.getText(currentRange), + adjustedSelectionOffsets, + currentRangeOffsets.start === fullRangeOffsets.start, + currentRangeOffsets.end === fullRangeOffsets.end + ); + + if (pairOffsets != null) { + // And then perform postprocessing + return extractSelectionFromSurroundingPairOffsets( + document, + currentRangeOffsets.start, + pairOffsets, + delimiterInclusion + ).map(({ selection, context }) => ({ + selection: { selection, editor }, + context, + })); + } + + // If the current range is greater than are equal to the full range then we + // should stop expanding + if (currentRange.contains(fullRange)) { + break; + } + } + + return null; +} + +function getDelimiterRegex(individualDelimiters: IndividualDelimiter[]) { + // Create a regex which is a disjunction of all possible left / right + // delimiter texts + const individualDelimiterDisjunct = uniq( + individualDelimiters.map(({ text }) => text) + ) + .map(escapeRegExp) + .join("|"); + + // Then make sure that we don't allow preceding `\` + return new RegExp(`(? { + const startOffset = match.index!; + const matchText = match[0]; + return { + offsets: { + start: startOffset, + end: startOffset + matchText.length, + }, + + get delimiterInfo() { + const delimiterInfo = delimiterTextToDelimiterInfoMap[matchText]; + + let side = + delimiterInfo.side === "unknown" && forceDirection == null + ? inferDelimiterSide( + text, + delimiterOccurrences, + index, + delimiterInfo?.delimiter, + startOffset + ) + : delimiterInfo.side; + + return { ...delimiterInfo, side }; + }, + }; + } + ); + + // Then just run core algorithm + const surroundingPair = findSurroundingPairCore( + forceDirection, + delimiterOccurrences, + delimiters, + selectionOffsets, + !isAtStartOfFullRange || !isAtEndOfFullRange + ); + + // If we're not at the start of the full range, or we're not at the end of the + // full range then we get nervous if the delimiter we found is at the end of + // the range which is not complete, because we might have cut a token in half. + // In this case we return null and let the next iteration handle it using a + // larger range. + if ( + surroundingPair == null || + (!isAtStartOfFullRange && surroundingPair.leftDelimiter.start === 0) || + (!isAtEndOfFullRange && + surroundingPair.rightDelimiter.end === text.length - 1) + ) { + return null; + } + + return surroundingPair; +} + +/** + * Attempts to infer the side of a given delimiter of unknown side by using a + * simple heuristic. + * + * If there is a delimiter of the same type preceding the given delimiter on the + * same line then this delimiter will be of opposite side. If there is no + * delimiter proceeding this one on the same line then this delimiter will be + * considered a left delimiter. + * + * Note that this effectively ends up becoming a recursive algorithm because + * when we ask the proceeding delimiter what side it is it will use this same + * algorithm, which will then look to its left. + * + * NB: We must be careful in this algorithm not to access the delimiter info of + * the current delimiter by using the `delimiterOccurrences` list because that + * will result in infinite recursion because this function is called when we + * lazily construct the delimiter info. + * + * @param fullText The full text containing the delimiters + * @param delimiterOccurrences A list of all delimiter occurrences + * @param index The index of the current delimiter in the delimiter list + * @param delimiter The current delimiter type + * @param occurrenceStartOffset The start offset of the current delimiter within + * the full text + * @returns The inferred side of the delimiter + */ +function inferDelimiterSide( + fullText: string, + delimiterOccurrences: PossibleDelimiterOccurrence[], + index: number, + delimiter: SurroundingPairName, + occurrenceStartOffset: number +) { + const previousOccurrence = + index === 0 + ? null + : findLast( + delimiterOccurrences, + (delimiterOccurrence) => + delimiterOccurrence.delimiterInfo?.delimiter === delimiter, + index - 1 + ); + + if ( + previousOccurrence == null || + fullText + .substring(previousOccurrence.offsets.end, occurrenceStartOffset) + .includes("\n") + ) { + return "left"; + } + + return previousOccurrence.delimiterInfo!.side === "left" ? "right" : "left"; +} diff --git a/src/processTargets/modifiers/surroundingPair/generateUnmatchedDelimiters.ts b/src/processTargets/modifiers/surroundingPair/generateUnmatchedDelimiters.ts new file mode 100644 index 0000000000..d733157d40 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/generateUnmatchedDelimiters.ts @@ -0,0 +1,139 @@ +import { range } from "lodash"; +import { SimpleSurroundingPairName } from "../../../typings/Types"; +import { + DelimiterOccurrence, + DelimiterSide, + PossibleDelimiterOccurrence, +} from "./types"; + +/** + * Finds the first instance of an unmatched delimiter in the given direction + * + * This function is a simplified version of generateUnmatchedDelimiters, so look + * there for details of the algorithm + * + * @param delimiterOccurrences A list of delimiter occurrences. Expected to be sorted by offsets + * @param initialIndex The index of the delimiter to start from + * @param acceptableDelimiters A list of names of acceptable delimiters to look + * for + * @param lookForward Whether to scan forwards or backwards + * @returns The first acceptable unmatched delimiter, if one is found otherwise null + */ +export function findUnmatchedDelimiter( + delimiterOccurrences: PossibleDelimiterOccurrence[], + initialIndex: number, + acceptableDelimiters: SimpleSurroundingPairName[], + lookForward: boolean +): DelimiterOccurrence | null { + const generatorResult = generateUnmatchedDelimiters( + delimiterOccurrences, + initialIndex, + () => acceptableDelimiters, + lookForward + ).next(); + + return generatorResult.done ? null : generatorResult.value; +} + +/** + * This function is the heart of our surrounding pair algorithm. It scans in + * one direction (either forwards or backwards) through a list of delimiters, + * yielding each unmatched delimiter that it finds. + * + * The algorithm proceeds by keeping a map from delimiter names to counts. Every + * time it sees an instance of an opening or closing delimiter of the given + * type, it will either increment or decrement the counter for the given + * delimiter, depending which direction we're scanning. + * + * If the count for any delimiter drops to -1, we yield it because it means it + * is unmatched. + * + * @param delimiterOccurrences A list of delimiter occurrences. Expected to be + * sorted by offsets + * @param initialIndex The index of the delimiter to start from + * @param getCurrentAcceptableDelimiters A function that returns a list of names + * of acceptable delimiters to look for. We expect that this list might change + * every time we yield, depending on the outcome of the scan in the other + * direction + * @param lookForward Whether to scan forwards or backwards + * @yields Occurrences of unmatched delimiters + */ +export function* generateUnmatchedDelimiters( + delimiterOccurrences: PossibleDelimiterOccurrence[], + initialIndex: number, + getCurrentAcceptableDelimiters: () => SimpleSurroundingPairName[], + lookForward: boolean +): Generator { + /** + * This map tells us whether to increment or decrement our delimiter count + * depending on which side delimiter we see. If we're looking forward, we + * increment whenever we see a left delimiter, and decrement if we see a right + * delimiter. If we're scanning backwards, we increment whenever we see a + * right delimiter, and decrement if we see a left delimiter. + * + * We always decrement our count if side is `unknown`, (eg for a "`"). + * Otherwise we would just keep incrementing forever + */ + const delimiterIncrements: Record = lookForward + ? { + left: 1, + right: -1, + unknown: -1, + } + : { + left: -1, + right: 1, + unknown: -1, + }; + + /** + * Maps from each delimiter name to a balance indicating how many left and + * right delimiters of the given type we've seen. If this number drops to + * -1 for any delimiter, we yield it. + */ + let delimiterBalances: Partial> = + {}; + + /** + * The current list of acceptable delimiters in the ongoing scan segment. Each + * time we yield, this list might change depending on what the other direction + * found. + */ + let currentAcceptableDelimiters = getCurrentAcceptableDelimiters(); + + const indices = lookForward + ? range(initialIndex, delimiterOccurrences.length, 1) + : range(initialIndex, -1, -1); + + for (const index of indices) { + const delimiterOccurrence = delimiterOccurrences[index]; + const { delimiterInfo } = delimiterOccurrence; + const delimiterName = delimiterInfo?.delimiter; + + if ( + delimiterName == null || + !currentAcceptableDelimiters.includes(delimiterName) + ) { + continue; + } + + const increment = delimiterIncrements[delimiterInfo!.side]; + const newDelimiterBalance = + (delimiterBalances[delimiterName] ?? 0) + increment; + + if (newDelimiterBalance === -1) { + yield delimiterOccurrence as DelimiterOccurrence; + + // Refresh the list of acceptable delimiters because it may have changed + // depending on what the scan in the other direction found + currentAcceptableDelimiters = getCurrentAcceptableDelimiters(); + + // We reset the delimiter balance for the given delimiter to 0 because + // if we are continuing, it means that the scan in the opposite direction + // yielded an appropriate opposite matching delimiter. + delimiterBalances[delimiterName] = 0; + } else { + delimiterBalances[delimiterName] = newDelimiterBalance; + } + } +} diff --git a/src/processTargets/modifiers/surroundingPair/getIndividualDelimiters.ts b/src/processTargets/modifiers/surroundingPair/getIndividualDelimiters.ts new file mode 100644 index 0000000000..8f9ebef480 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/getIndividualDelimiters.ts @@ -0,0 +1,53 @@ +import { SimpleSurroundingPairName } from "../../../typings/Types"; +import { IndividualDelimiter } from "./types"; +import { delimiterToText } from "./delimiterMaps"; +import { concat, uniq } from "lodash"; + +/** + * Given a list of delimiters, returns a list where each element corresponds to + * a single right or left delimiter. Each item contains information such as a + * reference to delimiter name, the text to expect, etc. + * + * @param delimiters The delimiter names + * @returns A list of information about all possible left / right delimiter instances + */ +export function getIndividualDelimiters( + delimiters: SimpleSurroundingPairName[] +): IndividualDelimiter[] { + return delimiters.flatMap((delimiter) => { + const [leftDelimiter, rightDelimiter] = delimiterToText[delimiter]; + + // Allow for the fact that a delimiter might have multiple ways to indicate + // its opening / closing + const leftDelimiters = isString(leftDelimiter) + ? [leftDelimiter] + : leftDelimiter; + const rightDelimiters = isString(rightDelimiter) + ? [rightDelimiter] + : rightDelimiter; + + const allDelimiterTexts = uniq(concat(leftDelimiters, rightDelimiters)); + + return allDelimiterTexts.map((text) => { + const isLeft = leftDelimiters.includes(text); + const isRight = rightDelimiters.includes(text); + + return { + text, + // If delimiter text is the same for left and right, we say it's side + // is "unknown", so must be determined from context. + side: + isLeft && !isRight + ? "left" + : isRight && !isLeft + ? "right" + : "unknown", + delimiter, + }; + }); + }); +} + +function isString(arg: unknown): arg is string { + return typeof arg === "string" || arg instanceof String; +} diff --git a/src/processTargets/modifiers/surroundingPair/getSurroundingPairOffsets.ts b/src/processTargets/modifiers/surroundingPair/getSurroundingPairOffsets.ts new file mode 100644 index 0000000000..905c08e0a3 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/getSurroundingPairOffsets.ts @@ -0,0 +1,22 @@ +import { SurroundingPairOffsets, DelimiterOccurrence } from "./types"; + +/** + * Given a pair of delimiters, returns a pair of start and end offsets + * + * @param delimiter1 The first delimiter occurrence + * @param delimiter2 The second delimiter occurrence + * @returns A pair of start and end offsets for the given delimiters + */ +export function getSurroundingPairOffsets( + delimiter1: DelimiterOccurrence, + delimiter2: DelimiterOccurrence +): SurroundingPairOffsets { + const isDelimiter1First = delimiter1.offsets.start < delimiter2.offsets.start; + const leftDelimiter = isDelimiter1First ? delimiter1 : delimiter2; + const rightDelimiter = isDelimiter1First ? delimiter2 : delimiter1; + + return { + leftDelimiter: leftDelimiter.offsets, + rightDelimiter: rightDelimiter.offsets, + }; +} diff --git a/src/processTargets/modifiers/surroundingPair/index.ts b/src/processTargets/modifiers/surroundingPair/index.ts new file mode 100644 index 0000000000..bf813e3701 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/index.ts @@ -0,0 +1,121 @@ +import { Location, Range } from "vscode"; +import { SyntaxNode } from "web-tree-sitter"; +import { getNodeMatcher } from "../../../languages"; +import { findSurroundingPairParseTreeBased } from "./findSurroundingPairParseTreeBased"; +import { findSurroundingPairTextBased } from "./findSurroundingPairTextBased"; +import { + ComplexSurroundingPairName, + NodeMatcher, + ProcessedTargetsContext, + SelectionWithEditor, + SurroundingPairModifier, +} from "../../../typings/Types"; +import { + getNodeRange, + makeRangeFromPositions, +} from "../../../util/nodeSelectors"; +import { SelectionWithEditorWithContext } from "../processModifier"; +import { complexDelimiterMap } from "./delimiterMaps"; + +/** + * Applies the surrounding pair modifier to the given selection. First looks to + * see if the target is itself adjacent to or contained by a modifier token. If + * so it will expand the selection to the opposite delimiter token. Otherwise, + * or if the opposite token wasn't found, it will proceed by finding the + * smallest pair of delimiters which contains the selection. + * + * @param context Context to be leveraged by modifier + * @param selection The selection to process + * @param modifier The surrounding pair modifier information + * @returns The new selection expanded to the containing surrounding pair or + * `null` if none was found + */ +export function processSurroundingPair( + context: ProcessedTargetsContext, + selection: SelectionWithEditor, + modifier: SurroundingPairModifier +): SelectionWithEditorWithContext[] | null { + const document = selection.editor.document; + const delimiters = complexDelimiterMap[ + modifier.delimiter as ComplexSurroundingPairName + ] ?? [modifier.delimiter]; + + let node: SyntaxNode | null; + let stringNodeMatcher: NodeMatcher; + let commentNodeMatcher: NodeMatcher; + try { + node = context.getNodeAtLocation( + new Location(document.uri, selection.selection) + ); + stringNodeMatcher = getNodeMatcher(document.languageId, "string", false); + commentNodeMatcher = getNodeMatcher(document.languageId, "comment", false); + } catch (err) { + if ((err as Error).name === "UnsupportedLanguageError") { + // If we're in a language where we don't have a parse tree we use the text + // based algorithm + return findSurroundingPairTextBased( + selection.editor, + selection.selection, + null, + delimiters, + modifier.delimiterInclusion, + modifier.forceDirection + ); + } else { + throw err; + } + } + + // If we have a parse tree but we are in a string node or in a comment node, + // then we use the text-based algorithm + const isStringNode = stringNodeMatcher(selection, node) != null; + if (isStringNode || commentNodeMatcher(selection, node) != null) { + let nodeRange: Range; + + if (isStringNode) { + const children = node.children; + + if (children.length !== 0) { + nodeRange = makeRangeFromPositions( + children[0].endPosition, + children[children.length - 1].startPosition + ); + } else { + // This is a hack to deal with the fact that java doesn't have + // quotation mark tokens as children of the string. Rather than letting + // the parse tree handle the quotation marks in java, we instead just + // let the textual surround handle them by letting it see the quotation + // marks. In other languages we prefer to let the parser handle the + // quotation marks in case they are more than one character long. + nodeRange = getNodeRange(node); + } + } else { + nodeRange = getNodeRange(node); + } + + const surroundingRange = findSurroundingPairTextBased( + selection.editor, + selection.selection, + nodeRange, + delimiters, + modifier.delimiterInclusion, + modifier.forceDirection + ); + + if (surroundingRange != null) { + return surroundingRange; + } + } + + // If we have a parse tree and either we are not in a string or comment or we + // couldn't find a surrounding pair within a string or comment, we use the + // parse tree-based algorithm + return findSurroundingPairParseTreeBased( + selection.editor, + selection.selection, + node, + delimiters, + modifier.delimiterInclusion, + modifier.forceDirection + ); +} diff --git a/src/processTargets/modifiers/surroundingPair/types.ts b/src/processTargets/modifiers/surroundingPair/types.ts new file mode 100644 index 0000000000..f8be89b5d6 --- /dev/null +++ b/src/processTargets/modifiers/surroundingPair/types.ts @@ -0,0 +1,71 @@ +import { SimpleSurroundingPairName } from "../../../typings/Types"; + +/** + * Used to indicate whether a particular side of the delimiter is left or right + * or if we do not know. Note that the terms "opening" and "closing" could be + * used instead of "left" and "right", respectively. + */ +export type DelimiterSide = "unknown" | "left" | "right"; + +/** + * A description of one possible side of a delimiter + */ +export interface IndividualDelimiter { + /** + * The text that can be used to represent this side of the delimiter, eg "(" + */ + text: string; + + /** + * Which side of the delimiter this refers to + */ + side: DelimiterSide; + + /** + * Which delimiter this represents + */ + delimiter: SimpleSurroundingPairName; +} + +/** + * Offsets within a range or document + */ +export interface Offsets { + start: number; + end: number; +} + +/** + * The offsets of the left and right delimiter of a delimiter pair within + * range or document. + */ +export interface SurroundingPairOffsets { + leftDelimiter: Offsets; + rightDelimiter: Offsets; +} + +/** + * A possible occurrence with of a delimiter within arranger document including + * its offsets, as well as information about the delimiter itself. We allow + * `delimiterInfo` to be `null` so that implementers can lazily determine + * whether or not this is actually a delimiter, and return `null` if it is not + */ +export interface PossibleDelimiterOccurrence { + /** + * Information about the delimiter. If `null` then this delimiter occurrence + * should be ignored + */ + delimiterInfo?: IndividualDelimiter; + + /** + * The offsets of the delimiter occurrence + */ + offsets: Offsets; +} + +/** + * A confirmed occurrence of a delimiter within a document + */ +export interface DelimiterOccurrence extends PossibleDelimiterOccurrence { + delimiterInfo: IndividualDelimiter; +} diff --git a/src/processTargets/processSelectionType.ts b/src/processTargets/processSelectionType.ts index bbfd5708b1..6de76f328f 100644 --- a/src/processTargets/processSelectionType.ts +++ b/src/processTargets/processSelectionType.ts @@ -2,6 +2,7 @@ import { Position, Range, TextDocument } from "vscode"; import { selectionFromPositions, selectionWithEditorFromPositions, + selectionWithEditorFromRange, } from "../util/selectionUtils"; import { InsideOutsideType, @@ -13,6 +14,7 @@ import { TypedSelection, Position as TargetPosition, } from "../typings/Types"; +import { getDocumentRange } from "../util/range"; export default function ( context: ProcessedTargetsContext, @@ -76,12 +78,10 @@ function processDocument( selectionContext: SelectionContext ) { const { selectionType, insideOutsideType, position } = target; - const { document } = selection.editor; - const firstLine = document.lineAt(0); - const lastLine = document.lineAt(document.lineCount - 1); - const start = firstLine.range.start; - const end = lastLine.range.end; - const newSelection = selectionWithEditorFromPositions(selection, start, end); + const newSelection = selectionWithEditorFromRange( + selection, + getDocumentRange(selection.editor.document) + ); return { selection: newSelection, diff --git a/src/scripts/transformRecordedTests.ts b/src/scripts/transformRecordedTests.ts index 5aea10a01f..7065d4d863 100644 --- a/src/scripts/transformRecordedTests.ts +++ b/src/scripts/transformRecordedTests.ts @@ -8,6 +8,9 @@ import { TestCaseFixture } from "../testUtil/TestCase"; import { walkFilesSync } from "../testUtil/walkSync"; import serialize from "../testUtil/serialize"; import canonicalizeActionName from "../util/canonicalizeActionName"; +import { transformPrimitiveTargets } from "../util/getPrimitiveTargets"; +import { DelimiterInclusion, PartialPrimitiveTarget } from "../typings/Types"; +import { mkdir, rename, unlink } from "fs/promises"; /** * The transformation to run on all recorded test fixtures. Change this @@ -34,6 +37,28 @@ async function transformFile(file: string) { await fsp.writeFile(file, serialize(outputFixture)); } +/** + * Can be used to organize files into directories based on eg language id + * @param file The file to move + */ +async function moveFile(file: string) { + const buffer = await fsp.readFile(file); + const inputFixture = yaml.load(buffer.toString()) as TestCaseFixture; + const parent = path.dirname(file); + if (path.basename(parent) !== "surroundingPair") { + return; + } + const childDirName = + inputFixture.languageId === "plaintext" + ? "textual" + : `parseTree/${inputFixture.languageId}`; + const childDir = path.join(parent, childDirName); + await mkdir(childDir, { recursive: true }); + const outputPath = path.join(childDir, path.basename(file)); + // console.log(`${file} => ${outputPath}`); + await rename(file, outputPath); +} + // COMMON TRANSFORMATIONS // ====================== // Below are some common transformations you might want to run. @@ -59,4 +84,33 @@ function reorderFields(fixture: TestCaseFixture) { }; } +// Leaving an example here in case it's helpful +function updateSurroundingPairTest(fixture: TestCaseFixture) { + fixture.command.partialTargets = transformPrimitiveTargets( + fixture.command.partialTargets, + (target: PartialPrimitiveTarget) => { + if (target.modifier?.type === "surroundingPair") { + let delimiterInclusion: DelimiterInclusion; + + switch (target.modifier.delimiterInclusion as any) { + case "includeDelimiters": + delimiterInclusion = undefined; + break; + case "excludeDelimiters": + delimiterInclusion = "interiorOnly"; + break; + case "delimitersOnly": + delimiterInclusion = "excludeInterior"; + break; + } + + target.modifier.delimiterInclusion = delimiterInclusion; + } + return target; + } + ); + + return fixture; +} + main(); diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair.yml new file mode 100644 index 0000000000..089408675e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair10.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair10.yml new file mode 100644 index 0000000000..b9a9316b82 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair10.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair11.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair11.yml new file mode 100644 index 0000000000..b0e735b416 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair11.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair12.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair12.yml new file mode 100644 index 0000000000..39bbc1ae32 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair12.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair13.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair13.yml new file mode 100644 index 0000000000..e2d930ae5f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair13.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair14.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair14.yml new file mode 100644 index 0000000000..6ab3f755f5 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair14.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair15.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair15.yml new file mode 100644 index 0000000000..da0cc2d655 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair15.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair16.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair16.yml new file mode 100644 index 0000000000..d7278f9743 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair16.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair17.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair17.yml new file mode 100644 index 0000000000..1ab408d893 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair17.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair2.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair2.yml new file mode 100644 index 0000000000..f1b0e0192b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair2.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair3.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair3.yml new file mode 100644 index 0000000000..c82e8c3467 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair3.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair4.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair4.yml new file mode 100644 index 0000000000..a695c3f981 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair4.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair5.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair5.yml new file mode 100644 index 0000000000..79944baaeb --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair5.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair6.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair6.yml new file mode 100644 index 0000000000..1bb04c7a36 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair6.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair7.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair7.yml new file mode 100644 index 0000000000..ae5df502be --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair7.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + thatMark: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair8.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair8.yml new file mode 100644 index 0000000000..d09eca7c98 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair8.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair9.yml b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair9.yml new file mode 100644 index 0000000000..c7cdc1be00 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/html/clearPair9.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: html +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: " " + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/cpp/clearOutside.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/cpp/clearOutside.yml new file mode 100644 index 0000000000..e645f33b1e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/cpp/clearOutside.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: cpp +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "\"hello\"" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/cpp/clearRound8.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/cpp/clearRound8.yml new file mode 100644 index 0000000000..ad8722c2c3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/cpp/clearRound8.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: cpp +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: "\"(hello)\"" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearQuad3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearQuad3.yml new file mode 100644 index 0000000000..f66faa1f72 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearQuad3.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: java +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +initialState: + documentContents: "\"hello\"" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearRound10.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearRound10.yml new file mode 100644 index 0000000000..891e7f29c1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearRound10.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: java +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: "\"(hello)\"" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearRound11.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearRound11.yml new file mode 100644 index 0000000000..635077d64c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/java/clearRound11.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: java +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: ("hello") + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching.yml similarity index 83% rename from src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching.yml index 8907b12956..9fc25e3675 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching.yml @@ -1,10 +1,10 @@ -spokenForm: chuck matching +spokenForm: clear matching languageId: python command: - actionName: remove + actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any} extraArgs: [] initialState: documentContents: f"j{fdfhjkd}lkjlkj" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching2.yml similarity index 84% rename from src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching2.yml index 58521b52c0..b1f4f08739 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching2.yml @@ -1,10 +1,10 @@ -spokenForm: chuck matching +spokenForm: clear matching languageId: python command: - actionName: remove + actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching3.yml similarity index 83% rename from src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching3.yml index 9c968b6782..c365c6700d 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckMatching3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckMatching3.yml @@ -1,10 +1,10 @@ -spokenForm: chuck matching +spokenForm: clear matching languageId: python command: - actionName: remove + actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any} extraArgs: [] initialState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckPair.yml similarity index 68% rename from src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckPair.yml index e0ee0ac993..63d4fcc794 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckPair.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckPair.yml @@ -1,10 +1,10 @@ -spokenForm: chuck pair +spokenForm: clear pair languageId: python command: - actionName: remove + actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} extraArgs: [] initialState: documentContents: "{1: [(1), (2), (3)]}" @@ -15,8 +15,10 @@ initialState: finalState: documentContents: "1: [(1), (2), (3)]" selections: - - anchor: {line: 0, character: 2} - active: {line: 0, character: 2} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} thatMark: - anchor: {line: 0, character: 0} active: {line: 0, character: 0} diff --git a/src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckRound.yml similarity index 84% rename from src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckRound.yml index 83150a3b3f..251f25307d 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/chuckRound.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/chuckRound.yml @@ -1,10 +1,10 @@ -spokenForm: chuck round +spokenForm: clear round languageId: python command: - actionName: remove + actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: parentheses, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: parentheses} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearCurly.yml similarity index 95% rename from src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearCurly.yml index a949244b7d..438b082f17 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearCurly.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearCurly.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: curlyBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: curlyBrackets, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: "{1: [(1), (2), (3)]}" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearCurly3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearCurly3.yml new file mode 100644 index 0000000000..6ba122bebd --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearCurly3.yml @@ -0,0 +1,31 @@ +spokenForm: clear curly +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: curlyBrackets} + extraArgs: [] +initialState: + documentContents: |- + """ + { + hello + } + """ + selections: + - anchor: {line: 2, character: 7} + active: {line: 2, character: 7} + marks: {} +finalState: + documentContents: |- + """ + + """ + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} + thatMark: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: curlyBrackets, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching.yml similarity index 89% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching.yml index 7a45d541dc..6311c39683 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml similarity index 68% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml index 054049cc3a..cd16c8ab47 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching10.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: |- @@ -17,11 +17,11 @@ initialState: finalState: documentContents: |- - "" + "'' 'fsd'" selections: - - anchor: {line: 1, character: 1} - active: {line: 1, character: 1} + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} thatMark: - - anchor: {line: 1, character: 1} - active: {line: 1, character: 1} + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching11.yml similarity index 68% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching11.yml index 66b6577a23..87140b0592 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching11.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching11.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: |- @@ -17,11 +17,11 @@ initialState: finalState: documentContents: |- - "" + "'' 'fsd'" selections: - - anchor: {line: 1, character: 1} - active: {line: 1, character: 1} + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} thatMark: - - anchor: {line: 1, character: 1} - active: {line: 1, character: 1} + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching2.yml similarity index 88% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching2.yml index e59aef19a7..204c20b957 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching2.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching3.yml similarity index 88% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching3.yml index 6bb10b5738..a763c885ae 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching3.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching4.yml similarity index 88% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching4.yml index 2fcf1c9d41..15c3c8975a 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching4.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching4.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching5.yml similarity index 88% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching5.yml index f24baf811c..3df522a1f7 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching5.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching5.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: f"j{fdfhjkd}lkjlkj" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching6.yml similarity index 88% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching6.yml index b1e879abaa..c77cbe6015 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching6.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching6.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: f"j{fdfhjkd}lkjlkj" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching7.yml similarity index 88% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching7.yml index 17222c5f5b..649bc98898 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching7.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching7.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: f"j{fdfhjkd}lkjlkj" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching8.yml similarity index 89% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching8.yml index cd199d3030..1a39605fa6 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching8.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching8.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching9.yml similarity index 89% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching9.yml index 87fd15a7a9..891dad7b7e 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching9.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearMatching9.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: |- diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearOutside7.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearOutside7.yml new file mode 100644 index 0000000000..bc0ac6fe84 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearOutside7.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: f"Hello, {name + 's'}!" + selections: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} + marks: {} +finalState: + documentContents: f"Hello, {name + }!" + selections: + - anchor: {line: 0, character: 17} + active: {line: 0, character: 17} + thatMark: + - anchor: {line: 0, character: 17} + active: {line: 0, character: 17} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearOutside8.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearOutside8.yml new file mode 100644 index 0000000000..32d6825715 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearOutside8.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: f"Hello, {name + 's'}!" + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: f"Hello, !" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair.yml similarity index 90% rename from src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair.yml index dfd5d5af40..3fd68ec27b 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} extraArgs: [] initialState: documentContents: "{1: [(1), (2), (3)]}" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair2.yml similarity index 90% rename from src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair2.yml index dfd5d5af40..3fd68ec27b 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair2.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} extraArgs: [] initialState: documentContents: "{1: [(1), (2), (3)]}" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair3.yml similarity index 90% rename from src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair3.yml index 4d4128fcca..418600a61e 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair3.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} extraArgs: [] initialState: documentContents: f"j{fdfhjkd}lkjlkj" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair4.yml similarity index 90% rename from src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair4.yml index 435391c571..613ca3bd5d 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPair4.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPair4.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: true} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPairCurly.yml similarity index 96% rename from src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPairCurly.yml index a3dc50831d..fa3ede7c99 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearPairCurly.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearPairCurly.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: curlyBrackets, delimitersOnly: true} + modifier: {type: surroundingPair, delimiter: curlyBrackets, delimiterInclusion: excludeInterior} extraArgs: [] initialState: documentContents: "{1: [(1), (2), (3)]}" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearQuad2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearQuad2.yml new file mode 100644 index 0000000000..32e9952af8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearQuad2.yml @@ -0,0 +1,28 @@ +spokenForm: clear quad +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +initialState: + documentContents: |- + """ + { + hello + } + """ + selections: + - anchor: {line: 2, character: 7} + active: {line: 2, character: 7} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearQuad4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearQuad4.yml new file mode 100644 index 0000000000..813d184224 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearQuad4.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +initialState: + documentContents: f"Hello, {name}!" + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound.yml similarity index 96% rename from src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound.yml index aa1bd3114a..aa3b17e521 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearRound.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: parentheses, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound5.yml new file mode 100644 index 0000000000..18e4780efc --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound5.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: "'(hello)'" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "''" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound6.yml new file mode 100644 index 0000000000..278717056f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound6.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: "\"(hello)\"" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound7.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound7.yml new file mode 100644 index 0000000000..cb5dc9d966 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearRound7.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: python +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: f"(hello)" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: f"" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearSquare.yml similarity index 95% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearSquare.yml index 7801b70b1e..5d8ecd9e18 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearSquare.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: | diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearSquare2.yml similarity index 95% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearSquare2.yml index 68df24e093..bf12d5390a 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare2.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/python/clearSquare2.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: "{1: [(1), (2), (3)]}" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearCurly4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearCurly4.yml new file mode 100644 index 0000000000..eeaaf6c536 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearCurly4.yml @@ -0,0 +1,23 @@ +spokenForm: clear curly +languageId: shellscript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: curlyBrackets} + extraArgs: [] +initialState: + documentContents: "\"${hello}\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: curlyBrackets, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearOutside23.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearOutside23.yml new file mode 100644 index 0000000000..85ed640710 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearOutside23.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: shellscript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "\"${hello}\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearPair.yml new file mode 100644 index 0000000000..77d655779a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearPair.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: shellscript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "\"$(hello)\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearString5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearString5.yml new file mode 100644 index 0000000000..fac84b035e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/shellscript/clearString5.yml @@ -0,0 +1,23 @@ +spokenForm: clear string +languageId: shellscript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: string} + extraArgs: [] +initialState: + documentContents: "\"${hello}\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: string, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair10.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair10.yml new file mode 100644 index 0000000000..70a9f0cfee --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair10.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair11.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair11.yml new file mode 100644 index 0000000000..bc07d5bd58 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair11.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair12.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair12.yml new file mode 100644 index 0000000000..1a22abf3c6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair12.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair13.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair13.yml new file mode 100644 index 0000000000..3fd00dcd48 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair13.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair14.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair14.yml new file mode 100644 index 0000000000..caff475737 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair14.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair15.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair15.yml new file mode 100644 index 0000000000..c065b4eca1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair15.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair16.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair16.yml new file mode 100644 index 0000000000..d36bba0b4c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair16.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair17.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair17.yml new file mode 100644 index 0000000000..16100d53ad --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair17.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair18.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair18.yml new file mode 100644 index 0000000000..12444f7f0f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair18.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair19.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair19.yml new file mode 100644 index 0000000000..0737ebb1dd --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair19.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair20.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair20.yml new file mode 100644 index 0000000000..2becfb085d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair20.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair21.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair21.yml new file mode 100644 index 0000000000..7b7e4c5ff0 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair21.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair23.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair23.yml new file mode 100644 index 0000000000..56ecd2a84d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair23.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair4.yml new file mode 100644 index 0000000000..7e40e3791b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair4.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair5.yml new file mode 100644 index 0000000000..0d464a62e7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair5.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair6.yml new file mode 100644 index 0000000000..3b48e1fad4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair6.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair7.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair7.yml new file mode 100644 index 0000000000..c7ab42b12f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair7.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair8.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair8.yml new file mode 100644 index 0000000000..1a0ded8ca8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair8.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair9.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair9.yml new file mode 100644 index 0000000000..e97dc3356f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/tsx/clearPair9.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescriptreact +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching12.yml similarity index 89% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching12.yml index b2aa79e3f8..acba16c7fa 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching12.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching12.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: import { Point, SyntaxNode } from "web-tree-sitter"; diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching13.yml similarity index 89% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching13.yml index d22acb37c7..716b6cb498 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching13.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching13.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: import { Point, SyntaxNode } from "web-tree-sitter"; diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching14.yml similarity index 66% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching14.yml index d8598f7518..c7698e1f53 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching14.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching14.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: "{const [bongo, baz] = [foo, bar]}" @@ -13,11 +13,11 @@ initialState: active: {line: 0, character: 20} marks: {} finalState: - documentContents: "{const [] = [foo, bar]}" + documentContents: "{}" selections: - - anchor: {line: 0, character: 8} - active: {line: 0, character: 8} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} thatMark: - - anchor: {line: 0, character: 8} - active: {line: 0, character: 8} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching15.yml similarity index 89% rename from src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching15.yml index 40bd667ea4..cd8505d6ae 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearMatching15.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearMatching15.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: null, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: "{const [bongo, baz] = [foo, bar]}" diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside10.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside10.yml new file mode 100644 index 0000000000..4a2903f7e4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside10.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside11.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside11.yml new file mode 100644 index 0000000000..d76e12086a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside11.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside12.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside12.yml new file mode 100644 index 0000000000..ca97599b86 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside12.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside13.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside13.yml new file mode 100644 index 0000000000..85c1b03ccf --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside13.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside14.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside14.yml new file mode 100644 index 0000000000..f763243a80 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside14.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside15.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside15.yml new file mode 100644 index 0000000000..0262cf84fd --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside15.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside16.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside16.yml new file mode 100644 index 0000000000..c30c13ea4e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside16.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 14} + active: {line: 0, character: 14} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside17.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside17.yml new file mode 100644 index 0000000000..3035d11672 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside17.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 15} + active: {line: 0, character: 15} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside18.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside18.yml new file mode 100644 index 0000000000..a72d3ec5bf --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside18.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside19.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside19.yml new file mode 100644 index 0000000000..dfc93a0aa3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside19.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 17} + active: {line: 0, character: 17} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside2.yml new file mode 100644 index 0000000000..10a88ba3ee --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside2.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[\"hello\", \"world\"]" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside20.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside20.yml new file mode 100644 index 0000000000..6f278a4865 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside20.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name + 's'}!`" + selections: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} + marks: {} +finalState: + documentContents: "`Hello, ${name + }!`" + selections: + - anchor: {line: 0, character: 17} + active: {line: 0, character: 17} + thatMark: + - anchor: {line: 0, character: 17} + active: {line: 0, character: 17} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside21.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside21.yml new file mode 100644 index 0000000000..3b16d7010c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside21.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name + 's'}!`" + selections: + - anchor: {line: 0, character: 16} + active: {line: 0, character: 16} + marks: {} +finalState: + documentContents: "`Hello, !`" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + thatMark: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside22.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside22.yml new file mode 100644 index 0000000000..c20d857c72 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside22.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, \\${name}!`" + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: {} +finalState: + documentContents: "`Hello, \\$!`" + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + thatMark: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside3.yml new file mode 100644 index 0000000000..5b18727955 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside3.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[\"hello\", \"world\"]" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: "[, \"world\"]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside4.yml new file mode 100644 index 0000000000..f939562374 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside4.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[\"hello\", \"world\"]" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: "[, \"world\"]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside5.yml new file mode 100644 index 0000000000..e9457d9f72 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside5.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[\"hello\", \"world\"]" + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: {} +finalState: + documentContents: "[\"hello\", ]" + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside6.yml new file mode 100644 index 0000000000..ce8971adae --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside6.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[\"hello\", \"world\"]" + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: "[\"hello\", ]" + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside9.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside9.yml new file mode 100644 index 0000000000..e1d8051a76 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearOutside9.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair.yml new file mode 100644 index 0000000000..c3a68d7b08 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: if (foo > 0) {} + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: if {} + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair2.yml new file mode 100644 index 0000000000..f1e7685dc3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair2.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: if (foo > 0) {} + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: if {} + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair3.yml new file mode 100644 index 0000000000..0c58f77aae --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearPair3.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: if (foo > 0) {} + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: if {} + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearQuad.yml new file mode 100644 index 0000000000..8161b17ae4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearQuad.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +initialState: + documentContents: // "(hello)" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: "// " + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound2.yml new file mode 100644 index 0000000000..e8cea221bd --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound2.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: "\"(hello)\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} + marks: {} +finalState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound3.yml new file mode 100644 index 0000000000..4fe73a315f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound3.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: // "(hello)" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: // "" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound4.yml new file mode 100644 index 0000000000..74c6451b5b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearRound4.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: "'(hello)'" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "''" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSkis.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSkis.yml new file mode 100644 index 0000000000..c219484500 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSkis.yml @@ -0,0 +1,23 @@ +spokenForm: clear skis +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: backtickQuotes} + extraArgs: [] +initialState: + documentContents: "`Hello, ${name}!`" + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: backtickQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare3.yml similarity index 95% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare3.yml index a391d9058f..ea6bb5933d 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare3.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare3.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: const [bongo, baz] = [foo, bar] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare4.yml similarity index 95% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare4.yml index cd20ca8953..78350f0da9 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare4.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare4.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: const [bongo, baz] = [foo, bar] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare5.yml similarity index 95% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare5.yml index eea753b891..b45a1a7306 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquare5.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquare5.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} extraArgs: [] initialState: documentContents: const [bongo, baz] = [foo, bar] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquareLack.yml similarity index 96% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquareLack.yml index e7f6331968..4659857231 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareLack.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquareLack.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} mark: {type: decoratedSymbol, symbolColor: default, character: '['} extraArgs: [] initialState: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquareRack.yml similarity index 96% rename from src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml rename to src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquareRack.yml index 07fd82de1a..a23fb6ca90 100644 --- a/src/test/suite/fixtures/recorded/surroundingPair/clearSquareRack.yml +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearSquareRack.yml @@ -4,7 +4,7 @@ command: actionName: clearAndSetSelection partialTargets: - type: primitive - modifier: {type: surroundingPair, delimiter: squareBrackets, delimitersOnly: false} + modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: interiorOnly} mark: {type: decoratedSymbol, symbolColor: default, character: ']'} extraArgs: [] initialState: diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString.yml new file mode 100644 index 0000000000..2969c89933 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString.yml @@ -0,0 +1,23 @@ +spokenForm: clear string +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: string} + extraArgs: [] +initialState: + documentContents: "\"(hello)\"" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: string, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString2.yml new file mode 100644 index 0000000000..9fba5d904b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString2.yml @@ -0,0 +1,23 @@ +spokenForm: clear string +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: string} + extraArgs: [] +initialState: + documentContents: "'(hello)'" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: string, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString3.yml new file mode 100644 index 0000000000..cc2f1ae2a0 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTree/typescript/clearString3.yml @@ -0,0 +1,23 @@ +spokenForm: clear string +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: string} + extraArgs: [] +initialState: + documentContents: "`(hello)`" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: string, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckInsideRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckInsideRound.yml new file mode 100644 index 0000000000..8b6fbd52a0 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckInsideRound.yml @@ -0,0 +1,23 @@ +spokenForm: chuck inside round +languageId: typescript +command: + actionName: remove + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} + extraArgs: [] +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckPairRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckPairRound.yml new file mode 100644 index 0000000000..8ba6ec7857 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckPairRound.yml @@ -0,0 +1,25 @@ +spokenForm: chuck pair round +languageId: typescript +command: + actionName: remove + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeInterior} + extraArgs: [] +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: hello + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckRound2.yml new file mode 100644 index 0000000000..7574357495 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/chuckRound2.yml @@ -0,0 +1,23 @@ +spokenForm: chuck round +languageId: typescript +command: + actionName: remove + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearCurly2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearCurly2.yml new file mode 100644 index 0000000000..7eed02dc97 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearCurly2.yml @@ -0,0 +1,26 @@ +spokenForm: clear curly +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: curlyBrackets} + extraArgs: [] +initialState: + documentContents: |- + { + hello + } + selections: + - anchor: {line: 1, character: 7} + active: {line: 1, character: 7} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: curlyBrackets, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearOutsideGreenDouble.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearOutsideGreenDouble.yml new file mode 100644 index 0000000000..d070d05ebf --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearOutsideGreenDouble.yml @@ -0,0 +1,27 @@ +spokenForm: clear outside blue double +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: blue, character: '"', usePrePhraseSnapshot: true} + extraArgs: [] +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: + blue.": + start: {line: 0, character: 0} + end: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: green, character: '"', usePrePhraseSnapshot: true}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearRound9.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearRound9.yml new file mode 100644 index 0000000000..2bdaff264a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/clearRound9.yml @@ -0,0 +1,32 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: |- + (hello) + (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + marks: {} +finalState: + documentContents: |+ + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeInsideRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeInsideRound.yml new file mode 100644 index 0000000000..c77a4076cd --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeInsideRound.yml @@ -0,0 +1,23 @@ +spokenForm: clear inside round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeInsideRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeInsideRound2.yml new file mode 100644 index 0000000000..41e107c111 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeInsideRound2.yml @@ -0,0 +1,23 @@ +spokenForm: clear inside round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside.yml new file mode 100644 index 0000000000..b8c6660ff3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside11.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside11.yml new file mode 100644 index 0000000000..9dbbde1788 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside11.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside12.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside12.yml new file mode 100644 index 0000000000..af6ac8ead6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside12.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside13.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside13.yml new file mode 100644 index 0000000000..61e8ca3aff --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside13.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + marks: {} +finalState: + documentContents: "( " + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside14.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside14.yml new file mode 100644 index 0000000000..ddeef336c7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside14.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside15.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside15.yml new file mode 100644 index 0000000000..f370ed50b4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside15.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside16.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside16.yml new file mode 100644 index 0000000000..bd672c2062 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside16.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: "( " + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside17.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside17.yml new file mode 100644 index 0000000000..ecd80bb21f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside17.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[ ( ] )" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: " )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside18.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside18.yml new file mode 100644 index 0000000000..3399f60016 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside18.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ ( ] )" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: "{ " + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside19.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside19.yml new file mode 100644 index 0000000000..8ca3729ee1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside19.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ ( } ] )" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: " ] )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside2.yml new file mode 100644 index 0000000000..80cc14c1a3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside2.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: ([]) + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside20.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside20.yml new file mode 100644 index 0000000000..5ce56cdfb5 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside20.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[ { ( { } ] )" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: " )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside21.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside21.yml new file mode 100644 index 0000000000..8fd6b6251a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside21.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ [ ( { } ] )" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: "{ )" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside22.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside22.yml new file mode 100644 index 0000000000..07f60312a7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside22.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ [ ( } ] )" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: " ] )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside23.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside23.yml new file mode 100644 index 0000000000..ac9fafb8ae --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside23.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{[ ( } ] )" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + marks: {} +finalState: + documentContents: " ] )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside24.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside24.yml new file mode 100644 index 0000000000..6cb759aba4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside24.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ([)] + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: "]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside25.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside25.yml new file mode 100644 index 0000000000..f39474f703 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside25.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ([)] + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: ( + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside26.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside26.yml new file mode 100644 index 0000000000..6ec70f5ac1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside26.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside3.yml new file mode 100644 index 0000000000..a8ca6926b8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside3.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside4.yml new file mode 100644 index 0000000000..5fbc730276 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside4.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 5} +finalState: + documentContents: "[]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside5.yml new file mode 100644 index 0000000000..40ca934bd0 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside5.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 4} +finalState: + documentContents: "[]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside6.yml new file mode 100644 index 0000000000..2db3f5a1bc --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside6.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside7.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside7.yml new file mode 100644 index 0000000000..1b68f09570 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside7.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello) (whatever)]" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 11} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside8.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside8.yml new file mode 100644 index 0000000000..a2e37347f5 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside8.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello) (whatever)]" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside9.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside9.yml new file mode 100644 index 0000000000..20421036ac --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutside9.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[hello (whatever)]" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutsideLeper.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutsideLeper.yml new file mode 100644 index 0000000000..abdc40a415 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutsideLeper.yml @@ -0,0 +1,29 @@ +spokenForm: clear outside leper +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: default, character: (} + extraArgs: [] +marks: + default.(: + start: {line: 0, character: 1} + end: {line: 0, character: 2} +initialState: + documentContents: | + [(hello) (whatever)] + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +finalState: + documentContents: | + [ (whatever)] + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: (}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutsideRack.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutsideRack.yml new file mode 100644 index 0000000000..0a399a6793 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeOutsideRack.yml @@ -0,0 +1,29 @@ +spokenForm: clear outside rack +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: default, character: ']'} + extraArgs: [] +marks: + default.]: + start: {line: 0, character: 20} + end: {line: 0, character: 21} +initialState: + documentContents: | + [(hello) (whatever)] + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +finalState: + documentContents: |+ + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ']'}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairDouble.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairDouble.yml new file mode 100644 index 0000000000..927c99e0cd --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairDouble.yml @@ -0,0 +1,31 @@ +spokenForm: clear pair double +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} + mark: {type: decoratedSymbol, symbolColor: default, character: '"'} + extraArgs: [] +marks: + default.": + start: {line: 0, character: 1} + end: {line: 0, character: 2} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: '"'}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairRound.yml new file mode 100644 index 0000000000..6c39eff573 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairRound.yml @@ -0,0 +1,27 @@ +spokenForm: clear pair round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeInterior} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairRound2.yml new file mode 100644 index 0000000000..d59434fab7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takePairRound2.yml @@ -0,0 +1,27 @@ +spokenForm: clear pair round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeInterior} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: hello + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad.yml new file mode 100644 index 0000000000..0d256390a6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad2.yml new file mode 100644 index 0000000000..42810421dc --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad2.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad3.yml new file mode 100644 index 0000000000..68204e8deb --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad3.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad4.yml new file mode 100644 index 0000000000..b1c6852874 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad4.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"()\"" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad5.yml new file mode 100644 index 0000000000..70ad219c40 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad5.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"hello\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad6.yml new file mode 100644 index 0000000000..6447c6563b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeQuad6.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\\\"\\\"\"" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound.yml new file mode 100644 index 0000000000..2d666a52ba --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound10.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound10.yml new file mode 100644 index 0000000000..65d337e5a1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound10.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello)) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound11.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound11.yml new file mode 100644 index 0000000000..d274853a83 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound11.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello)) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound12.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound12.yml new file mode 100644 index 0000000000..213df0b2cb --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound12.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello)) + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound13.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound13.yml new file mode 100644 index 0000000000..c098e2364d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound13.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello) () ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound14.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound14.yml new file mode 100644 index 0000000000..84b7e5d9e9 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound14.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello) () ) + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +finalState: + documentContents: ((hello) ) + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound15.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound15.yml new file mode 100644 index 0000000000..7cd93cd172 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound15.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello) [] ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound16.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound16.yml new file mode 100644 index 0000000000..4ac9d66b5c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound16.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ()() + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound17.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound17.yml new file mode 100644 index 0000000000..fa245fd548 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound17.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ()( + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: ( + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound18.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound18.yml new file mode 100644 index 0000000000..5d406839b4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound18.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (\(hello\)) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound19.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound19.yml new file mode 100644 index 0000000000..a56096f56c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound19.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound2.yml new file mode 100644 index 0000000000..f9e8bd1bf8 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound2.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound20.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound20.yml new file mode 100644 index 0000000000..0adf87ee87 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound20.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello (whatever)) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound21.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound21.yml new file mode 100644 index 0000000000..a96f6fa161 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound21.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello () ) + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound22.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound22.yml new file mode 100644 index 0000000000..0548d24dd1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound22.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello () (whatever)) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound23.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound23.yml new file mode 100644 index 0000000000..3e8a6765bc --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound23.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (\(hello\)) + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound3.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound3.yml new file mode 100644 index 0000000000..7ad616b9f4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound3.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound4.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound4.yml new file mode 100644 index 0000000000..9c3d2ab459 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound4.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound5.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound5.yml new file mode 100644 index 0000000000..45bd5e26d2 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound5.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound6.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound6.yml new file mode 100644 index 0000000000..b48b230239 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound6.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound7.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound7.yml new file mode 100644 index 0000000000..e8e4c69008 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound7.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (()) + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound8.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound8.yml new file mode 100644 index 0000000000..1aeda6c3f9 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound8.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (()) + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound9.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound9.yml new file mode 100644 index 0000000000..f87d7c147d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRound9.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (()) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRoundLeper.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRoundLeper.yml new file mode 100644 index 0000000000..c4ddc3dbd3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRoundLeper.yml @@ -0,0 +1,27 @@ +spokenForm: clear round leper +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + mark: {type: decoratedSymbol, symbolColor: default, character: (} + extraArgs: [] +marks: + default.(: + start: {line: 0, character: 0} + end: {line: 0, character: 1} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: (}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRoundRepper.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRoundRepper.yml new file mode 100644 index 0000000000..3242027a71 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeRoundRepper.yml @@ -0,0 +1,27 @@ +spokenForm: clear round repper +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + mark: {type: decoratedSymbol, symbolColor: default, character: )} + extraArgs: [] +marks: + default.): + start: {line: 0, character: 6} + end: {line: 0, character: 7} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: )}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeSquare.yml b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeSquare.yml new file mode 100644 index 0000000000..bb72f6df5e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/parseTreeParity/takeSquare.yml @@ -0,0 +1,23 @@ +spokenForm: clear square +languageId: typescript +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: squareBrackets} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckInsideRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckInsideRound.yml new file mode 100644 index 0000000000..7323ebd36a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckInsideRound.yml @@ -0,0 +1,23 @@ +spokenForm: chuck inside round +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} + extraArgs: [] +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckPairRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckPairRound.yml new file mode 100644 index 0000000000..04c691aba6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckPairRound.yml @@ -0,0 +1,25 @@ +spokenForm: chuck pair round +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeInterior} + extraArgs: [] +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: hello + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckRound2.yml new file mode 100644 index 0000000000..1d345b6f3b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/chuckRound2.yml @@ -0,0 +1,23 @@ +spokenForm: chuck round +languageId: plaintext +command: + actionName: remove + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearCurly2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearCurly2.yml new file mode 100644 index 0000000000..f8e6762fe4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearCurly2.yml @@ -0,0 +1,26 @@ +spokenForm: clear curly +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: curlyBrackets} + extraArgs: [] +initialState: + documentContents: |- + { + hello + } + selections: + - anchor: {line: 1, character: 7} + active: {line: 1, character: 7} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: curlyBrackets, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearOutsideGreenDouble.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearOutsideGreenDouble.yml new file mode 100644 index 0000000000..0804a4228f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearOutsideGreenDouble.yml @@ -0,0 +1,27 @@ +spokenForm: clear outside blue double +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: blue, character: '"', usePrePhraseSnapshot: true} + extraArgs: [] +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: + blue.": + start: {line: 0, character: 0} + end: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: green, character: '"', usePrePhraseSnapshot: true}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair.yml new file mode 100644 index 0000000000..16ed085371 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair10.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair10.yml new file mode 100644 index 0000000000..8986a6b0a9 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair10.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 17} + active: {line: 0, character: 17} + marks: {} +finalState: + documentContents: ("hello", ) + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair11.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair11.yml new file mode 100644 index 0000000000..5755fdc975 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair11.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 18} + active: {line: 0, character: 18} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair12.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair12.yml new file mode 100644 index 0000000000..87f2d40b76 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair12.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair13.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair13.yml new file mode 100644 index 0000000000..6bb3a86f03 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair13.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ('"hello", "world"') + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: {} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair14.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair14.yml new file mode 100644 index 0000000000..5354436abf --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair14.yml @@ -0,0 +1,26 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: |- + " + ("hello", "world") + selections: + - anchor: {line: 1, character: 10} + active: {line: 1, character: 10} + marks: {} +finalState: + documentContents: | + " + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} + thatMark: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair2.yml new file mode 100644 index 0000000000..e28c69137c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair2.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: (, "world") + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair3.yml new file mode 100644 index 0000000000..0392e38ba7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair3.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: (, "world") + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair4.yml new file mode 100644 index 0000000000..4636e719e6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair4.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + marks: {} +finalState: + documentContents: (, "world") + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair5.yml new file mode 100644 index 0000000000..5813bbbb14 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair5.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: (, "world") + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair6.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair6.yml new file mode 100644 index 0000000000..1a714dde66 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair6.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: (, "world") + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair7.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair7.yml new file mode 100644 index 0000000000..3aa30498db --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair7.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + marks: {} +finalState: + documentContents: ("hello", ) + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair8.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair8.yml new file mode 100644 index 0000000000..f88e983626 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair8.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: ("hello", ) + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair9.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair9.yml new file mode 100644 index 0000000000..81d8bd58ff --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearPair9.yml @@ -0,0 +1,23 @@ +spokenForm: clear pair +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ("hello", "world") + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + marks: {} +finalState: + documentContents: ("hello", ) + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} + thatMark: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearRound.yml new file mode 100644 index 0000000000..5735186c9f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearRound.yml @@ -0,0 +1,321 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: |- + ( + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + ) + selections: + - anchor: {line: 266, character: 5} + active: {line: 266, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearRound9.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearRound9.yml new file mode 100644 index 0000000000..a0d3360909 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearRound9.yml @@ -0,0 +1,32 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +initialState: + documentContents: |- + (hello) + (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + marks: {} +finalState: + documentContents: |+ + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/clearString4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearString4.yml new file mode 100644 index 0000000000..3a23f8edbe --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/clearString4.yml @@ -0,0 +1,23 @@ +spokenForm: clear string +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: string} + extraArgs: [] +initialState: + documentContents: "\"(hello)\"" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: string, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/tailTakeEscapedQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/tailTakeEscapedQuad.yml new file mode 100644 index 0000000000..517c75b94c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/tailTakeEscapedQuad.yml @@ -0,0 +1,23 @@ +spokenForm: clear escaped quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: \"\" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad.yml new file mode 100644 index 0000000000..685471d9de --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad.yml @@ -0,0 +1,23 @@ +spokenForm: clear escaped quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: \"\" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad2.yml new file mode 100644 index 0000000000..dd3e4bc770 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad2.yml @@ -0,0 +1,23 @@ +spokenForm: clear escaped quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: \"\" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad3.yml new file mode 100644 index 0000000000..a6017fac51 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad3.yml @@ -0,0 +1,23 @@ +spokenForm: clear escaped quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: \"\" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad4.yml new file mode 100644 index 0000000000..a185e53c15 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad4.yml @@ -0,0 +1,23 @@ +spokenForm: clear escaped quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: \"\" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad5.yml new file mode 100644 index 0000000000..28bbb0c9e1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeEscapedQuad5.yml @@ -0,0 +1,23 @@ +spokenForm: clear escaped quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: \"hello\" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: escapedDoubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeInsideRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeInsideRound.yml new file mode 100644 index 0000000000..8eb6ba57da --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeInsideRound.yml @@ -0,0 +1,23 @@ +spokenForm: clear inside round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeInsideRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeInsideRound2.yml new file mode 100644 index 0000000000..62f795a77f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeInsideRound2.yml @@ -0,0 +1,23 @@ +spokenForm: clear inside round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: interiorOnly} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad.yml new file mode 100644 index 0000000000..514af0f3d6 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 26} + active: {line: 0, character: 26} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad2.yml new file mode 100644 index 0000000000..a192bfec69 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad2.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 15} + active: {line: 1, character: 15} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad3.yml new file mode 100644 index 0000000000..5578299157 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad3.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 16} + active: {line: 1, character: 16} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad4.yml new file mode 100644 index 0000000000..06a8baedd0 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad4.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 12} + active: {line: 1, character: 12} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad5.yml new file mode 100644 index 0000000000..222e823bb7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad5.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 26} + active: {line: 1, character: 26} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} + thatMark: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad6.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad6.yml new file mode 100644 index 0000000000..94bbb06c06 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad6.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 31} + active: {line: 1, character: 31} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} + thatMark: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad7.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad7.yml new file mode 100644 index 0000000000..6848804c9e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeLeftQuad7.yml @@ -0,0 +1,27 @@ +spokenForm: take left quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 32} + active: {line: 1, character: 32} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} + thatMark: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: left}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside.yml new file mode 100644 index 0000000000..6567947825 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside10.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside10.yml new file mode 100644 index 0000000000..62faebb407 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside10.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: (\(hello\)) + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside11.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside11.yml new file mode 100644 index 0000000000..b3be6e3dd2 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside11.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside12.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside12.yml new file mode 100644 index 0000000000..aec410d0db --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside12.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside13.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside13.yml new file mode 100644 index 0000000000..546e225bf4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside13.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + marks: {} +finalState: + documentContents: "( " + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside14.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside14.yml new file mode 100644 index 0000000000..669388e290 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside14.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside15.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside15.yml new file mode 100644 index 0000000000..b99859377d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside15.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: " ]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside16.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside16.yml new file mode 100644 index 0000000000..430c86b29a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside16.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( [ ) ] + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: "( " + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + thatMark: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside17.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside17.yml new file mode 100644 index 0000000000..1103dcda8c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside17.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[ ( ] )" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: " )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside18.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside18.yml new file mode 100644 index 0000000000..2bd5475309 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside18.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ ( ] )" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: "{ " + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + thatMark: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside19.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside19.yml new file mode 100644 index 0000000000..7426872d3a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside19.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ ( } ] )" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: " ] )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside2.yml new file mode 100644 index 0000000000..3db8b16a7d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside2.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: ([]) + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside20.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside20.yml new file mode 100644 index 0000000000..c3577508cc --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside20.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "[ { ( { } ] )" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + marks: {} +finalState: + documentContents: " )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside21.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside21.yml new file mode 100644 index 0000000000..5f5b5a67b4 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside21.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ [ ( { } ] )" + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} + marks: {} +finalState: + documentContents: "{ )" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside22.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside22.yml new file mode 100644 index 0000000000..3bddc3ea3c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside22.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{ [ ( } ] )" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} + marks: {} +finalState: + documentContents: " ] )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside23.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside23.yml new file mode 100644 index 0000000000..9432ee313f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside23.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: "{[ ( } ] )" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} + marks: {} +finalState: + documentContents: " ] )" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside24.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside24.yml new file mode 100644 index 0000000000..925716b6dc --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside24.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ([)] + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + marks: {} +finalState: + documentContents: "]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside25.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside25.yml new file mode 100644 index 0000000000..3be3682390 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside25.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ([)] + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + marks: {} +finalState: + documentContents: ( + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside26.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside26.yml new file mode 100644 index 0000000000..42fa3c54b7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside26.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside27.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside27.yml new file mode 100644 index 0000000000..198165e528 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside27.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 18} + marks: {} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside3.yml new file mode 100644 index 0000000000..f7e02528ab --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside3.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside4.yml new file mode 100644 index 0000000000..52f234902c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside4.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 5} +finalState: + documentContents: "[]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside5.yml new file mode 100644 index 0000000000..590bfdbc0b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside5.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 4} +finalState: + documentContents: "[]" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside6.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside6.yml new file mode 100644 index 0000000000..bdfa61880f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside6.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside7.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside7.yml new file mode 100644 index 0000000000..d57f6db56c --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside7.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello) (whatever)]" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 11} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside8.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside8.yml new file mode 100644 index 0000000000..7ef7b6639a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside8.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello) (whatever)]" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside9.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside9.yml new file mode 100644 index 0000000000..7a86029e1a --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutside9.yml @@ -0,0 +1,23 @@ +spokenForm: clear outside +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + extraArgs: [] +marks: {} +initialState: + documentContents: "[hello (whatever)]" + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideFine.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideFine.yml new file mode 100644 index 0000000000..dfd36980de --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideFine.yml @@ -0,0 +1,27 @@ +spokenForm: clear outside fine +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: default, character: f, usePrePhraseSnapshot: true} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 23} + marks: + default.f: + start: {line: 0, character: 7} + end: {line: 0, character: 10} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: f, usePrePhraseSnapshot: true}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideLeper.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideLeper.yml new file mode 100644 index 0000000000..f1ff810f48 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideLeper.yml @@ -0,0 +1,29 @@ +spokenForm: clear outside leper +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: default, character: (} + extraArgs: [] +marks: + default.(: + start: {line: 0, character: 1} + end: {line: 0, character: 2} +initialState: + documentContents: | + [(hello) (whatever)] + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +finalState: + documentContents: | + [ (whatever)] + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: (}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideRack.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideRack.yml new file mode 100644 index 0000000000..63414bf702 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideRack.yml @@ -0,0 +1,29 @@ +spokenForm: clear outside rack +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: default, character: ']'} + extraArgs: [] +marks: + default.]: + start: {line: 0, character: 20} + end: {line: 0, character: 21} +initialState: + documentContents: | + [(hello) (whatever)] + selections: + - anchor: {line: 1, character: 0} + active: {line: 1, character: 0} +finalState: + documentContents: |+ + + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: ']'}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideUrge.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideUrge.yml new file mode 100644 index 0000000000..460e49bbe9 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeOutsideUrge.yml @@ -0,0 +1,27 @@ +spokenForm: clear outside urge +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any} + mark: {type: decoratedSymbol, symbolColor: default, character: u, usePrePhraseSnapshot: true} + extraArgs: [] +initialState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} + marks: + default.u: + start: {line: 0, character: 14} + end: {line: 0, character: 18} +finalState: + documentContents: ( ) + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} + thatMark: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: u, usePrePhraseSnapshot: true}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairDouble.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairDouble.yml new file mode 100644 index 0000000000..4d3b6907b3 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairDouble.yml @@ -0,0 +1,31 @@ +spokenForm: clear pair double +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: excludeInterior} + mark: {type: decoratedSymbol, symbolColor: default, character: '"'} + extraArgs: [] +marks: + default.": + start: {line: 0, character: 1} + end: {line: 0, character: 2} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: '"'}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: null, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairRound.yml new file mode 100644 index 0000000000..80d8a80e29 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairRound.yml @@ -0,0 +1,27 @@ +spokenForm: clear pair round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeInterior} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairRound2.yml new file mode 100644 index 0000000000..718b4e156f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takePairRound2.yml @@ -0,0 +1,27 @@ +spokenForm: clear pair round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: excludeInterior} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: hello + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: delimitersOnly}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad.yml new file mode 100644 index 0000000000..72d3ef6dae --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad2.yml new file mode 100644 index 0000000000..47de51d50f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad2.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad3.yml new file mode 100644 index 0000000000..dbc6500965 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad3.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\"" + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad4.yml new file mode 100644 index 0000000000..6ef8efab82 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad4.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"()\"" + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad5.yml new file mode 100644 index 0000000000..cf3624fc0b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad5.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"hello\"" + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad6.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad6.yml new file mode 100644 index 0000000000..40baa13288 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeQuad6.yml @@ -0,0 +1,23 @@ +spokenForm: clear quad +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes} + extraArgs: [] +marks: {} +initialState: + documentContents: "\"\\\"\\\"\"" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad.yml new file mode 100644 index 0000000000..c4db72d651 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 0, character: 21} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad2.yml new file mode 100644 index 0000000000..58be265451 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad2.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 22} + active: {line: 0, character: 22} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad3.yml new file mode 100644 index 0000000000..5742cff419 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad3.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 26} + active: {line: 0, character: 26} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad4.yml new file mode 100644 index 0000000000..573f34bcae --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad4.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 22} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} + thatMark: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad5.yml new file mode 100644 index 0000000000..d7c70a73ba --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad5.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 23} + active: {line: 1, character: 23} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} + thatMark: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad6.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad6.yml new file mode 100644 index 0000000000..61645eb81e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad6.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 12} + active: {line: 1, character: 12} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} + thatMark: + - anchor: {line: 0, character: 21} + active: {line: 1, character: 16} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad7.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad7.yml new file mode 100644 index 0000000000..86effc5466 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRightQuad7.yml @@ -0,0 +1,27 @@ +spokenForm: take right quad +languageId: plaintext +command: + actionName: setSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right} + extraArgs: [] +initialState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 26} + active: {line: 1, character: 26} + marks: {} +finalState: + documentContents: |- + hello world whatever "testing testing testing + this is another" test "whatever" whatever + selections: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} + thatMark: + - anchor: {line: 1, character: 22} + active: {line: 1, character: 32} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: doubleQuotes, forceDirection: right}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound.yml new file mode 100644 index 0000000000..aad17d3f01 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound10.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound10.yml new file mode 100644 index 0000000000..cb2e052c43 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound10.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello)) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound11.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound11.yml new file mode 100644 index 0000000000..1bf92e8169 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound11.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello)) + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound12.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound12.yml new file mode 100644 index 0000000000..396d7c456e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound12.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello)) + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound13.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound13.yml new file mode 100644 index 0000000000..7454e8d497 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound13.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello) () ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound14.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound14.yml new file mode 100644 index 0000000000..c415f09e10 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound14.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello) () ) + selections: + - anchor: {line: 0, character: 11} + active: {line: 0, character: 11} +finalState: + documentContents: ((hello) ) + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + thatMark: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound15.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound15.yml new file mode 100644 index 0000000000..04bc4bfcb1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound15.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ((hello) [] ) + selections: + - anchor: {line: 0, character: 12} + active: {line: 0, character: 12} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound16.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound16.yml new file mode 100644 index 0000000000..ff7a45bde2 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound16.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ()() + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} + thatMark: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound17.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound17.yml new file mode 100644 index 0000000000..b9c7b040ca --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound17.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: ()( + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: ( + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound18.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound18.yml new file mode 100644 index 0000000000..8cc07c6b80 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound18.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (\(hello\)) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound19.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound19.yml new file mode 100644 index 0000000000..dd67e0c775 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound19.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound2.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound2.yml new file mode 100644 index 0000000000..4a6157e027 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound2.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound20.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound20.yml new file mode 100644 index 0000000000..829410ab9f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound20.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello (whatever)) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound21.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound21.yml new file mode 100644 index 0000000000..5c6e45e67b --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound21.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello () ) + selections: + - anchor: {line: 0, character: 10} + active: {line: 0, character: 10} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound22.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound22.yml new file mode 100644 index 0000000000..c09e4ae02e --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound22.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello () (whatever)) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound23.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound23.yml new file mode 100644 index 0000000000..48b94ff39d --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound23.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (\(hello\)) + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound3.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound3.yml new file mode 100644 index 0000000000..b60a8cc8f9 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound3.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 6} + active: {line: 0, character: 6} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound4.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound4.yml new file mode 100644 index 0000000000..1dc989999f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound4.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 7} + active: {line: 0, character: 7} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound5.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound5.yml new file mode 100644 index 0000000000..030861b05f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound5.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound6.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound6.yml new file mode 100644 index 0000000000..5ced96766f --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound6.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound7.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound7.yml new file mode 100644 index 0000000000..7434a7d6f5 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound7.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (()) + selections: + - anchor: {line: 0, character: 2} + active: {line: 0, character: 2} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound8.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound8.yml new file mode 100644 index 0000000000..dd7f6380ec --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound8.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (()) + selections: + - anchor: {line: 0, character: 3} + active: {line: 0, character: 3} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound9.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound9.yml new file mode 100644 index 0000000000..bd1451b0c1 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRound9.yml @@ -0,0 +1,23 @@ +spokenForm: clear round +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + extraArgs: [] +marks: {} +initialState: + documentContents: (()) + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +finalState: + documentContents: () + selections: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} + thatMark: + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRoundLeper.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRoundLeper.yml new file mode 100644 index 0000000000..18df0d0b71 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRoundLeper.yml @@ -0,0 +1,27 @@ +spokenForm: clear round leper +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + mark: {type: decoratedSymbol, symbolColor: default, character: (} + extraArgs: [] +marks: + default.(: + start: {line: 0, character: 0} + end: {line: 0, character: 1} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: (}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRoundRepper.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRoundRepper.yml new file mode 100644 index 0000000000..70eeb102c7 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeRoundRepper.yml @@ -0,0 +1,27 @@ +spokenForm: clear round repper +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: parentheses} + mark: {type: decoratedSymbol, symbolColor: default, character: )} + extraArgs: [] +marks: + default.): + start: {line: 0, character: 6} + end: {line: 0, character: 7} +initialState: + documentContents: (hello) + selections: + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: )}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: parentheses, delimiterInclusion: includeDelimiters}}] diff --git a/src/test/suite/fixtures/recorded/surroundingPair/textual/takeSquare.yml b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeSquare.yml new file mode 100644 index 0000000000..3e7abe6845 --- /dev/null +++ b/src/test/suite/fixtures/recorded/surroundingPair/textual/takeSquare.yml @@ -0,0 +1,23 @@ +spokenForm: clear square +languageId: plaintext +command: + actionName: clearAndSetSelection + partialTargets: + - type: primitive + modifier: {type: surroundingPair, delimiter: squareBrackets} + extraArgs: [] +marks: {} +initialState: + documentContents: "[(hello)]" + selections: + - anchor: {line: 0, character: 5} + active: {line: 0, character: 5} +finalState: + documentContents: "" + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + thatMark: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: squareBrackets, delimiterInclusion: includeDelimiters}}] diff --git a/src/typings/Types.ts b/src/typings/Types.ts index eee89d8bfb..a2226a29da 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -66,17 +66,21 @@ export type Mark = | DecoratedSymbol | LineNumber; -export type Delimiter = +export type SimpleSurroundingPairName = | "angleBrackets" | "backtickQuotes" | "curlyBrackets" | "doubleQuotes" - | "escapedSingleQuotes" | "escapedDoubleQuotes" + | "escapedParentheses" + | "escapedSingleQuotes" | "parentheses" | "singleQuotes" - | "squareBrackets" - | "whitespace"; + | "squareBrackets"; +export type ComplexSurroundingPairName = "string" | "any"; +export type SurroundingPairName = + | SimpleSurroundingPairName + | ComplexSurroundingPairName; export type ScopeType = | "argumentOrParameter" @@ -106,10 +110,22 @@ export type ScopeType = export type SubTokenType = "word" | "character"; +/** + * Indicates whether to include or exclude delimiters in a surrounding pair + * modifier. In the future, these will become proper modifiers that can be + * applied in many places, such as to restrict to the body of an if statement. + * By default, a surrounding pair modifier refers to the entire surrounding + * range, so if delimiter inclusion is undefined, it's equivalent to not having + * one of these modifiers; ie include the delimiters. + */ +export type DelimiterInclusion = "excludeInterior" | "interiorOnly" | undefined; + +export type SurroundingPairDirection = "left" | "right"; export interface SurroundingPairModifier { type: "surroundingPair"; - delimiter: Delimiter | null; - delimitersOnly: boolean; + delimiter: SurroundingPairName; + delimiterInclusion: DelimiterInclusion; + forceDirection?: SurroundingPairDirection; } export interface ContainingScopeModifier { diff --git a/src/util/canonicalizeAndValidateCommand.ts b/src/util/canonicalizeAndValidateCommand.ts index 3f2b90741d..9efeb901eb 100644 --- a/src/util/canonicalizeAndValidateCommand.ts +++ b/src/util/canonicalizeAndValidateCommand.ts @@ -1,7 +1,7 @@ import canonicalizeActionName from "./canonicalizeActionName"; import canonicalizeTargets from "./canonicalizeTargets"; import { ActionType, PartialTarget, SelectionType } from "../typings/Types"; -import { getPrimitiveTargets } from "./targetUtils"; +import { getPrimitiveTargets } from "./getPrimitiveTargets"; export function canonicalizeAndValidateCommand( inputActionName: string, diff --git a/src/util/canonicalizeTargets.ts b/src/util/canonicalizeTargets.ts index d7183cbf21..9470fed17a 100755 --- a/src/util/canonicalizeTargets.ts +++ b/src/util/canonicalizeTargets.ts @@ -4,7 +4,7 @@ import { ScopeType, } from "../typings/Types"; import update from "immutability-helper"; -import { transformPrimitiveTargets } from "./targetUtils"; +import { transformPrimitiveTargets } from "./getPrimitiveTargets"; import { HatStyleName } from "../core/constants"; import { flow } from "lodash"; diff --git a/src/util/getPrimitiveTargets.ts b/src/util/getPrimitiveTargets.ts new file mode 100644 index 0000000000..c6abf09d93 --- /dev/null +++ b/src/util/getPrimitiveTargets.ts @@ -0,0 +1,64 @@ +import { + PartialPrimitiveTarget, + PartialRangeTarget, + PartialTarget, +} from "../typings/Types"; + +/** + * Given a list of targets, recursively descends all targets and returns every + * contained primitive target. + * + * @param targets The targets to extract from + * @returns A list of primitive targets + */ + +export function getPrimitiveTargets(targets: PartialTarget[]) { + return targets.flatMap(getPrimitiveTargetsHelper); +} +function getPrimitiveTargetsHelper( + target: PartialTarget +): PartialPrimitiveTarget[] { + switch (target.type) { + case "primitive": + return [target]; + case "list": + return target.elements.flatMap(getPrimitiveTargetsHelper); + case "range": + return [target.start, target.end]; + } +} +/** + * Given a list of targets, recursively descends all targets and applies `func` + * to every primitive target. + * + * @param targets The targets to extract from + * @returns A list of primitive targets + */ + +export function transformPrimitiveTargets( + targets: PartialTarget[], + func: (target: PartialPrimitiveTarget) => PartialPrimitiveTarget +) { + return targets.map((target) => transformPrimitiveTargetsHelper(target, func)); +} +function transformPrimitiveTargetsHelper( + target: PartialTarget, + func: (target: PartialPrimitiveTarget) => PartialPrimitiveTarget +): PartialTarget { + switch (target.type) { + case "primitive": + return func(target); + case "list": + return { + ...target, + elements: target.elements.map( + (element) => + transformPrimitiveTargetsHelper(element, func) as + | PartialPrimitiveTarget + | PartialRangeTarget + ), + }; + case "range": + return { ...target, start: func(target.start), end: func(target.end) }; + } +} diff --git a/src/util/nodeSelectors.ts b/src/util/nodeSelectors.ts index e24262eba1..958bda1e41 100644 --- a/src/util/nodeSelectors.ts +++ b/src/util/nodeSelectors.ts @@ -2,10 +2,28 @@ import { SyntaxNode, Point } from "web-tree-sitter"; import { Position, Range, Selection, TextEditor } from "vscode"; import { SelectionWithContext, SelectionExtractor } from "../typings/Types"; -export function makeRange(startPosition: Point, endPosition: Point) { +export function makeRangeFromPositions( + startPosition: Point, + endPosition: Point +) { return new Range( - new Position(startPosition.row, startPosition.column), - new Position(endPosition.row, endPosition.column) + startPosition.row, + startPosition.column, + endPosition.row, + endPosition.column + ); +} + +export function positionFromPoint(point: Point): Position { + return new Position(point.row, point.column); +} + +export function getNodeRange(node: SyntaxNode) { + return new Range( + node.startPosition.row, + node.startPosition.column, + node.endPosition.row, + node.endPosition.column ); } @@ -44,7 +62,10 @@ export function selectWithLeadingDelimiter( const leadingDelimiterRange = leadingNonDelimiterToken != null - ? makeRange(leadingNonDelimiterToken.endPosition, node.startPosition) + ? makeRangeFromPositions( + leadingNonDelimiterToken.endPosition, + node.startPosition + ) : null; return { @@ -63,7 +84,10 @@ export function selectWithTrailingDelimiter( const trailingDelimiterRange = trailingNonDelimiterToken != null - ? makeRange(node.endPosition, trailingNonDelimiterToken.startPosition) + ? makeRangeFromPositions( + node.endPosition, + trailingNonDelimiterToken.startPosition + ) : null; return { @@ -128,7 +152,7 @@ export function delimitedSelector( ); if (nextNonDelimiterNode != null) { - trailingDelimiterRange = makeRange( + trailingDelimiterRange = makeRangeFromPositions( node.endPosition, nextNonDelimiterNode.startPosition ); @@ -137,7 +161,7 @@ export function delimitedSelector( } if (previousNonDelimiterNode != null) { - leadingDelimiterRange = makeRange( + leadingDelimiterRange = makeRangeFromPositions( previousNonDelimiterNode.endPosition, node.startPosition ); diff --git a/src/util/range.ts b/src/util/range.ts new file mode 100644 index 0000000000..7f93473bdc --- /dev/null +++ b/src/util/range.ts @@ -0,0 +1,14 @@ +import { Range, TextDocument } from "vscode"; + +/** + * Get a range that corresponds to the entire contents of the given document. + * + * @param document The document to consider + * @returns A range corresponding to the entire document contents + */ +export function getDocumentRange(document: TextDocument) { + const firstLine = document.lineAt(0); + const lastLine = document.lineAt(document.lineCount - 1); + + return new Range(firstLine.range.start, lastLine.range.end); +} diff --git a/src/util/regex.ts b/src/util/regex.ts index 192ffc1c8e..7210250f58 100644 --- a/src/util/regex.ts +++ b/src/util/regex.ts @@ -29,3 +29,11 @@ function makeCache(func: (arg: T) => U) { export const rightAnchored = makeCache(_rightAnchored); export const leftAnchored = makeCache(_leftAnchored); + +export function matchAll( + text: string, + regex: RegExp, + mapfn: (v: RegExpMatchArray, k: number) => T +) { + return Array.from(text.matchAll(regex), mapfn); +} diff --git a/src/util/targetUtils.ts b/src/util/targetUtils.ts index a1a74999ea..ba7c544c79 100644 --- a/src/util/targetUtils.ts +++ b/src/util/targetUtils.ts @@ -1,11 +1,6 @@ import { TextEditor, Selection, Position } from "vscode"; import { groupBy } from "./itertools"; -import { - PartialPrimitiveTarget, - PartialRangeTarget, - PartialTarget, - TypedSelection, -} from "../typings/Types"; +import { TypedSelection } from "../typings/Types"; export function ensureSingleEditor(targets: TypedSelection[]) { if (targets.length === 0) { @@ -91,63 +86,3 @@ function createTypeSelection( position: "contents", }; } - -/** - * Given a list of targets, recursively descends all targets and returns every - * contained primitive target. - * - * @param targets The targets to extract from - * @returns A list of primitive targets - */ -export function getPrimitiveTargets(targets: PartialTarget[]) { - return targets.flatMap(getPrimitiveTargetsHelper); -} - -function getPrimitiveTargetsHelper( - target: PartialTarget -): PartialPrimitiveTarget[] { - switch (target.type) { - case "primitive": - return [target]; - case "list": - return target.elements.flatMap(getPrimitiveTargetsHelper); - case "range": - return [target.start, target.end]; - } -} - -/** - * Given a list of targets, recursively descends all targets and applies `func` - * to every primitive target. - * - * @param targets The targets to extract from - * @returns A list of primitive targets - */ -export function transformPrimitiveTargets( - targets: PartialTarget[], - func: (target: PartialPrimitiveTarget) => PartialPrimitiveTarget -) { - return targets.map((target) => transformPrimitiveTargetsHelper(target, func)); -} - -function transformPrimitiveTargetsHelper( - target: PartialTarget, - func: (target: PartialPrimitiveTarget) => PartialPrimitiveTarget -): PartialTarget { - switch (target.type) { - case "primitive": - return func(target); - case "list": - return { - ...target, - elements: target.elements.map( - (element) => - transformPrimitiveTargetsHelper(element, func) as - | PartialPrimitiveTarget - | PartialRangeTarget - ), - }; - case "range": - return { ...target, start: func(target.start), end: func(target.end) }; - } -}