-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Cursorless support for tree-sitter query
.scm
files (#1448)
This PR allows us to say things like `"take state"` when we're working on `.scm` files. - Depends on #1763 - Depends on #1800 ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] Add trailing delimiter to "key" - [x] File issue for "bring to name" when there are multiple names - [ ] 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
58 changed files
with
1,611 additions
and
26 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
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
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
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
36 changes: 36 additions & 0 deletions
36
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/bringNameToAir.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,36 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: bring name to air | ||
action: | ||
name: replaceWithTarget | ||
source: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: name} | ||
destination: | ||
type: primitive | ||
insertionMode: to | ||
target: | ||
type: primitive | ||
mark: {type: decoratedSymbol, symbolColor: default, character: a} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
(aaa) @bbb @ccc @ddd | ||
(eee) @fff | ||
selections: | ||
- anchor: {line: 1, character: 0} | ||
active: {line: 1, character: 0} | ||
marks: | ||
default.a: | ||
start: {line: 0, character: 1} | ||
end: {line: 0, character: 4} | ||
finalState: | ||
documentContents: |- | ||
(aaa) @fff | ||
(eee) @fff | ||
selections: | ||
- anchor: {line: 1, character: 0} | ||
active: {line: 1, character: 0} |
27 changes: 27 additions & 0 deletions
27
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/changeEveryName.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,27 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: change every name | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: (aaa) @bbb @ccc @ddd | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: (aaa) @ @ @ | ||
selections: | ||
- anchor: {line: 0, character: 7} | ||
active: {line: 0, character: 7} | ||
- anchor: {line: 0, character: 9} | ||
active: {line: 0, character: 9} | ||
- anchor: {line: 0, character: 11} | ||
active: {line: 0, character: 11} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/changeName.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,23 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: change name | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: (aaa) @bbb @ccc @ddd | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: (aaa) @ | ||
selections: | ||
- anchor: {line: 0, character: 7} | ||
active: {line: 0, character: 7} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/changeName2.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,23 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: change name | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "eee: (aaa) @bbb @ccc @ddd" | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: "eee: (aaa) @" | ||
selections: | ||
- anchor: {line: 0, character: 12} | ||
active: {line: 0, character: 12} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/changeName3.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,23 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: change name | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: "eee: _ @bbb @ccc @ddd" | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: "eee: _ @" | ||
selections: | ||
- anchor: {line: 0, character: 8} | ||
active: {line: 0, character: 8} |
59 changes: 59 additions & 0 deletions
59
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/changeValue.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,59 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: change value | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: value} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
( | ||
aaa: (bbb) @ccc @ddd | ||
eee: "fff" @ggg | ||
hhh: (iii) | ||
jjj: [(kkk)] @lll | ||
mmm: ((nnn) (ooo))* @ppp | ||
qqq: _ @rrr | ||
) | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
- anchor: {line: 2, character: 4} | ||
active: {line: 2, character: 4} | ||
- anchor: {line: 3, character: 4} | ||
active: {line: 3, character: 4} | ||
- anchor: {line: 4, character: 4} | ||
active: {line: 4, character: 4} | ||
- anchor: {line: 5, character: 4} | ||
active: {line: 5, character: 4} | ||
- anchor: {line: 6, character: 4} | ||
active: {line: 6, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
( | ||
aaa: @ccc @ddd | ||
eee: @ggg | ||
hhh: | ||
jjj: @lll | ||
mmm: @ppp | ||
qqq: @rrr | ||
) | ||
selections: | ||
- anchor: {line: 1, character: 9} | ||
active: {line: 1, character: 9} | ||
- anchor: {line: 2, character: 9} | ||
active: {line: 2, character: 9} | ||
- anchor: {line: 3, character: 9} | ||
active: {line: 3, character: 9} | ||
- anchor: {line: 4, character: 9} | ||
active: {line: 4, character: 9} | ||
- anchor: {line: 5, character: 9} | ||
active: {line: 5, character: 9} | ||
- anchor: {line: 6, character: 9} | ||
active: {line: 6, character: 9} |
29 changes: 29 additions & 0 deletions
29
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/chuckKey.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: scm | ||
command: | ||
version: 6 | ||
spokenForm: chuck key | ||
action: | ||
name: remove | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: collectionKey} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
( | ||
aaa: (bbb) @ccc | ||
) | ||
selections: | ||
- anchor: {line: 1, character: 19} | ||
active: {line: 1, character: 19} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
( | ||
(bbb) @ccc | ||
) | ||
selections: | ||
- anchor: {line: 1, character: 14} | ||
active: {line: 1, character: 14} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/chuckName.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,23 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: chuck name | ||
action: | ||
name: remove | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: (aaa) @bbb @ccc @ddd | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: "(aaa) " | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} |
23 changes: 23 additions & 0 deletions
23
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/scm/chuckName2.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,23 @@ | ||
languageId: scm | ||
command: | ||
version: 6 | ||
spokenForm: chuck name | ||
action: | ||
name: remove | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: (aaa) @bbb @ccc @ddd | ||
selections: | ||
- anchor: {line: 0, character: 20} | ||
active: {line: 0, character: 20} | ||
marks: {} | ||
finalState: | ||
documentContents: "(aaa) @bbb @ccc " | ||
selections: | ||
- anchor: {line: 0, character: 16} | ||
active: {line: 0, character: 16} |
Oops, something went wrong.