-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add name.variable and value.variable (#2219)
I think it's worth distinguishing between an assignment (`foo = bar`) and a variable declarateion (`const foo = bar`) to make it clear we want to support both. I think the name `name.variable` and `value.variable` are clear enough and consistent with `name.function` ## 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
12 changed files
with
132 additions
and
53 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
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
30 changes: 13 additions & 17 deletions
30
.../cursorless-vscode-e2e/src/suite/fixtures/scopes/javascript/name.assignment.pattern.scope
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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
const { aaa: bbb } = ccc; | ||
{ aaa: bbb } = ccc; | ||
--- | ||
|
||
[Content] = 0:6-0:18 | ||
0| const { aaa: bbb } = ccc; | ||
>------------< | ||
[Content] = 0:0-0:12 | ||
0| { aaa: bbb } = ccc; | ||
>------------< | ||
|
||
[Removal] = 0:0-0:21 | ||
0| const { aaa: bbb } = ccc; | ||
>---------------------< | ||
[Removal] = 0:0-0:15 | ||
0| { aaa: bbb } = ccc; | ||
>---------------< | ||
|
||
[Leading delimiter] = 0:5-0:6 | ||
0| const { aaa: bbb } = ccc; | ||
>-< | ||
[Trailing delimiter] = 0:12-0:15 | ||
0| { aaa: bbb } = ccc; | ||
>---< | ||
|
||
[Trailing delimiter] = 0:18-0:19 | ||
0| const { aaa: bbb } = ccc; | ||
>-< | ||
|
||
[Domain] = 0:0-0:25 | ||
0| const { aaa: bbb } = ccc; | ||
>-------------------------< | ||
[Domain] = 0:0-0:19 | ||
0| { aaa: bbb } = ccc; | ||
>-------------------< | ||
|
||
[Insertion delimiter] = " " |
30 changes: 13 additions & 17 deletions
30
packages/cursorless-vscode-e2e/src/suite/fixtures/scopes/javascript/name.assignment.scope
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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
const name = "Hello world"; | ||
aaa = bbb; | ||
--- | ||
|
||
[Content] = 0:6-0:10 | ||
0| const name = "Hello world"; | ||
>----< | ||
[Content] = 0:0-0:3 | ||
0| aaa = bbb; | ||
>---< | ||
|
||
[Removal] = 0:0-0:13 | ||
0| const name = "Hello world"; | ||
>-------------< | ||
[Removal] = 0:0-0:6 | ||
0| aaa = bbb; | ||
>------< | ||
|
||
[Leading delimiter] = 0:5-0:6 | ||
0| const name = "Hello world"; | ||
>-< | ||
[Trailing delimiter] = 0:3-0:6 | ||
0| aaa = bbb; | ||
>---< | ||
|
||
[Trailing delimiter] = 0:10-0:11 | ||
0| const name = "Hello world"; | ||
>-< | ||
|
||
[Domain] = 0:0-0:27 | ||
0| const name = "Hello world"; | ||
>---------------------------< | ||
[Domain] = 0:0-0:10 | ||
0| aaa = bbb; | ||
>----------< | ||
|
||
[Insertion delimiter] = " " |
24 changes: 24 additions & 0 deletions
24
...es/cursorless-vscode-e2e/src/suite/fixtures/scopes/javascript/name.variable.pattern.scope
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,24 @@ | ||
const {aaa: bbb} = ccc; | ||
--- | ||
|
||
[Content] = 0:6-0:16 | ||
0| const {aaa: bbb} = ccc; | ||
>----------< | ||
|
||
[Removal] = 0:0-0:19 | ||
0| const {aaa: bbb} = ccc; | ||
>-------------------< | ||
|
||
[Leading delimiter] = 0:5-0:6 | ||
0| const {aaa: bbb} = ccc; | ||
>-< | ||
|
||
[Trailing delimiter] = 0:16-0:17 | ||
0| const {aaa: bbb} = ccc; | ||
>-< | ||
|
||
[Domain] = 0:0-0:23 | ||
0| const {aaa: bbb} = ccc; | ||
>-----------------------< | ||
|
||
[Insertion delimiter] = " " |
24 changes: 24 additions & 0 deletions
24
packages/cursorless-vscode-e2e/src/suite/fixtures/scopes/javascript/name.variable.scope
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,24 @@ | ||
const name = "Hello world"; | ||
--- | ||
|
||
[Content] = 0:6-0:10 | ||
0| const name = "Hello world"; | ||
>----< | ||
|
||
[Removal] = 0:0-0:13 | ||
0| const name = "Hello world"; | ||
>-------------< | ||
|
||
[Leading delimiter] = 0:5-0:6 | ||
0| const name = "Hello world"; | ||
>-< | ||
|
||
[Trailing delimiter] = 0:10-0:11 | ||
0| const name = "Hello world"; | ||
>-< | ||
|
||
[Domain] = 0:0-0:27 | ||
0| const name = "Hello world"; | ||
>---------------------------< | ||
|
||
[Insertion delimiter] = " " |
26 changes: 13 additions & 13 deletions
26
packages/cursorless-vscode-e2e/src/suite/fixtures/scopes/javascript/value.assignment.scope
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
const name = "Hello world"; | ||
aaa = bbb; | ||
--- | ||
|
||
[Content] = 0:13-0:26 | ||
0| const name = "Hello world"; | ||
>-------------< | ||
[Content] = 0:6-0:9 | ||
0| aaa = bbb; | ||
>---< | ||
|
||
[Removal] = 0:10-0:26 | ||
0| const name = "Hello world"; | ||
>----------------< | ||
[Removal] = 0:3-0:9 | ||
0| aaa = bbb; | ||
>------< | ||
|
||
[Leading delimiter] = 0:10-0:13 | ||
0| const name = "Hello world"; | ||
>---< | ||
[Leading delimiter] = 0:3-0:6 | ||
0| aaa = bbb; | ||
>---< | ||
|
||
[Domain] = 0:0-0:27 | ||
0| const name = "Hello world"; | ||
>---------------------------< | ||
[Domain] = 0:0-0:10 | ||
0| aaa = bbb; | ||
>----------< | ||
|
||
[Insertion delimiter] = " " |
20 changes: 20 additions & 0 deletions
20
packages/cursorless-vscode-e2e/src/suite/fixtures/scopes/javascript/value.variable.scope
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,20 @@ | ||
const name = "Hello world"; | ||
--- | ||
|
||
[Content] = 0:13-0:26 | ||
0| const name = "Hello world"; | ||
>-------------< | ||
|
||
[Removal] = 0:10-0:26 | ||
0| const name = "Hello world"; | ||
>----------------< | ||
|
||
[Leading delimiter] = 0:10-0:13 | ||
0| const name = "Hello world"; | ||
>---< | ||
|
||
[Domain] = 0:0-0:27 | ||
0| const name = "Hello world"; | ||
>---------------------------< | ||
|
||
[Insertion delimiter] = " " |
File renamed without changes.