From c07b8ad70d6bf8002f105670048bef864de7ca08 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Wed, 9 Mar 2022 16:36:09 -0500 Subject: [PATCH 01/11] Add support for 'all' modifier for items --- .../src/modifiers/containing_scope.py | 3 +- src/languages/getNodeMatcher.ts | 25 ++++++++++++--- .../modifiers/processModifier.ts | 3 +- .../recorded/languages/ruby/chuckAllItem.yml | 31 +++++++++++++++++++ .../recorded/languages/ruby/chuckAllItem2.yml | 29 +++++++++++++++++ .../recorded/languages/ruby/chuckAllItem3.yml | 23 ++++++++++++++ .../recorded/languages/ruby/chuckAllItem4.yml | 23 ++++++++++++++ src/typings/Types.ts | 1 + 8 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml create mode 100644 src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml create mode 100644 src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml create mode 100644 src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index 148208b03f..c7d7acadd7 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -46,7 +46,7 @@ } -@mod.capture(rule="[every] {user.cursorless_scope_type}") +@mod.capture(rule="[(every|all)] {user.cursorless_scope_type}") def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: """Expand to containing scope""" return { @@ -54,6 +54,7 @@ def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: "type": "containingScope", "scopeType": m.cursorless_scope_type, "includeSiblings": m[0] == "every", + "includeAll": m[0] == "all", } } diff --git a/src/languages/getNodeMatcher.ts b/src/languages/getNodeMatcher.ts index fb8feb6799..30559dfea8 100644 --- a/src/languages/getNodeMatcher.ts +++ b/src/languages/getNodeMatcher.ts @@ -21,11 +21,14 @@ import go from "./go"; import { patternMatchers as ruby } from "./ruby" import { UnsupportedLanguageError } from "../errors"; import { SupportedLanguageId } from "./constants"; +import { Selection } from "vscode"; + export function getNodeMatcher( languageId: string, scopeType: ScopeType, - includeSiblings: boolean + includeSiblings: boolean, + includeAll: boolean, ): NodeMatcher { const matchers = languageMatchers[languageId as SupportedLanguageId]; @@ -39,8 +42,8 @@ export function getNodeMatcher( return notSupported; } - if (includeSiblings) { - return matcherIncludeSiblings(matcher); + if (includeSiblings || includeAll) { + return matcherIncludeSiblings(matcher, includeAll); } return matcher; @@ -70,7 +73,9 @@ const languageMatchers: Record< xml: html, }; -function matcherIncludeSiblings(matcher: NodeMatcher): NodeMatcher { +function matcherIncludeSiblings( + matcher: NodeMatcher, + includeAll: boolean): NodeMatcher { return ( selection: SelectionWithEditor, node: SyntaxNode @@ -87,7 +92,16 @@ function matcherIncludeSiblings(matcher: NodeMatcher): NodeMatcher { ) ) as NodeMatcherValue[]; if (matches.length > 0) { - return matches; + if (matches.length >= 2 && includeAll){ + const start = matches[0].selection.selection; + const end = matches[matches.length - 1].selection.selection; + + matches[0].selection.selection = start.union(end) as Selection; + + return [matches[0]] as NodeMatcherValue[]; + } else { + return matches; + } } return null; }; @@ -110,3 +124,4 @@ function iterateNearestIterableAncestor( } return []; } + diff --git a/src/processTargets/modifiers/processModifier.ts b/src/processTargets/modifiers/processModifier.ts index c1bde3c79c..cd2e20754b 100644 --- a/src/processTargets/modifiers/processModifier.ts +++ b/src/processTargets/modifiers/processModifier.ts @@ -77,7 +77,8 @@ function processScopeType( const nodeMatcher = getNodeMatcher( selection.editor.document.languageId, modifier.scopeType, - modifier.includeSiblings ?? false + modifier.includeSiblings ?? false, + modifier.includeAll ?? false, ); const node: SyntaxNode | null = context.getNodeAtLocation( new Location(selection.editor.document.uri, selection.selection) diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml new file mode 100644 index 0000000000..f67d1e07fa --- /dev/null +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml @@ -0,0 +1,31 @@ +languageId: ruby +command: + version: 1 + spokenForm: chuck all item + action: remove + targets: + - type: primitive + modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} +initialState: + documentContents: |- + [ + 1, + 2, + 3 + ] + selections: + - anchor: {line: 3, character: 3} + active: {line: 3, character: 3} + marks: {} +finalState: + documentContents: |- + [ + + ] + selections: + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} + thatMark: + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml new file mode 100644 index 0000000000..f3368fe730 --- /dev/null +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml @@ -0,0 +1,29 @@ +languageId: ruby +command: + version: 1 + spokenForm: chuck all item + action: remove + targets: + - type: primitive + modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} +initialState: + documentContents: |- + [ + 1 + ] + selections: + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} + marks: {} +finalState: + documentContents: |- + [ + + ] + selections: + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} + thatMark: + - anchor: {line: 1, character: 2} + active: {line: 1, character: 2} +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml new file mode 100644 index 0000000000..ca6feb87c9 --- /dev/null +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml @@ -0,0 +1,23 @@ +languageId: ruby +command: + version: 1 + spokenForm: chuck all item + action: remove + targets: + - type: primitive + modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} +initialState: + documentContents: "[1, 2, 3]" + 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: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml new file mode 100644 index 0000000000..4c8b6d6903 --- /dev/null +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml @@ -0,0 +1,23 @@ +languageId: typescript +command: + version: 1 + spokenForm: chuck all item + action: remove + targets: + - type: primitive + modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} +initialState: + documentContents: "[1, 2, 3]" + 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: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] diff --git a/src/typings/Types.ts b/src/typings/Types.ts index f770bd1726..3960a11a05 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -151,6 +151,7 @@ export interface ContainingScopeModifier { scopeType: ScopeType; valueOnly?: boolean; includeSiblings?: boolean; + includeAll?: boolean; } export interface SubTokenModifier { From e1320fae6bb4c433688de4282e0510ca38516fa6 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Wed, 9 Mar 2022 16:40:28 -0500 Subject: [PATCH 02/11] Add test for map --- .../languages/typescript/chuckAllItem.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml diff --git a/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml b/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml new file mode 100644 index 0000000000..d14d6ecd6b --- /dev/null +++ b/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml @@ -0,0 +1,23 @@ +languageId: typescript +command: + version: 1 + spokenForm: chuck all item + action: remove + targets: + - type: primitive + modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: false, includeAll: true} +initialState: + documentContents: "let a = { a: 10, b: 10 }" + selections: + - anchor: {line: 0, character: 20} + active: {line: 0, character: 20} + marks: {} +finalState: + documentContents: let a = { } + 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: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: false, includeAll: true}, isImplicit: false}] From e1c103bb2105749531b13a34acd14f8f83ea1d0d Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Wed, 9 Mar 2022 16:53:54 -0500 Subject: [PATCH 03/11] Update function calls to support extra parameter --- src/languages/getTextFragmentExtractor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/getTextFragmentExtractor.ts b/src/languages/getTextFragmentExtractor.ts index 0267846b0e..a6878db51b 100644 --- a/src/languages/getTextFragmentExtractor.ts +++ b/src/languages/getTextFragmentExtractor.ts @@ -20,7 +20,7 @@ function constructDefaultTextFragmentExtractor( languageId: SupportedLanguageId, stringTextFragmentExtractor?: TextFragmentExtractor ): TextFragmentExtractor { - const commentNodeMatcher = getNodeMatcher(languageId, "comment", false); + const commentNodeMatcher = getNodeMatcher(languageId, "comment", false, false); stringTextFragmentExtractor = stringTextFragmentExtractor ?? constructDefaultStringTextFragmentExtractor(languageId); @@ -52,7 +52,7 @@ function constructDefaultTextFragmentExtractor( function constructDefaultStringTextFragmentExtractor( languageId: SupportedLanguageId ): TextFragmentExtractor { - const stringNodeMatcher = getNodeMatcher(languageId, "string", false); + const stringNodeMatcher = getNodeMatcher(languageId, "string", false, false); return (node: SyntaxNode, selection: SelectionWithEditor) => { if (stringNodeMatcher(selection, node) != null) { @@ -80,7 +80,7 @@ function constructDefaultStringTextFragmentExtractor( function constructHackedStringTextFragmentExtractor( languageId: SupportedLanguageId ) { - const stringNodeMatcher = getNodeMatcher(languageId, "string", false); + const stringNodeMatcher = getNodeMatcher(languageId, "string", false, false); return (node: SyntaxNode, selection: SelectionWithEditor) => { if (stringNodeMatcher(selection, node) != null) { From cece6896d6e3d4f3f7aa1e02a7207197fa60a37a Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Thu, 10 Mar 2022 17:46:28 -0500 Subject: [PATCH 04/11] Update README, ensure no odd behavior when trying to select 'all key' --- cursorless-talon/src/modifiers/containing_scope.py | 3 ++- docs/user/README.md | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index c7d7acadd7..0d9202db12 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -49,12 +49,13 @@ @mod.capture(rule="[(every|all)] {user.cursorless_scope_type}") def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: """Expand to containing scope""" + print(f'testing testing" {m.cursorless_scope_type == "collectionItem"}') return { "modifier": { "type": "containingScope", "scopeType": m.cursorless_scope_type, "includeSiblings": m[0] == "every", - "includeAll": m[0] == "all", + "includeAll": m[0] == "all" and m.cursorless_scope_type == "collectionItem", } } diff --git a/docs/user/README.md b/docs/user/README.md index f3103a5cdc..2749035ebc 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -23,6 +23,7 @@ Note: If you'd like to customize any of the spoken forms, please see the [docume - [Modifiers](#modifiers) - [Syntactic scopes](#syntactic-scopes) - [`"every"`](#every) + - [`"all"`](#all) - [Sub-token modifiers](#sub-token-modifiers) - [`"word"`](#word) - [`"char"`](#char) @@ -196,6 +197,13 @@ The command `"every"` can be used to select a syntactic element and all of its m For example, the command `take every key [blue] air` will select every key in the map/object/dict including the token with a blue hat over the letter 'a'. +##### `"all"` + +The command `"all"` can be used to select items within a collection and return a single selection. This differs `"every"` in that is can only be used on collection items, not keys or values, as it returns a single selection. + +- `"take all item air"` +- `"take all item"` (if cursor is currently within a key) + ##### Sub-token modifiers ###### `"word"` From af830f93bea7422c538928b96a784addbdb2df28 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Thu, 14 Apr 2022 22:37:16 -0400 Subject: [PATCH 05/11] Update PR to reflect notes from Pokey --- .../src/modifiers/containing_scope.py | 30 +++++--- src/languages/getNodeMatcher.ts | 68 +++++++++---------- .../modifiers/processModifier.ts | 26 ++++--- src/typings/Types.ts | 10 ++- 4 files changed, 79 insertions(+), 55 deletions(-) diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index 0d9202db12..943e2b55ef 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -45,20 +45,30 @@ "end tag": "xmlEndTag", } +select_multiple_modifiers = { + "every", + "all" +} + @mod.capture(rule="[(every|all)] {user.cursorless_scope_type}") def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: - """Expand to containing scope""" - print(f'testing testing" {m.cursorless_scope_type == "collectionItem"}') - return { - "modifier": { - "type": "containingScope", - "scopeType": m.cursorless_scope_type, - "includeSiblings": m[0] == "every", - "includeAll": m[0] == "all" and m.cursorless_scope_type == "collectionItem", + """Expand to every scope""" + if m[0] in select_multiple_modifiers: + return { + "modifier": { + "type": "everyScope", + "scopeType": m.cursorless_scope_type, + "contiguousRange": m[0] == "all" + } + } + else: + return { + "modifier": { + "type": "containingScope", + "scopeType": m.cursorless_scope_type + } } - } - # NOTE: Please do not change these dicts. Use the CSVs for customization. # See https://github.com/cursorless-dev/cursorless-vscode/blob/main/docs/user/customization.md diff --git a/src/languages/getNodeMatcher.ts b/src/languages/getNodeMatcher.ts index 30559dfea8..a56fed150a 100644 --- a/src/languages/getNodeMatcher.ts +++ b/src/languages/getNodeMatcher.ts @@ -27,8 +27,6 @@ import { Selection } from "vscode"; export function getNodeMatcher( languageId: string, scopeType: ScopeType, - includeSiblings: boolean, - includeAll: boolean, ): NodeMatcher { const matchers = languageMatchers[languageId as SupportedLanguageId]; @@ -42,44 +40,20 @@ export function getNodeMatcher( return notSupported; } - if (includeSiblings || includeAll) { - return matcherIncludeSiblings(matcher, includeAll); - } - return matcher; } -const languageMatchers: Record< - SupportedLanguageId, - Record -> = { - c: cpp, - cpp, - csharp, - clojure, - go, - html, - java, - javascript: typescript, - javascriptreact: typescript, - json, - jsonc: json, - markdown, - python, - ruby, - scala, - typescript, - typescriptreact: typescript, - xml: html, -}; - -function matcherIncludeSiblings( - matcher: NodeMatcher, - includeAll: boolean): NodeMatcher { +export function getNodeMatcherWithSiblings( + languageId: string, + scopeType: ScopeType, + contiguousRange: boolean +): NodeMatcher { return ( selection: SelectionWithEditor, node: SyntaxNode ): NodeMatcherValue[] | null => { + + const matcher = getNodeMatcher(languageId, scopeType); let matches = matcher(selection, node); if (matches == null) { return null; @@ -92,10 +66,10 @@ function matcherIncludeSiblings( ) ) as NodeMatcherValue[]; if (matches.length > 0) { - if (matches.length >= 2 && includeAll){ + if (matches.length >= 2 && contiguousRange) { const start = matches[0].selection.selection; const end = matches[matches.length - 1].selection.selection; - + matches[0].selection.selection = start.union(end) as Selection; return [matches[0]] as NodeMatcherValue[]; @@ -107,6 +81,30 @@ function matcherIncludeSiblings( }; } +const languageMatchers: Record< + SupportedLanguageId, + Record +> = { + c: cpp, + cpp, + csharp, + clojure, + go, + html, + java, + javascript: typescript, + javascriptreact: typescript, + json, + jsonc: json, + markdown, + python, + ruby, + scala, + typescript, + typescriptreact: typescript, + xml: html, +}; + function iterateNearestIterableAncestor( node: SyntaxNode, selection: SelectionWithEditor, diff --git a/src/processTargets/modifiers/processModifier.ts b/src/processTargets/modifiers/processModifier.ts index cd2e20754b..eb2e6136fb 100644 --- a/src/processTargets/modifiers/processModifier.ts +++ b/src/processTargets/modifiers/processModifier.ts @@ -6,6 +6,7 @@ import { SUBWORD_MATCHER } from "../../core/constants"; import { selectionWithEditorFromRange } from "../../util/selectionUtils"; import { ContainingScopeModifier, + EveryScopeModifier, HeadModifier, NodeMatcher, PrimitiveTarget, @@ -16,7 +17,7 @@ import { TailModifier, } from "../../typings/Types"; import { processSurroundingPair } from "./surroundingPair"; -import { getNodeMatcher } from "../../languages/getNodeMatcher"; +import { getNodeMatcher, getNodeMatcherWithSiblings } from "../../languages/getNodeMatcher"; export type SelectionWithEditorWithContext = { selection: SelectionWithEditor; @@ -36,6 +37,7 @@ export default function ( result = [{ selection, context: {} }]; break; + case "everyScope": case "containingScope": result = processScopeType(context, selection, modifier); break; @@ -72,14 +74,22 @@ export default function ( function processScopeType( context: ProcessedTargetsContext, selection: SelectionWithEditor, - modifier: ContainingScopeModifier + modifier: ContainingScopeModifier | EveryScopeModifier, ): SelectionWithEditorWithContext[] | null { - const nodeMatcher = getNodeMatcher( - selection.editor.document.languageId, - modifier.scopeType, - modifier.includeSiblings ?? false, - modifier.includeAll ?? false, - ); + let nodeMatcher; + if ("contiguousRange" in modifier) { + nodeMatcher = getNodeMatcherWithSiblings( + selection.editor.document.languageId, + modifier.scopeType, + modifier.contiguousRange + ); + } else { + nodeMatcher = getNodeMatcher( + selection.editor.document.languageId, + modifier.scopeType + ); + } + const node: SyntaxNode | null = context.getNodeAtLocation( new Location(selection.editor.document.uri, selection.selection) ); diff --git a/src/typings/Types.ts b/src/typings/Types.ts index 3960a11a05..a6a259248e 100644 --- a/src/typings/Types.ts +++ b/src/typings/Types.ts @@ -150,8 +150,13 @@ export interface ContainingScopeModifier { type: "containingScope"; scopeType: ScopeType; valueOnly?: boolean; - includeSiblings?: boolean; - includeAll?: boolean; +} + +export interface EveryScopeModifier { + type: "everyScope"; + scopeType: ScopeType; + valueOnly?: boolean; + contiguousRange: boolean; } export interface SubTokenModifier { @@ -192,6 +197,7 @@ export type Modifier = | IdentityModifier | SurroundingPairModifier | ContainingScopeModifier + | EveryScopeModifier | SubTokenModifier // | MatchingPairSymbolModifier Not implemented | HeadModifier From 540a9942577232e030f052c073c5fa7afb1e0370 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Thu, 14 Apr 2022 22:46:28 -0400 Subject: [PATCH 06/11] Fix type signature --- src/actions/WrapWithSnippet.ts | 3 +-- src/languages/getTextFragmentExtractor.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/actions/WrapWithSnippet.ts b/src/actions/WrapWithSnippet.ts index 0fc160c4c6..5e02f7e356 100644 --- a/src/actions/WrapWithSnippet.ts +++ b/src/actions/WrapWithSnippet.ts @@ -42,8 +42,7 @@ export default class WrapWithSnippet implements Action { ? undefined : { type: "containingScope", - scopeType: defaultScopeType, - includeSiblings: false, + scopeType: defaultScopeType }, }, ]; diff --git a/src/languages/getTextFragmentExtractor.ts b/src/languages/getTextFragmentExtractor.ts index 48fd3dd6dc..7624b5ef38 100644 --- a/src/languages/getTextFragmentExtractor.ts +++ b/src/languages/getTextFragmentExtractor.ts @@ -21,7 +21,7 @@ function constructDefaultTextFragmentExtractor( languageId: SupportedLanguageId, stringTextFragmentExtractor?: TextFragmentExtractor ): TextFragmentExtractor { - const commentNodeMatcher = getNodeMatcher(languageId, "comment", false, false); + const commentNodeMatcher = getNodeMatcher(languageId, "comment"); stringTextFragmentExtractor = stringTextFragmentExtractor ?? constructDefaultStringTextFragmentExtractor(languageId); @@ -53,7 +53,7 @@ function constructDefaultTextFragmentExtractor( function constructDefaultStringTextFragmentExtractor( languageId: SupportedLanguageId ): TextFragmentExtractor { - const stringNodeMatcher = getNodeMatcher(languageId, "string", false, false); + const stringNodeMatcher = getNodeMatcher(languageId, "string"); return (node: SyntaxNode, selection: SelectionWithEditor) => { if (stringNodeMatcher(selection, node) != null) { @@ -81,7 +81,7 @@ function constructDefaultStringTextFragmentExtractor( function constructHackedStringTextFragmentExtractor( languageId: SupportedLanguageId ) { - const stringNodeMatcher = getNodeMatcher(languageId, "string", false, false); + const stringNodeMatcher = getNodeMatcher(languageId, "string"); return (node: SyntaxNode, selection: SelectionWithEditor) => { if (stringNodeMatcher(selection, node) != null) { From e94419a3b9983569f7883a4641c3cae342c28deb Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Thu, 14 Apr 2022 23:00:07 -0400 Subject: [PATCH 07/11] Update tess to reflect new modifier --- .../suite/fixtures/recorded/actions/chuckEveryArgMade.yml | 4 ++-- src/test/suite/fixtures/recorded/actions/cutEveryArgMade.yml | 4 ++-- src/test/suite/fixtures/recorded/actions/moveEveryArgMade.yml | 4 ++-- .../fixtures/recorded/languages/clojure/clearEveryItem.yml | 4 ++-- .../fixtures/recorded/languages/clojure/clearEveryKey.yml | 4 ++-- .../fixtures/recorded/languages/clojure/clearEveryValue.yml | 4 ++-- .../suite/fixtures/recorded/languages/cpp/takeEveryArg.yml | 4 ++-- .../suite/fixtures/recorded/languages/cpp/takeEveryItem.yml | 4 ++-- .../suite/fixtures/recorded/languages/go/takeEveryItem.yml | 4 ++-- .../suite/fixtures/recorded/languages/go/takeEveryKey.yml | 4 ++-- .../suite/fixtures/recorded/languages/java/takeEveryArg.yml | 4 ++-- .../suite/fixtures/recorded/languages/java/takeEveryArg2.yml | 4 ++-- .../suite/fixtures/recorded/languages/java/takeEveryItem.yml | 4 ++-- .../fixtures/recorded/languages/jsx/takeEveryAttribute.yml | 4 ++-- .../suite/fixtures/recorded/languages/php/changeEveryArg.yml | 4 ++-- .../suite/fixtures/recorded/languages/php/changeEveryItem.yml | 4 ++-- .../suite/fixtures/recorded/languages/php/chuckEveryArg.yml | 4 ++-- .../suite/fixtures/recorded/languages/php/chuckEveryItem.yml | 4 ++-- .../fixtures/recorded/languages/python/clearEveryValue.yml | 4 ++-- .../suite/fixtures/recorded/languages/python/takeEveryArg.yml | 4 ++-- .../fixtures/recorded/languages/python/takeEveryArg2.yml | 4 ++-- .../fixtures/recorded/languages/python/takeEveryItem.yml | 4 ++-- .../fixtures/recorded/languages/python/takeEveryItem2.yml | 4 ++-- .../fixtures/recorded/languages/python/takeEveryItem3.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/changeEveryArg.yml | 4 ++-- .../fixtures/recorded/languages/ruby/changeEveryArg2.yml | 4 ++-- .../fixtures/recorded/languages/ruby/changeEveryArg3.yml | 4 ++-- .../fixtures/recorded/languages/ruby/changeEveryItem.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/changeEveryKey.yml | 4 ++-- .../fixtures/recorded/languages/ruby/changeEveryKey2.yml | 4 ++-- .../fixtures/recorded/languages/ruby/changeEveryKey3.yml | 4 ++-- .../fixtures/recorded/languages/ruby/changeEveryKey4.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckAllItem.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckEveryArg.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckEveryArg2.yml | 4 ++-- .../suite/fixtures/recorded/languages/ruby/chuckEveryItem.yml | 4 ++-- .../fixtures/recorded/languages/typescript/chuckAllItem.yml | 4 ++-- .../recorded/languages/typescript/takeEveryArgAir.yml | 4 ++-- .../recorded/languages/typescript/takeEveryArgBat.yml | 4 ++-- .../recorded/languages/typescript/takeEveryArgRam.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryItem.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryItem2.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryItem3.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryItem4.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryItem5.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryKey.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryKey2.yml | 4 ++-- .../fixtures/recorded/languages/typescript/takeEveryValue.yml | 4 ++-- .../recorded/languages/typescript/takeEveryValue2.yml | 4 ++-- .../suite/fixtures/recorded/languages/xml/clearEveryAtHer.yml | 4 ++-- .../suite/fixtures/recorded/languages/xml/clearEveryEli.yml | 4 ++-- .../suite/fixtures/recorded/languages/xml/clearEveryTags.yml | 4 ++-- 55 files changed, 110 insertions(+), 110 deletions(-) diff --git a/src/test/suite/fixtures/recorded/actions/chuckEveryArgMade.yml b/src/test/suite/fixtures/recorded/actions/chuckEveryArgMade.yml index 7c845ec8c8..70706679f9 100644 --- a/src/test/suite/fixtures/recorded/actions/chuckEveryArgMade.yml +++ b/src/test/suite/fixtures/recorded/actions/chuckEveryArgMade.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} mark: {type: decoratedSymbol, symbolColor: default, character: m} initialState: documentContents: "function myFunk(value: string, name: string, age: number) { };" @@ -24,4 +24,4 @@ finalState: thatMark: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: m}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: m}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/actions/cutEveryArgMade.yml b/src/test/suite/fixtures/recorded/actions/cutEveryArgMade.yml index ecad8ec518..ce15c2cd71 100644 --- a/src/test/suite/fixtures/recorded/actions/cutEveryArgMade.yml +++ b/src/test/suite/fixtures/recorded/actions/cutEveryArgMade.yml @@ -5,7 +5,7 @@ command: action: cutToClipboard targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} mark: {type: decoratedSymbol, symbolColor: default, character: m} initialState: documentContents: "function myFunk(value: string, name: string, age: number) { };" @@ -24,4 +24,4 @@ finalState: thatMark: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: m}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: m}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/actions/moveEveryArgMade.yml b/src/test/suite/fixtures/recorded/actions/moveEveryArgMade.yml index 1bfcc64d75..535185ce88 100644 --- a/src/test/suite/fixtures/recorded/actions/moveEveryArgMade.yml +++ b/src/test/suite/fixtures/recorded/actions/moveEveryArgMade.yml @@ -5,7 +5,7 @@ command: action: moveToTarget targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} mark: {type: decoratedSymbol, symbolColor: default, character: m} - {type: primitive, isImplicit: true} initialState: @@ -31,4 +31,4 @@ finalState: sourceMark: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: m}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, isImplicit: false}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}, isImplicit: true}] +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: m}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, isImplicit: false}, {type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: null, modifier: {type: identity}, isImplicit: true}] diff --git a/src/test/suite/fixtures/recorded/languages/clojure/clearEveryItem.yml b/src/test/suite/fixtures/recorded/languages/clojure/clearEveryItem.yml index f89964a201..e9fe600aeb 100644 --- a/src/test/suite/fixtures/recorded/languages/clojure/clearEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/clojure/clearEveryItem.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: |- @@ -36,4 +36,4 @@ finalState: active: {line: 2, character: 4} - anchor: {line: 4, character: 4} active: {line: 4, character: 4} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/clojure/clearEveryKey.yml b/src/test/suite/fixtures/recorded/languages/clojure/clearEveryKey.yml index 83dc76718a..47432e2dcd 100644 --- a/src/test/suite/fixtures/recorded/languages/clojure/clearEveryKey.yml +++ b/src/test/suite/fixtures/recorded/languages/clojure/clearEveryKey.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: |- @@ -36,4 +36,4 @@ finalState: active: {line: 2, character: 4} - anchor: {line: 4, character: 4} active: {line: 4, character: 4} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/clojure/clearEveryValue.yml b/src/test/suite/fixtures/recorded/languages/clojure/clearEveryValue.yml index c72cb7223d..68bb0bc083 100644 --- a/src/test/suite/fixtures/recorded/languages/clojure/clearEveryValue.yml +++ b/src/test/suite/fixtures/recorded/languages/clojure/clearEveryValue.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: value, includeSiblings: true} + modifier: {type: everyScope, scopeType: value, contiguousRange: false} initialState: documentContents: |- @@ -36,4 +36,4 @@ finalState: active: {line: 2, character: 9} - anchor: {line: 4, character: 9} active: {line: 4, character: 9} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: value, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: value, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml index 12729ba3ad..372e286779 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryArg.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} initialState: documentContents: |- int f(int a, int b) { @@ -30,4 +30,4 @@ finalState: active: {line: 1, character: 14} - anchor: {line: 1, character: 16} active: {line: 1, character: 17} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml index 998916b972..a9cfc66b82 100644 --- a/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/cpp/takeEveryItem.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: |- int f(int a, int b) { @@ -30,4 +30,4 @@ finalState: active: {line: 1, character: 26} - anchor: {line: 1, character: 28} active: {line: 1, character: 29} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/go/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/go/takeEveryItem.yml index aac30d040c..f376ca3aba 100644 --- a/src/test/suite/fixtures/recorded/languages/go/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/go/takeEveryItem.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: "map[string]string{\"air\": \"bat\", \"cap\": \"drum\"}" selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 30} - anchor: {line: 0, character: 32} active: {line: 0, character: 45} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/go/takeEveryKey.yml b/src/test/suite/fixtures/recorded/languages/go/takeEveryKey.yml index a51b990a9c..7c17204074 100644 --- a/src/test/suite/fixtures/recorded/languages/go/takeEveryKey.yml +++ b/src/test/suite/fixtures/recorded/languages/go/takeEveryKey.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: "map[string]string{\"air\": \"bat\", \"cap\": \"drum\"}" selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 23} - anchor: {line: 0, character: 32} active: {line: 0, character: 37} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml index b24537334f..7c753aadb7 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} initialState: documentContents: | @@ -36,4 +36,4 @@ finalState: active: {line: 2, character: 31} - anchor: {line: 2, character: 33} active: {line: 2, character: 42} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml index 9974d5688c..57a874728b 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeEveryArg2.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} initialState: documentContents: | @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 11} - anchor: {line: 1, character: 13} active: {line: 1, character: 14} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml index db670eefbf..fd3da4c823 100644 --- a/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/java/takeEveryItem.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: | @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 20} - anchor: {line: 1, character: 22} active: {line: 1, character: 23} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml b/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml index 8905d32546..9d0872599c 100644 --- a/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml +++ b/src/test/suite/fixtures/recorded/languages/jsx/takeEveryAttribute.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: attribute, includeSiblings: true} + modifier: {type: everyScope, scopeType: attribute, contiguousRange: false} initialState: documentContents: | @@ -32,4 +32,4 @@ finalState: active: {line: 2, character: 15} - anchor: {line: 2, character: 16} active: {line: 2, character: 26} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: attribute, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: attribute, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/php/changeEveryArg.yml b/src/test/suite/fixtures/recorded/languages/php/changeEveryArg.yml index eb4720d965..addddc004b 100644 --- a/src/test/suite/fixtures/recorded/languages/php/changeEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/php/changeEveryArg.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} initialState: documentContents: |- "one", "2" => "two"} selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 5} - anchor: {line: 0, character: 16} active: {line: 0, character: 16} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey2.yml b/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey2.yml index 175cc867a6..46605159ea 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey2.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey2.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: "h = {\"1\": \"one\", \"2\": \"two\" }" selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 5} - anchor: {line: 0, character: 14} active: {line: 0, character: 14} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey3.yml b/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey3.yml index dd507c763b..52bf576322 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey3.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey3.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: h = {"1" => "one", "2" => "two" } selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 5} - anchor: {line: 0, character: 16} active: {line: 0, character: 16} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey4.yml b/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey4.yml index 60a546fb8b..239f215298 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey4.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/changeEveryKey4.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: "h = { one: \"one\", two: \"two\" }" selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 6} - anchor: {line: 0, character: 15} active: {line: 0, character: 15} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml index f67d1e07fa..2010086992 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: true} initialState: documentContents: |- [ @@ -28,4 +28,4 @@ finalState: thatMark: - anchor: {line: 1, character: 2} active: {line: 1, character: 2} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml index f3368fe730..378ece9a29 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem2.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: true} initialState: documentContents: |- [ @@ -26,4 +26,4 @@ finalState: thatMark: - anchor: {line: 1, character: 2} active: {line: 1, character: 2} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml index ca6feb87c9..63640cafe0 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem3.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: true} initialState: documentContents: "[1, 2, 3]" selections: @@ -20,4 +20,4 @@ finalState: 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: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml index 4c8b6d6903..44d4eab87b 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckAllItem4.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: true} initialState: documentContents: "[1, 2, 3]" selections: @@ -20,4 +20,4 @@ finalState: 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: containingScope, scopeType: collectionItem, includeSiblings: true, includeAll: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg.yml index ea0410fe9a..80088b9ea7 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} initialState: documentContents: |- def hello_world(name, name2) @@ -26,4 +26,4 @@ finalState: thatMark: - anchor: {line: 0, character: 16} active: {line: 0, character: 16} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg2.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg2.yml index 8a7beacc36..c89c06bdd1 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg2.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryArg2.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} initialState: documentContents: | [1, 2, 3].each_with_the_next { |n, i| } @@ -22,4 +22,4 @@ finalState: thatMark: - anchor: {line: 0, character: 32} active: {line: 0, character: 32} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryItem.yml b/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryItem.yml index e7c942882f..61e4364d2b 100644 --- a/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/ruby/chuckEveryItem.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: | [1, 2, 3] @@ -22,4 +22,4 @@ finalState: 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: containingScope, scopeType: collectionItem, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml b/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml index d14d6ecd6b..f6a9b292f9 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/chuckAllItem.yml @@ -5,7 +5,7 @@ command: action: remove targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: false, includeAll: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: true} initialState: documentContents: "let a = { a: 10, b: 10 }" selections: @@ -20,4 +20,4 @@ finalState: thatMark: - anchor: {line: 0, character: 10} active: {line: 0, character: 10} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: false, includeAll: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: outside, modifier: {type: everyScope, scopeType: collectionItem, includeSiblings: false, includeAll: true}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml index b9ef37a268..e1de7633b9 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgAir.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} mark: {type: decoratedSymbol, symbolColor: default, character: a} initialState: documentContents: foo(bar(baz, bongo), bazman) @@ -28,4 +28,4 @@ finalState: active: {line: 0, character: 11} - anchor: {line: 0, character: 13} active: {line: 0, character: 18} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: a}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml index f2195d7bab..a1fafc6e48 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgBat.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} mark: {type: decoratedSymbol, symbolColor: default, character: b} initialState: documentContents: foo(bar(baz, bongo), bazman) @@ -28,4 +28,4 @@ finalState: active: {line: 0, character: 19} - anchor: {line: 0, character: 21} active: {line: 0, character: 27} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: b}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: b}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml index 9ab231825c..2d3216325c 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryArgRam.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true} + modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false} mark: {type: decoratedSymbol, symbolColor: default, character: r} initialState: documentContents: foo(bar(baz, bongo), bazman) @@ -28,4 +28,4 @@ finalState: active: {line: 0, character: 19} - anchor: {line: 0, character: 21} active: {line: 0, character: 27} -fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: r}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: argumentOrParameter, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: decoratedSymbol, symbolColor: default, character: r}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: argumentOrParameter, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml index 16c929b204..8751af577a 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: | @@ -36,4 +36,4 @@ finalState: active: {line: 1, character: 32} - anchor: {line: 1, character: 34} active: {line: 1, character: 37} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml index ec4d2eafca..fe7fdd248f 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem2.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: | @@ -36,4 +36,4 @@ finalState: active: {line: 1, character: 22} - anchor: {line: 1, character: 24} active: {line: 1, character: 27} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml index fa297bb639..8386756f00 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem3.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: | @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 12} - anchor: {line: 1, character: 14} active: {line: 1, character: 15} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml index af7334675f..76d064bf01 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem4.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: | @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 11} - anchor: {line: 1, character: 13} active: {line: 1, character: 14} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml index 77273f2662..e46e3d5e8c 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryItem5.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false} initialState: documentContents: |- const value = { @@ -34,4 +34,4 @@ finalState: active: {line: 1, character: 17} - anchor: {line: 2, character: 4} active: {line: 2, character: 17} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionItem, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionItem, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml index 1434eae771..b107bf0bab 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: |- const value = { @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 8} - anchor: {line: 2, character: 4} active: {line: 2, character: 8} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey2.yml index ec3cca391e..637f849a5f 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryKey2.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true} + modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false} initialState: documentContents: |- { @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 7} - anchor: {line: 2, character: 4} active: {line: 2, character: 7} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: collectionKey, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: collectionKey, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml index 6bd5bac823..efecf5cca1 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: value, includeSiblings: true} + modifier: {type: everyScope, scopeType: value, contiguousRange: false} initialState: documentContents: |- const value = { @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 17} - anchor: {line: 2, character: 10} active: {line: 2, character: 17} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: containingScope, scopeType: value, includeSiblings: true}, insideOutsideType: inside}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, modifier: {type: everyScope, scopeType: value, contiguousRange: false}, insideOutsideType: inside}] diff --git a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue2.yml b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue2.yml index ebb2a4e51d..e5c51fefd3 100644 --- a/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue2.yml +++ b/src/test/suite/fixtures/recorded/languages/typescript/takeEveryValue2.yml @@ -5,7 +5,7 @@ command: action: setSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: value, includeSiblings: true} + modifier: {type: everyScope, scopeType: value, contiguousRange: false} initialState: documentContents: |- { @@ -32,4 +32,4 @@ finalState: active: {line: 1, character: 16} - anchor: {line: 2, character: 4} active: {line: 2, character: 7} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: value, includeSiblings: true}}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: value, contiguousRange: false}}] diff --git a/src/test/suite/fixtures/recorded/languages/xml/clearEveryAtHer.yml b/src/test/suite/fixtures/recorded/languages/xml/clearEveryAtHer.yml index dc9766b55d..78ce751e0f 100644 --- a/src/test/suite/fixtures/recorded/languages/xml/clearEveryAtHer.yml +++ b/src/test/suite/fixtures/recorded/languages/xml/clearEveryAtHer.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: attribute, includeSiblings: true} + modifier: {type: everyScope, scopeType: attribute, contiguousRange: false} initialState: documentContents: foo selections: @@ -24,4 +24,4 @@ finalState: active: {line: 0, character: 6} - anchor: {line: 0, character: 7} active: {line: 0, character: 7} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: attribute, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: attribute, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/xml/clearEveryEli.yml b/src/test/suite/fixtures/recorded/languages/xml/clearEveryEli.yml index 41c5c6e230..5ef764da30 100644 --- a/src/test/suite/fixtures/recorded/languages/xml/clearEveryEli.yml +++ b/src/test/suite/fixtures/recorded/languages/xml/clearEveryEli.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: xmlElement, includeSiblings: true} + modifier: {type: everyScope, scopeType: xmlElement, contiguousRange: false} initialState: documentContents: |- @@ -44,4 +44,4 @@ finalState: active: {line: 3, character: 4} - anchor: {line: 4, character: 4} active: {line: 4, character: 4} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: xmlElement, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: xmlElement, contiguousRange: false}, isImplicit: false}] diff --git a/src/test/suite/fixtures/recorded/languages/xml/clearEveryTags.yml b/src/test/suite/fixtures/recorded/languages/xml/clearEveryTags.yml index 8dabeae96b..518bddfe6d 100644 --- a/src/test/suite/fixtures/recorded/languages/xml/clearEveryTags.yml +++ b/src/test/suite/fixtures/recorded/languages/xml/clearEveryTags.yml @@ -5,7 +5,7 @@ command: action: clearAndSetSelection targets: - type: primitive - modifier: {type: containingScope, scopeType: xmlBothTags, includeSiblings: true} + modifier: {type: everyScope, scopeType: xmlBothTags, contiguousRange: false} initialState: documentContents: |- @@ -60,4 +60,4 @@ finalState: active: {line: 4, character: 4} - anchor: {line: 4, character: 33} active: {line: 4, character: 33} -fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: containingScope, scopeType: xmlBothTags, includeSiblings: true}, isImplicit: false}] +fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: everyScope, scopeType: xmlBothTags, contiguousRange: false}, isImplicit: false}] From f0728567d5cfd0aa90c5f11b631eaedb447b989a Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Thu, 14 Apr 2022 23:04:26 -0400 Subject: [PATCH 08/11] Fix formatting in .py file --- cursorless-talon/src/modifiers/containing_scope.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index 943e2b55ef..a9e678d529 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -45,10 +45,7 @@ "end tag": "xmlEndTag", } -select_multiple_modifiers = { - "every", - "all" -} +select_multiple_modifiers = {"every", "all"} @mod.capture(rule="[(every|all)] {user.cursorless_scope_type}") From 70e8a522e1f55d2e3af318a4b4a34bc08cd21104 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Thu, 14 Apr 2022 23:10:08 -0400 Subject: [PATCH 09/11] more python formatting --- cursorless-talon/src/modifiers/containing_scope.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index a9e678d529..4aed70a180 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -56,14 +56,14 @@ def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: "modifier": { "type": "everyScope", "scopeType": m.cursorless_scope_type, - "contiguousRange": m[0] == "all" + "contiguousRange": m[0] == "all", } } else: return { "modifier": { "type": "containingScope", - "scopeType": m.cursorless_scope_type + "scopeType": m.cursorless_scope_type, } } From 22b08a8afea2acf56fd8438e13775be0613efa13 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Mon, 18 Apr 2022 11:49:57 -0400 Subject: [PATCH 10/11] Fix formatting, finally get python black working --- cursorless-talon/src/modifiers/containing_scope.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index 4aed70a180..48eaf49ca3 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -67,6 +67,7 @@ def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: } } + # NOTE: Please do not change these dicts. Use the CSVs for customization. # See https://github.com/cursorless-dev/cursorless-vscode/blob/main/docs/user/customization.md selection_types = { From 9b319d9e5c17c6285f98fe6216d9c53e2aaafca4 Mon Sep 17 00:00:00 2001 From: Will Sommers Date: Mon, 18 Apr 2022 12:18:29 -0400 Subject: [PATCH 11/11] Use Talon list for multiple scope modifiers --- cursorless-talon/src/modifiers/containing_scope.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cursorless-talon/src/modifiers/containing_scope.py b/cursorless-talon/src/modifiers/containing_scope.py index 48eaf49ca3..cdccded314 100644 --- a/cursorless-talon/src/modifiers/containing_scope.py +++ b/cursorless-talon/src/modifiers/containing_scope.py @@ -1,9 +1,9 @@ from typing import Any -from talon import Module, app +from talon import Module, Context, app from ..csv_overrides import init_csv_and_watch_changes mod = Module() - +ctx = Context() mod.list("cursorless_scope_type", desc="Supported scope types") @@ -45,18 +45,20 @@ "end tag": "xmlEndTag", } -select_multiple_modifiers = {"every", "all"} +mod.list("select_multiple_modifiers", desc="modifiers for multiple selections") +multiple_modifiers = {"every", "all"} +ctx.lists["user.select_multiple_modifiers"] = multiple_modifiers -@mod.capture(rule="[(every|all)] {user.cursorless_scope_type}") +@mod.capture(rule="[{user.select_multiple_modifiers}] {user.cursorless_scope_type}") def cursorless_containing_scope(m) -> dict[str, dict[str, Any]]: """Expand to every scope""" - if m[0] in select_multiple_modifiers: + if m[0] in multiple_modifiers: return { "modifier": { "type": "everyScope", "scopeType": m.cursorless_scope_type, - "contiguousRange": m[0] == "all", + "contiguousRange": m[0] == "all" and m[1] == "collectionItem", } } else: