-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support jsx tag scopes using tree-sitter queries (#1508)
- Fixes #1478 - Depends on #1507 ## Checklist - [x] Support "every name" while we're here - [x] Arg lists - [x] Functions in class - [x] Assignment statements in function body - [x] Assignment statements at top level - [x] Properties in class - [x] Members of interface - [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 --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f759734
commit 65fab51
Showing
25 changed files
with
644 additions
and
76 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
32 changes: 32 additions & 0 deletions
32
...sorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryElement.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,32 @@ | ||
languageId: typescriptreact | ||
command: | ||
version: 5 | ||
spokenForm: clear every element | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: xmlElement} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<aaa> | ||
<bbb>ccc</bbb> | ||
<bbb>ddd</bbb> | ||
</aaa> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<aaa> | ||
</aaa> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
- anchor: {line: 2, character: 4} | ||
active: {line: 2, character: 4} |
32 changes: 32 additions & 0 deletions
32
...orless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryElement2.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,32 @@ | ||
languageId: typescriptreact | ||
command: | ||
version: 5 | ||
spokenForm: clear every element | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: xmlElement} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<> | ||
<bbb>ccc</bbb> | ||
<bbb>ddd</bbb> | ||
</> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<> | ||
</> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
- anchor: {line: 2, character: 4} | ||
active: {line: 2, character: 4} |
32 changes: 32 additions & 0 deletions
32
...orless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryElement3.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,32 @@ | ||
languageId: typescriptreact | ||
command: | ||
version: 5 | ||
spokenForm: clear every element | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: xmlElement} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<> | ||
<>ccc</> | ||
<>ddd</> | ||
</> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<> | ||
</> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
- anchor: {line: 2, character: 4} | ||
active: {line: 2, character: 4} |
32 changes: 32 additions & 0 deletions
32
...orless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryElement4.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,32 @@ | ||
languageId: typescriptreact | ||
command: | ||
version: 5 | ||
spokenForm: clear every element | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: xmlElement} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<aaa> | ||
<>ccc</> | ||
<>ddd</> | ||
</aaa> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<aaa> | ||
</aaa> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
- anchor: {line: 2, character: 4} | ||
active: {line: 2, character: 4} |
32 changes: 32 additions & 0 deletions
32
...rsorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryEndTag.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,32 @@ | ||
languageId: typescriptreact | ||
command: | ||
version: 5 | ||
spokenForm: clear every end tag | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: xmlEndTag} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<> | ||
<>ccc</> | ||
<>ddd</> | ||
</> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<> | ||
<>ccc | ||
<>ddd | ||
</> | ||
selections: | ||
- anchor: {line: 1, character: 9} | ||
active: {line: 1, character: 9} | ||
- anchor: {line: 2, character: 9} | ||
active: {line: 2, character: 9} |
32 changes: 32 additions & 0 deletions
32
...sorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryEndTag2.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,32 @@ | ||
languageId: typescriptreact | ||
command: | ||
version: 5 | ||
spokenForm: clear every end tag | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: xmlEndTag} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<aaa> | ||
<bbb>ccc</bbb> | ||
<bbb>ddd</bbb> | ||
</aaa> | ||
selections: | ||
- anchor: {line: 1, character: 4} | ||
active: {line: 1, character: 4} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<aaa> | ||
<bbb>ccc | ||
<bbb>ddd | ||
</aaa> | ||
selections: | ||
- anchor: {line: 1, character: 12} | ||
active: {line: 1, character: 12} | ||
- anchor: {line: 2, character: 12} | ||
active: {line: 2, character: 12} |
28 changes: 28 additions & 0 deletions
28
...cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryName.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,28 @@ | ||
languageId: typescript | ||
command: | ||
version: 5 | ||
spokenForm: clear every name | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
const aaa = "bbb"; | ||
const ccc = "ddd"; | ||
selections: | ||
- anchor: {line: 1, character: 18} | ||
active: {line: 1, character: 18} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
const = "bbb"; | ||
const = "ddd"; | ||
selections: | ||
- anchor: {line: 0, character: 6} | ||
active: {line: 0, character: 6} | ||
- anchor: {line: 1, character: 6} | ||
active: {line: 1, character: 6} |
32 changes: 32 additions & 0 deletions
32
...ursorless-vscode-e2e/src/suite/fixtures/recorded/languages/typescript/clearEveryName2.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,32 @@ | ||
languageId: typescript | ||
command: | ||
version: 5 | ||
spokenForm: clear every name | ||
action: {name: clearAndSetSelection} | ||
targets: | ||
- type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: name} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
function eee() { | ||
const aaa = "bbb"; | ||
const ccc = "ddd"; | ||
} | ||
selections: | ||
- anchor: {line: 2, character: 22} | ||
active: {line: 2, character: 22} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
function eee() { | ||
const = "bbb"; | ||
const = "ddd"; | ||
} | ||
selections: | ||
- anchor: {line: 1, character: 10} | ||
active: {line: 1, character: 10} | ||
- anchor: {line: 2, character: 10} | ||
active: {line: 2, character: 10} |
Oops, something went wrong.