forked from cursorless-dev/cursorless
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Typescript "type" to next-gen; fix value removal (cursorless-…
…dev#1925) Note that the first commit moves `typescript.scm` to `typescript.core.scm`, because we now have some patterns that shouldn't be defined for TSX (cast assertions eg `<foo>bar`). I made it its own commit because otherwise the diff is confusing. Might be easier to review https://github.com/cursorless-dev/cursorless/pull/1925/files/dbb4e5ea4135dad6bcff272f6bc85752a650013e..a2ced3b3ad14a27b4d47d344ddacfebba65c0915, which excludes that commit ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet
- Loading branch information
Showing
17 changed files
with
966 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeEveryType.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
languageId: typescript | ||
command: | ||
version: 6 | ||
spokenForm: change every type | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: type} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
const aaa: number = 0; | ||
const bbb: number = 0; | ||
selections: | ||
- anchor: {line: 1, character: 22} | ||
active: {line: 1, character: 22} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
const aaa: = 0; | ||
const bbb: = 0; | ||
selections: | ||
- anchor: {line: 0, character: 11} | ||
active: {line: 0, character: 11} | ||
- anchor: {line: 1, character: 11} | ||
active: {line: 1, character: 11} |
33 changes: 33 additions & 0 deletions
33
...rsorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeEveryType2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
languageId: typescript | ||
command: | ||
version: 6 | ||
spokenForm: change every type | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: type} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
function ccc() { | ||
const aaa: number = 0; | ||
const bbb: number = 0; | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 26} | ||
active: {line: 2, character: 26} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
function ccc() { | ||
const aaa: = 0; | ||
const bbb: = 0; | ||
} | ||
selections: | ||
- anchor: {line: 1, character: 15} | ||
active: {line: 1, character: 15} | ||
- anchor: {line: 2, character: 15} | ||
active: {line: 2, character: 15} |
25 changes: 25 additions & 0 deletions
25
...rsorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeEveryType3.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
languageId: typescript | ||
command: | ||
version: 6 | ||
spokenForm: change every type | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: type} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "function ccc(aaa: string, bbb: string) {}" | ||
selections: | ||
- anchor: {line: 0, character: 13} | ||
active: {line: 0, character: 13} | ||
marks: {} | ||
finalState: | ||
documentContents: "function ccc(aaa: , bbb: ) {}" | ||
selections: | ||
- anchor: {line: 0, character: 18} | ||
active: {line: 0, character: 18} | ||
- anchor: {line: 0, character: 25} | ||
active: {line: 0, character: 25} |
113 changes: 113 additions & 0 deletions
113
...es/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeType7.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
languageId: typescript | ||
command: | ||
version: 6 | ||
spokenForm: change type | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: type} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
const aaa: number = 0; | ||
let bbb: number = 0; | ||
var hhh: number = 0; | ||
const ddd: number = 0, eee: number = 0; | ||
let fff: number = 0, ggg: number = 0; | ||
var iii: number = 0; | ||
export const jjj: number = 0; | ||
export let kkk: number = 0; | ||
export var lll: number = 0; | ||
export const mmm: number = 0, nnn: number = 0; | ||
export let ooo: number = 0, ppp: number = 0; | ||
let qqq: number; | ||
var rrr: number; | ||
let sss: number, ttt: number; | ||
selections: | ||
- anchor: {line: 0, character: 22} | ||
active: {line: 0, character: 22} | ||
- anchor: {line: 1, character: 20} | ||
active: {line: 1, character: 20} | ||
- anchor: {line: 2, character: 20} | ||
active: {line: 2, character: 20} | ||
- anchor: {line: 3, character: 39} | ||
active: {line: 3, character: 39} | ||
- anchor: {line: 4, character: 37} | ||
active: {line: 4, character: 37} | ||
- anchor: {line: 5, character: 20} | ||
active: {line: 5, character: 20} | ||
- anchor: {line: 6, character: 29} | ||
active: {line: 6, character: 29} | ||
- anchor: {line: 7, character: 27} | ||
active: {line: 7, character: 27} | ||
- anchor: {line: 8, character: 27} | ||
active: {line: 8, character: 27} | ||
- anchor: {line: 9, character: 46} | ||
active: {line: 9, character: 46} | ||
- anchor: {line: 10, character: 44} | ||
active: {line: 10, character: 44} | ||
- anchor: {line: 11, character: 16} | ||
active: {line: 11, character: 16} | ||
- anchor: {line: 12, character: 16} | ||
active: {line: 12, character: 16} | ||
- anchor: {line: 13, character: 29} | ||
active: {line: 13, character: 29} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
const aaa: = 0; | ||
let bbb: = 0; | ||
var hhh: = 0; | ||
const ddd: = 0, eee: = 0; | ||
let fff: = 0, ggg: = 0; | ||
var iii: = 0; | ||
export const jjj: = 0; | ||
export let kkk: = 0; | ||
export var lll: = 0; | ||
export const mmm: = 0, nnn: = 0; | ||
export let ooo: = 0, ppp: = 0; | ||
let qqq: ; | ||
var rrr: ; | ||
let sss: , ttt: ; | ||
selections: | ||
- anchor: {line: 0, character: 11} | ||
active: {line: 0, character: 11} | ||
- anchor: {line: 1, character: 9} | ||
active: {line: 1, character: 9} | ||
- anchor: {line: 2, character: 9} | ||
active: {line: 2, character: 9} | ||
- anchor: {line: 3, character: 11} | ||
active: {line: 3, character: 11} | ||
- anchor: {line: 3, character: 22} | ||
active: {line: 3, character: 22} | ||
- anchor: {line: 4, character: 9} | ||
active: {line: 4, character: 9} | ||
- anchor: {line: 4, character: 20} | ||
active: {line: 4, character: 20} | ||
- anchor: {line: 5, character: 9} | ||
active: {line: 5, character: 9} | ||
- anchor: {line: 6, character: 18} | ||
active: {line: 6, character: 18} | ||
- anchor: {line: 7, character: 16} | ||
active: {line: 7, character: 16} | ||
- anchor: {line: 8, character: 16} | ||
active: {line: 8, character: 16} | ||
- anchor: {line: 9, character: 18} | ||
active: {line: 9, character: 18} | ||
- anchor: {line: 9, character: 29} | ||
active: {line: 9, character: 29} | ||
- anchor: {line: 10, character: 16} | ||
active: {line: 10, character: 16} | ||
- anchor: {line: 10, character: 27} | ||
active: {line: 10, character: 27} | ||
- anchor: {line: 11, character: 9} | ||
active: {line: 11, character: 9} | ||
- anchor: {line: 12, character: 9} | ||
active: {line: 12, character: 9} | ||
- anchor: {line: 13, character: 9} | ||
active: {line: 13, character: 9} | ||
- anchor: {line: 13, character: 16} | ||
active: {line: 13, character: 16} |
43 changes: 43 additions & 0 deletions
43
...es/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/changeType8.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
languageId: typescript | ||
command: | ||
version: 6 | ||
spokenForm: change type | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: type} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
const ddd: number = 0, eee: number = 0; | ||
let fff: number = 0, ggg: number = 0; | ||
export const mmm: number = 0, nnn: number = 0; | ||
export let ooo: number = 0, ppp: number = 0; | ||
selections: | ||
- anchor: {line: 0, character: 38} | ||
active: {line: 0, character: 38} | ||
- anchor: {line: 1, character: 36} | ||
active: {line: 1, character: 36} | ||
- anchor: {line: 2, character: 45} | ||
active: {line: 2, character: 45} | ||
- anchor: {line: 3, character: 43} | ||
active: {line: 3, character: 43} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
const ddd: number = 0, eee: = 0; | ||
let fff: number = 0, ggg: = 0; | ||
export const mmm: number = 0, nnn: = 0; | ||
export let ooo: number = 0, ppp: = 0; | ||
selections: | ||
- anchor: {line: 0, character: 28} | ||
active: {line: 0, character: 28} | ||
- anchor: {line: 1, character: 26} | ||
active: {line: 1, character: 26} | ||
- anchor: {line: 2, character: 35} | ||
active: {line: 2, character: 35} | ||
- anchor: {line: 3, character: 33} | ||
active: {line: 3, character: 33} |
Oops, something went wrong.