-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
```java int[] values = {1, 2, 3}; ``` This example is problematic. Currently we test the language specific implementation before the text based one. This means that if your cursor is inside the curly brackets `item` is `values = {1, 2, 3}`. I don't think this can be solved until we have a better `oneOf` implementation of collection item. Same problem with JS #2675 ## 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
1 parent
d98bf09
commit 301b2d8
Showing
6 changed files
with
301 additions
and
5 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
data/fixtures/scopes/java/collectionItem.unenclosed.iteration.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,33 @@ | ||
public class MyClass { | ||
String foo, bar; | ||
} | ||
--- | ||
|
||
[#1 Range] = 1:4-1:20 | ||
>----------------< | ||
1| String foo, bar; | ||
|
||
[#1 Domain] = 0:22-2:0 | ||
> | ||
0| public class MyClass { | ||
1| String foo, bar; | ||
2| } | ||
< | ||
|
||
|
||
[#2 Range] = 1:4-1:20 | ||
>----------------< | ||
1| String foo, bar; | ||
|
||
[#2 Domain] = 1:0-1:20 | ||
>--------------------< | ||
1| String foo, bar; | ||
|
||
|
||
[#3 Range] = 1:11-1:19 | ||
>--------< | ||
1| String foo, bar; | ||
|
||
[#3 Domain] = 1:4-1:20 | ||
>----------------< | ||
1| String foo, bar; |
58 changes: 58 additions & 0 deletions
58
data/fixtures/scopes/java/collectionItem.unenclosed.iteration2.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,58 @@ | ||
public class MyClass { | ||
public void myFunk() { | ||
String foo, bar; | ||
} | ||
} | ||
--- | ||
|
||
[#1 Range] = 1:4-3:5 | ||
>---------------------- | ||
1| public void myFunk() { | ||
2| String foo, bar; | ||
3| } | ||
-----< | ||
|
||
[#1 Domain] = 0:22-4:0 | ||
> | ||
0| public class MyClass { | ||
1| public void myFunk() { | ||
2| String foo, bar; | ||
3| } | ||
4| } | ||
< | ||
|
||
|
||
[#2 Range] = | ||
[#2 Domain] = 1:23-1:23 | ||
>< | ||
1| public void myFunk() { | ||
|
||
|
||
[#3 Range] = 2:8-2:24 | ||
>----------------< | ||
2| String foo, bar; | ||
|
||
[#3 Domain] = 1:26-3:4 | ||
> | ||
1| public void myFunk() { | ||
2| String foo, bar; | ||
3| } | ||
----< | ||
|
||
|
||
[#4 Range] = 2:8-2:24 | ||
>----------------< | ||
2| String foo, bar; | ||
|
||
[#4 Domain] = 2:0-2:24 | ||
>------------------------< | ||
2| String foo, bar; | ||
|
||
|
||
[#5 Range] = 2:15-2:23 | ||
>--------< | ||
2| String foo, bar; | ||
|
||
[#5 Domain] = 2:8-2:24 | ||
>----------------< | ||
2| String foo, bar; |
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,67 @@ | ||
public class MyClass { | ||
String foo, bar; | ||
} | ||
--- | ||
|
||
[#1 Content] = | ||
[#1 Domain] = 1:4-1:14 | ||
>----------< | ||
1| String foo, bar; | ||
|
||
[#1 Removal] = 1:4-1:16 | ||
>------------< | ||
1| String foo, bar; | ||
|
||
[#1 Trailing delimiter] = 1:14-1:16 | ||
>--< | ||
1| String foo, bar; | ||
|
||
[#1 Insertion delimiter] = ",\n" | ||
|
||
|
||
[#2 Content] = | ||
[#2 Domain] = 1:11-1:14 | ||
>---< | ||
1| String foo, bar; | ||
|
||
[#2 Removal] = 1:11-1:16 | ||
>-----< | ||
1| String foo, bar; | ||
|
||
[#2 Trailing delimiter] = 1:14-1:16 | ||
>--< | ||
1| String foo, bar; | ||
|
||
[#2 Insertion delimiter] = ", " | ||
|
||
|
||
[#3 Content] = | ||
[#3 Domain] = 1:16-1:19 | ||
>---< | ||
1| String foo, bar; | ||
|
||
[#3 Removal] = 1:14-1:19 | ||
>-----< | ||
1| String foo, bar; | ||
|
||
[#3 Leading delimiter] = 1:14-1:16 | ||
>--< | ||
1| String foo, bar; | ||
|
||
[#3 Insertion delimiter] = ", " | ||
|
||
|
||
[#4 Content] = | ||
[#4 Domain] = 1:16-1:20 | ||
>----< | ||
1| String foo, bar; | ||
|
||
[#4 Removal] = 1:14-1:20 | ||
>------< | ||
1| String foo, bar; | ||
|
||
[#4 Leading delimiter] = 1:14-1:16 | ||
>--< | ||
1| String foo, bar; | ||
|
||
[#4 Insertion delimiter] = ",\n" |
91 changes: 91 additions & 0 deletions
91
data/fixtures/scopes/java/collectionItem.unenclosed2.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,91 @@ | ||
public class MyClass { | ||
public void myFunk() { | ||
String foo, bar; | ||
} | ||
} | ||
--- | ||
|
||
[#1 Content] = | ||
[#1 Domain] = 1:4-3:5 | ||
>---------------------- | ||
1| public void myFunk() { | ||
2| String foo, bar; | ||
3| } | ||
-----< | ||
|
||
[#1 Removal] = 1:0-3:5 | ||
>-------------------------- | ||
1| public void myFunk() { | ||
2| String foo, bar; | ||
3| } | ||
-----< | ||
|
||
[#1 Leading delimiter] = 1:0-1:4 | ||
>----< | ||
1| public void myFunk() { | ||
|
||
[#1 Insertion delimiter] = ",\n" | ||
|
||
|
||
[#2 Content] = | ||
[#2 Domain] = 2:8-2:18 | ||
>----------< | ||
2| String foo, bar; | ||
|
||
[#2 Removal] = 2:8-2:20 | ||
>------------< | ||
2| String foo, bar; | ||
|
||
[#2 Trailing delimiter] = 2:18-2:20 | ||
>--< | ||
2| String foo, bar; | ||
|
||
[#2 Insertion delimiter] = ",\n" | ||
|
||
|
||
[#3 Content] = | ||
[#3 Domain] = 2:15-2:18 | ||
>---< | ||
2| String foo, bar; | ||
|
||
[#3 Removal] = 2:15-2:20 | ||
>-----< | ||
2| String foo, bar; | ||
|
||
[#3 Trailing delimiter] = 2:18-2:20 | ||
>--< | ||
2| String foo, bar; | ||
|
||
[#3 Insertion delimiter] = ", " | ||
|
||
|
||
[#4 Content] = | ||
[#4 Domain] = 2:20-2:23 | ||
>---< | ||
2| String foo, bar; | ||
|
||
[#4 Removal] = 2:18-2:23 | ||
>-----< | ||
2| String foo, bar; | ||
|
||
[#4 Leading delimiter] = 2:18-2:20 | ||
>--< | ||
2| String foo, bar; | ||
|
||
[#4 Insertion delimiter] = ", " | ||
|
||
|
||
[#5 Content] = | ||
[#5 Domain] = 2:20-2:24 | ||
>----< | ||
2| String foo, bar; | ||
|
||
[#5 Removal] = 2:18-2:24 | ||
>------< | ||
2| String foo, bar; | ||
|
||
[#5 Leading delimiter] = 2:18-2:20 | ||
>--< | ||
2| String foo, bar; | ||
|
||
[#5 Insertion delimiter] = ",\n" |
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