diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeValue5.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeValue5.yml new file mode 100644 index 0000000000..af3aa84b32 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeValue5.yml @@ -0,0 +1,25 @@ +languageId: typescript +command: + version: 6 + spokenForm: change value + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: value} + usePrePhraseSnapshot: true +initialState: + documentContents: | + const { aaa: bbb } = ccc; + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} + marks: {} +finalState: + documentContents: | + const { aaa: } = ccc; + selections: + - anchor: {line: 0, character: 13} + active: {line: 0, character: 13} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/chuckKey2.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/chuckKey2.yml new file mode 100644 index 0000000000..bcecb8a3d7 --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/chuckKey2.yml @@ -0,0 +1,23 @@ +languageId: typescript +command: + version: 6 + spokenForm: chuck key + action: + name: remove + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: collectionKey} + usePrePhraseSnapshot: true +initialState: + documentContents: "const { aaa: bbb } = ccc;" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: const { bbb } = ccc; + selections: + - anchor: {line: 0, character: 8} + active: {line: 0, character: 8} diff --git a/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/chuckValue4.yml b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/chuckValue4.yml new file mode 100644 index 0000000000..896866b9ea --- /dev/null +++ b/packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/chuckValue4.yml @@ -0,0 +1,23 @@ +languageId: typescript +command: + version: 6 + spokenForm: chuck value + action: + name: remove + target: + type: primitive + modifiers: + - type: containingScope + scopeType: {type: value} + usePrePhraseSnapshot: true +initialState: + documentContents: "const { aaa: bbb } = ccc;" + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} + marks: {} +finalState: + documentContents: const { aaa } = ccc; + selections: + - anchor: {line: 0, character: 9} + active: {line: 0, character: 9} diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 635aa59c28..a09bf98818 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -416,6 +416,14 @@ "}" @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) +;;!! const { aaa: bbb } = ccc; +;;! ^^^ +;;! -------- +(pair_pattern + key: (_) @collectionKey @collectionKey.trailing.start.endOf @value.leading.start.endOf + value: (_) @value @collectionKey.trailing.end.startOf @value.leading.end.startOf +) @_.domain + ;;!! "string" ;;!! `string` ;;! ^^^^^^^^