diff --git a/data/fixtures/scopes/c/collectionItem.unenclosed.multiLine.scope b/data/fixtures/scopes/c/collectionItem.unenclosed.multiLine.scope new file mode 100644 index 0000000000..2775afbc82 --- /dev/null +++ b/data/fixtures/scopes/c/collectionItem.unenclosed.multiLine.scope @@ -0,0 +1,58 @@ +int foo, + bar; +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| int foo, + +[#1 Removal] = 0:0-0:8 + >--------< +0| int foo, + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| int foo, + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:4-0:7 + >---< +0| int foo, + +[#2 Removal] = 0:4-1:4 + >---- +0| int foo, +1| bar; + ----< + +[#2 Trailing delimiter] = 0:7-1:4 + >- +0| int foo, +1| bar; + ----< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 1:4-1:7 + >---< +1| bar; + +[#3 Removal] = 0:7-1:7 + >- +0| int foo, +1| bar; + -------< + +[#3 Leading delimiter] = 0:7-1:4 + >- +0| int foo, +1| bar; + ----< + +[#3 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/c/collectionItem.unenclosed.scope b/data/fixtures/scopes/c/collectionItem.unenclosed.singleLine.scope similarity index 74% rename from data/fixtures/scopes/c/collectionItem.unenclosed.scope rename to data/fixtures/scopes/c/collectionItem.unenclosed.singleLine.scope index c66d14c45e..5e9a7a4ae6 100644 --- a/data/fixtures/scopes/c/collectionItem.unenclosed.scope +++ b/data/fixtures/scopes/c/collectionItem.unenclosed.singleLine.scope @@ -22,15 +22,15 @@ int foo, bar; >---< 0| int foo, bar; -[#2 Removal] = 0:3-0:7 - >----< +[#2 Removal] = 0:4-0:9 + >-----< 0| int foo, bar; -[#2 Leading delimiter] = 0:3-0:4 - >-< +[#2 Trailing delimiter] = 0:7-0:9 + >--< 0| int foo, bar; -[#2 Insertion delimiter] = "\n" +[#2 Insertion delimiter] = ", " [#3 Content] = @@ -38,15 +38,15 @@ int foo, bar; >---< 0| int foo, bar; -[#3 Removal] = 0:8-0:12 - >----< +[#3 Removal] = 0:7-0:12 + >-----< 0| int foo, bar; -[#3 Leading delimiter] = 0:8-0:9 - >-< +[#3 Leading delimiter] = 0:7-0:9 + >--< 0| int foo, bar; -[#3 Insertion delimiter] = "\n" +[#3 Insertion delimiter] = ", " [#4 Content] = diff --git a/data/fixtures/scopes/csharp/collectionItem.unenclosed.iteration.scope b/data/fixtures/scopes/csharp/collectionItem.unenclosed.iteration.scope new file mode 100644 index 0000000000..645b2a1175 --- /dev/null +++ b/data/fixtures/scopes/csharp/collectionItem.unenclosed.iteration.scope @@ -0,0 +1,10 @@ +int foo, bar; +--- + +[Content] = 0:4-0:12 + >--------< +0| int foo, bar; + +[Domain] = 0:0-0:13 + >-------------< +0| int foo, bar; diff --git a/data/fixtures/scopes/csharp/collectionItem.unenclosed.iteration2.scope b/data/fixtures/scopes/csharp/collectionItem.unenclosed.iteration2.scope new file mode 100644 index 0000000000..531c2a9864 --- /dev/null +++ b/data/fixtures/scopes/csharp/collectionItem.unenclosed.iteration2.scope @@ -0,0 +1,33 @@ +class Foo { + private int bar, baz; +} +--- + +[#1 Content] = 1:4-1:25 + >---------------------< +1| private int bar, baz; + +[#1 Domain] = 0:11-2:0 + > +0| class Foo { +1| private int bar, baz; +2| } + < + + +[#2 Content] = 1:4-1:25 + >---------------------< +1| private int bar, baz; + +[#2 Domain] = 1:0-1:25 + >-------------------------< +1| private int bar, baz; + + +[#3 Content] = 1:16-1:24 + >--------< +1| private int bar, baz; + +[#3 Domain] = 1:4-1:25 + >---------------------< +1| private int bar, baz; diff --git a/data/fixtures/scopes/csharp/collectionItem.unenclosed.multiLine.scope b/data/fixtures/scopes/csharp/collectionItem.unenclosed.multiLine.scope new file mode 100644 index 0000000000..2775afbc82 --- /dev/null +++ b/data/fixtures/scopes/csharp/collectionItem.unenclosed.multiLine.scope @@ -0,0 +1,58 @@ +int foo, + bar; +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| int foo, + +[#1 Removal] = 0:0-0:8 + >--------< +0| int foo, + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| int foo, + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:4-0:7 + >---< +0| int foo, + +[#2 Removal] = 0:4-1:4 + >---- +0| int foo, +1| bar; + ----< + +[#2 Trailing delimiter] = 0:7-1:4 + >- +0| int foo, +1| bar; + ----< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 1:4-1:7 + >---< +1| bar; + +[#3 Removal] = 0:7-1:7 + >- +0| int foo, +1| bar; + -------< + +[#3 Leading delimiter] = 0:7-1:4 + >- +0| int foo, +1| bar; + ----< + +[#3 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/csharp/collectionItem.unenclosed.multiLine2.scope b/data/fixtures/scopes/csharp/collectionItem.unenclosed.multiLine2.scope new file mode 100644 index 0000000000..200cfccaf8 --- /dev/null +++ b/data/fixtures/scopes/csharp/collectionItem.unenclosed.multiLine2.scope @@ -0,0 +1,84 @@ +class Foo { + private int bar, + baz; +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:19 + >---------------< +1| private int bar, + +[#1 Removal] = 1:4-2:8 + >---------------- +1| private int bar, +2| baz; + --------< + +[#1 Trailing delimiter] = 1:19-2:8 + >- +1| private int bar, +2| baz; + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 1:16-1:19 + >---< +1| private int bar, + +[#2 Removal] = 1:16-2:8 + >---- +1| private int bar, +2| baz; + --------< + +[#2 Trailing delimiter] = 1:19-2:8 + >- +1| private int bar, +2| baz; + --------< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 2:8-2:11 + >---< +2| baz; + +[#3 Removal] = 1:19-2:11 + >- +1| private int bar, +2| baz; + -----------< + +[#3 Leading delimiter] = 1:19-2:8 + >- +1| private int bar, +2| baz; + --------< + +[#3 Insertion delimiter] = ",\n" + + +[#4 Content] = +[#4 Domain] = 2:8-2:12 + >----< +2| baz; + +[#4 Removal] = 1:19-2:12 + >- +1| private int bar, +2| baz; + ------------< + +[#4 Leading delimiter] = 1:19-2:8 + >- +1| private int bar, +2| baz; + --------< + +[#4 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/csharp/collectionItem.unenclosed.singleLine.scope b/data/fixtures/scopes/csharp/collectionItem.unenclosed.singleLine.scope new file mode 100644 index 0000000000..5e9a7a4ae6 --- /dev/null +++ b/data/fixtures/scopes/csharp/collectionItem.unenclosed.singleLine.scope @@ -0,0 +1,65 @@ +int foo, bar; +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| int foo, bar; + +[#1 Removal] = 0:0-0:9 + >---------< +0| int foo, bar; + +[#1 Trailing delimiter] = 0:7-0:9 + >--< +0| int foo, bar; + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:4-0:7 + >---< +0| int foo, bar; + +[#2 Removal] = 0:4-0:9 + >-----< +0| int foo, bar; + +[#2 Trailing delimiter] = 0:7-0:9 + >--< +0| int foo, bar; + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 0:9-0:12 + >---< +0| int foo, bar; + +[#3 Removal] = 0:7-0:12 + >-----< +0| int foo, bar; + +[#3 Leading delimiter] = 0:7-0:9 + >--< +0| int foo, bar; + +[#3 Insertion delimiter] = ", " + + +[#4 Content] = +[#4 Domain] = 0:9-0:13 + >----< +0| int foo, bar; + +[#4 Removal] = 0:7-0:13 + >------< +0| int foo, bar; + +[#4 Leading delimiter] = 0:7-0:9 + >--< +0| int foo, bar; + +[#4 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/csharp/collectionItem.unenclosed.singleLine2.scope b/data/fixtures/scopes/csharp/collectionItem.unenclosed.singleLine2.scope new file mode 100644 index 0000000000..b4e7c88360 --- /dev/null +++ b/data/fixtures/scopes/csharp/collectionItem.unenclosed.singleLine2.scope @@ -0,0 +1,67 @@ +class Foo { + private int bar, baz; +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:19 + >---------------< +1| private int bar, baz; + +[#1 Removal] = 1:4-1:21 + >-----------------< +1| private int bar, baz; + +[#1 Trailing delimiter] = 1:19-1:21 + >--< +1| private int bar, baz; + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 1:16-1:19 + >---< +1| private int bar, baz; + +[#2 Removal] = 1:16-1:21 + >-----< +1| private int bar, baz; + +[#2 Trailing delimiter] = 1:19-1:21 + >--< +1| private int bar, baz; + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 1:21-1:24 + >---< +1| private int bar, baz; + +[#3 Removal] = 1:19-1:24 + >-----< +1| private int bar, baz; + +[#3 Leading delimiter] = 1:19-1:21 + >--< +1| private int bar, baz; + +[#3 Insertion delimiter] = ", " + + +[#4 Content] = +[#4 Domain] = 1:21-1:25 + >----< +1| private int bar, baz; + +[#4 Removal] = 1:19-1:25 + >------< +1| private int bar, baz; + +[#4 Leading delimiter] = 1:19-1:21 + >--< +1| private int bar, baz; + +[#4 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/css/collectionItem.unenclosed.scope b/data/fixtures/scopes/css/collectionItem.unenclosed.multiLine.scope similarity index 100% rename from data/fixtures/scopes/css/collectionItem.unenclosed.scope rename to data/fixtures/scopes/css/collectionItem.unenclosed.multiLine.scope diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.iteration2.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.iteration2.scope index ef6cac4991..c03d91de48 100644 --- a/data/fixtures/scopes/java/collectionItem.unenclosed.iteration2.scope +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.iteration2.scope @@ -1,21 +1,21 @@ -public class Foo { - public void bar() { +class Foo { + void bar() { int aaa, bbb; } } --- [#1 Content] = 1:4-3:5 - >------------------- -1| public void bar() { + >------------ +1| void bar() { 2| int aaa, bbb; 3| } -----< -[#1 Domain] = 0:18-4:0 - > -0| public class Foo { -1| public void bar() { +[#1 Domain] = 0:11-4:0 + > +0| class Foo { +1| void bar() { 2| int aaa, bbb; 3| } 4| } @@ -26,9 +26,9 @@ public class Foo { >-------------< 2| int aaa, bbb; -[#2 Domain] = 1:23-3:4 - > -1| public void bar() { +[#2 Domain] = 1:16-3:4 + > +1| void bar() { 2| int aaa, bbb; 3| } ----< diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.iteration3.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.iteration3.scope new file mode 100644 index 0000000000..9f5f3c4958 --- /dev/null +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.iteration3.scope @@ -0,0 +1,33 @@ +class Foo { + void bar() throws AException, BException {} +} +--- + +[#1 Content] = 1:4-1:47 + >-------------------------------------------< +1| void bar() throws AException, BException {} + +[#1 Domain] = 0:11-2:0 + > +0| class Foo { +1| void bar() throws AException, BException {} +2| } + < + + +[#2 Content] = 1:4-1:47 + >-------------------------------------------< +1| void bar() throws AException, BException {} + +[#2 Domain] = 1:0-1:47 + >-----------------------------------------------< +1| void bar() throws AException, BException {} + + +[#3 Content] = 1:22-1:44 + >----------------------< +1| void bar() throws AException, BException {} + +[#3 Domain] = 1:15-1:44 + >-----------------------------< +1| void bar() throws AException, BException {} diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine.scope new file mode 100644 index 0000000000..1e010f67ff --- /dev/null +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine.scope @@ -0,0 +1,84 @@ +class Foo { + int aaa, + bbb; +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:11 + >-------< +1| int aaa, + +[#1 Removal] = 1:4-2:8 + >-------- +1| int aaa, +2| bbb; + --------< + +[#1 Trailing delimiter] = 1:11-2:8 + >- +1| int aaa, +2| bbb; + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 1:8-1:11 + >---< +1| int aaa, + +[#2 Removal] = 1:8-2:8 + >---- +1| int aaa, +2| bbb; + --------< + +[#2 Trailing delimiter] = 1:11-2:8 + >- +1| int aaa, +2| bbb; + --------< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 2:8-2:11 + >---< +2| bbb; + +[#3 Removal] = 1:11-2:11 + >- +1| int aaa, +2| bbb; + -----------< + +[#3 Leading delimiter] = 1:11-2:8 + >- +1| int aaa, +2| bbb; + --------< + +[#3 Insertion delimiter] = ",\n" + + +[#4 Content] = +[#4 Domain] = 2:8-2:12 + >----< +2| bbb; + +[#4 Removal] = 1:11-2:12 + >- +1| int aaa, +2| bbb; + ------------< + +[#4 Leading delimiter] = 1:11-2:8 + >- +1| int aaa, +2| bbb; + --------< + +[#4 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine2.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine2.scope new file mode 100644 index 0000000000..fe05364a57 --- /dev/null +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine2.scope @@ -0,0 +1,111 @@ +class Foo { + void bar() { + int aaa, + bbb; + } +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-4:5 + >------------ +1| void bar() { +2| int aaa, +3| bbb; +4| } + -----< + +[#1 Removal] = 1:0-5:0 + >---------------- +1| void bar() { +2| int aaa, +3| bbb; +4| } +5| } + < + +[#1 Leading delimiter] = 1:0-1:4 + >----< +1| void bar() { + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:8-2:15 + >-------< +2| int aaa, + +[#2 Removal] = 2:8-3:12 + >-------- +2| int aaa, +3| bbb; + ------------< + +[#2 Trailing delimiter] = 2:15-3:12 + >- +2| int aaa, +3| bbb; + ------------< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 2:12-2:15 + >---< +2| int aaa, + +[#3 Removal] = 2:12-3:12 + >---- +2| int aaa, +3| bbb; + ------------< + +[#3 Trailing delimiter] = 2:15-3:12 + >- +2| int aaa, +3| bbb; + ------------< + +[#3 Insertion delimiter] = ",\n" + + +[#4 Content] = +[#4 Domain] = 3:12-3:15 + >---< +3| bbb; + +[#4 Removal] = 2:15-3:15 + >- +2| int aaa, +3| bbb; + ---------------< + +[#4 Leading delimiter] = 2:15-3:12 + >- +2| int aaa, +3| bbb; + ------------< + +[#4 Insertion delimiter] = ",\n" + + +[#5 Content] = +[#5 Domain] = 3:12-3:16 + >----< +3| bbb; + +[#5 Removal] = 2:15-3:16 + >- +2| int aaa, +3| bbb; + ----------------< + +[#5 Leading delimiter] = 2:15-3:12 + >- +2| int aaa, +3| bbb; + ------------< + +[#5 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine3.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine3.scope new file mode 100644 index 0000000000..c754c4ff50 --- /dev/null +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.multiLine3.scope @@ -0,0 +1,84 @@ +class Foo { + void bar() throws AException, + BException {} +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:32 + >----------------------------< +1| void bar() throws AException, + +[#1 Removal] = 1:4-2:8 + >----------------------------- +1| void bar() throws AException, +2| BException {} + --------< + +[#1 Trailing delimiter] = 1:32-2:8 + >- +1| void bar() throws AException, +2| BException {} + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 1:22-1:32 + >----------< +1| void bar() throws AException, + +[#2 Removal] = 1:22-2:8 + >----------- +1| void bar() throws AException, +2| BException {} + --------< + +[#2 Trailing delimiter] = 1:32-2:8 + >- +1| void bar() throws AException, +2| BException {} + --------< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 2:8-2:18 + >----------< +2| BException {} + +[#3 Removal] = 1:32-2:18 + >- +1| void bar() throws AException, +2| BException {} + ------------------< + +[#3 Leading delimiter] = 1:32-2:8 + >- +1| void bar() throws AException, +2| BException {} + --------< + +[#3 Insertion delimiter] = ",\n" + + +[#4 Content] = +[#4 Domain] = 2:8-2:21 + >-------------< +2| BException {} + +[#4 Removal] = 1:32-2:21 + >- +1| void bar() throws AException, +2| BException {} + ---------------------< + +[#4 Leading delimiter] = 1:32-2:8 + >- +1| void bar() throws AException, +2| BException {} + --------< + +[#4 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine.scope similarity index 98% rename from data/fixtures/scopes/java/collectionItem.unenclosed.scope rename to data/fixtures/scopes/java/collectionItem.unenclosed.singleLine.scope index 419ecc8098..c9bc7fe185 100644 --- a/data/fixtures/scopes/java/collectionItem.unenclosed.scope +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine.scope @@ -1,4 +1,4 @@ -public class Foo { +class Foo { int aaa, bbb; } --- diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed2.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine2.scope similarity index 88% rename from data/fixtures/scopes/java/collectionItem.unenclosed2.scope rename to data/fixtures/scopes/java/collectionItem.unenclosed.singleLine2.scope index 6e3b471572..33e4f1895f 100644 --- a/data/fixtures/scopes/java/collectionItem.unenclosed2.scope +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine2.scope @@ -1,5 +1,5 @@ -public class Foo { - public void bar() { +class Foo { + void bar() { int aaa, bbb; } } @@ -7,15 +7,15 @@ public class Foo { [#1 Content] = [#1 Domain] = 1:4-3:5 - >------------------- -1| public void bar() { + >------------ +1| void bar() { 2| int aaa, bbb; 3| } -----< [#1 Removal] = 1:0-4:0 - >----------------------- -1| public void bar() { + >---------------- +1| void bar() { 2| int aaa, bbb; 3| } 4| } @@ -23,7 +23,7 @@ public class Foo { [#1 Leading delimiter] = 1:0-1:4 >----< -1| public void bar() { +1| void bar() { [#1 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine3.scope b/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine3.scope new file mode 100644 index 0000000000..b16d18301a --- /dev/null +++ b/data/fixtures/scopes/java/collectionItem.unenclosed.singleLine3.scope @@ -0,0 +1,67 @@ +class Foo { + void bar() throws AException, BException {} +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:32 + >----------------------------< +1| void bar() throws AException, BException {} + +[#1 Removal] = 1:4-1:34 + >------------------------------< +1| void bar() throws AException, BException {} + +[#1 Trailing delimiter] = 1:32-1:34 + >--< +1| void bar() throws AException, BException {} + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 1:22-1:32 + >----------< +1| void bar() throws AException, BException {} + +[#2 Removal] = 1:22-1:34 + >------------< +1| void bar() throws AException, BException {} + +[#2 Trailing delimiter] = 1:32-1:34 + >--< +1| void bar() throws AException, BException {} + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 1:34-1:44 + >----------< +1| void bar() throws AException, BException {} + +[#3 Removal] = 1:32-1:44 + >------------< +1| void bar() throws AException, BException {} + +[#3 Leading delimiter] = 1:32-1:34 + >--< +1| void bar() throws AException, BException {} + +[#3 Insertion delimiter] = ", " + + +[#4 Content] = +[#4 Domain] = 1:34-1:47 + >-------------< +1| void bar() throws AException, BException {} + +[#4 Removal] = 1:32-1:47 + >---------------< +1| void bar() throws AException, BException {} + +[#4 Leading delimiter] = 1:32-1:34 + >--< +1| void bar() throws AException, BException {} + +[#4 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/javascript.core/collectionItem.unenclosed.multiLine.scope b/data/fixtures/scopes/javascript.core/collectionItem.unenclosed.multiLine.scope new file mode 100644 index 0000000000..0444399383 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/collectionItem.unenclosed.multiLine.scope @@ -0,0 +1,58 @@ +let foo, + bar; +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| let foo, + +[#1 Removal] = 0:0-0:8 + >--------< +0| let foo, + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| let foo, + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:4-0:7 + >---< +0| let foo, + +[#2 Removal] = 0:4-1:4 + >---- +0| let foo, +1| bar; + ----< + +[#2 Trailing delimiter] = 0:7-1:4 + >- +0| let foo, +1| bar; + ----< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 1:4-1:7 + >---< +1| bar; + +[#3 Removal] = 0:7-1:7 + >- +0| let foo, +1| bar; + -------< + +[#3 Leading delimiter] = 0:7-1:4 + >- +0| let foo, +1| bar; + ----< + +[#3 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/javascript.core/collectionItem.unenclosed.scope b/data/fixtures/scopes/javascript.core/collectionItem.unenclosed.singleLine.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/collectionItem.unenclosed.scope rename to data/fixtures/scopes/javascript.core/collectionItem.unenclosed.singleLine.scope diff --git a/data/fixtures/scopes/markdown/collectionItem.unenclosed.scope b/data/fixtures/scopes/markdown/collectionItem.unenclosed.multiLine.scope similarity index 100% rename from data/fixtures/scopes/markdown/collectionItem.unenclosed.scope rename to data/fixtures/scopes/markdown/collectionItem.unenclosed.multiLine.scope diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.scope deleted file mode 100644 index d25c251e54..0000000000 --- a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.scope +++ /dev/null @@ -1,17 +0,0 @@ -import foo ---- - -[Content] = -[Domain] = 0:7-0:10 - >---< -0| import foo - -[Removal] = 0:6-0:10 - >----< -0| import foo - -[Leading delimiter] = 0:6-0:7 - >-< -0| import foo - -[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed2.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine.scope similarity index 100% rename from data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed2.scope rename to data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine.scope diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed5.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine2.scope similarity index 100% rename from data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed5.scope rename to data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine2.scope diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed6.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine3.scope similarity index 100% rename from data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed6.scope rename to data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine3.scope diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed7.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine4.scope similarity index 100% rename from data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed7.scope rename to data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed.singleLine4.scope diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed3.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed3.scope deleted file mode 100644 index b7fea4ee70..0000000000 --- a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed3.scope +++ /dev/null @@ -1,17 +0,0 @@ -from foo import bar ---- - -[Content] = -[Domain] = 0:16-0:19 - >---< -0| from foo import bar - -[Removal] = 0:15-0:19 - >----< -0| from foo import bar - -[Leading delimiter] = 0:15-0:16 - >-< -0| from foo import bar - -[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed4.scope b/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed4.scope deleted file mode 100644 index a635f1c19d..0000000000 --- a/data/fixtures/scopes/python/collectionItem/collectionItem.unenclosed4.scope +++ /dev/null @@ -1,18 +0,0 @@ -def foo(): - global bar ---- - -[Content] = -[Domain] = 1:11-1:14 - >---< -1| global bar - -[Removal] = 1:10-1:14 - >----< -1| global bar - -[Leading delimiter] = 1:10-1:11 - >-< -1| global bar - -[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/yaml/collectionItem.unenclosed.scope b/data/fixtures/scopes/yaml/collectionItem.unenclosed.multiLine.scope similarity index 100% rename from data/fixtures/scopes/yaml/collectionItem.unenclosed.scope rename to data/fixtures/scopes/yaml/collectionItem.unenclosed.multiLine.scope diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index c76c69a114..b0af33f45d 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -94,8 +94,9 @@ - `collectionItem.textual` A text based collection item - `collectionItem.textual.iteration` Iteration scope for text based collection items -- `collectionItem.unenclosed` An item in a comma-separated list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. - `collectionItem.unenclosed.iteration` Iteration scope for items in a comma-separated list without enclosing delimiters +- `collectionItem.unenclosed.multiLine` An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line. +- `collectionItem.unenclosed.singleLine` An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. ### command diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index c20c7bc6e4..a5601080d0 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -31,7 +31,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { class: supported, "class.iteration.document": supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.singleLine": supported, + "collectionItem.unenclosed.multiLine": supported, "collectionItem.unenclosed.iteration": supported, namedFunction: supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index cbaf8f4924..2626d2fab1 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -223,6 +223,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "interior.ternary": supported, "interior.try": supported, + "collectionItem.unenclosed.singleLine": supported, + "collectionItem.unenclosed.multiLine": supported, + "collectionItem.unenclosed.iteration": supported, + /* UNSUPPORTED */ fieldAccess: unsupported, @@ -280,10 +284,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { notebookCell: notApplicable, "interior.cell": notApplicable, - // Collection item - "collectionItem.unenclosed.iteration": notApplicable, - "collectionItem.unenclosed": notApplicable, - // Namespace "statement.namespace": notApplicable, "name.namespace": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 0ab9014eda..a4de015662 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -32,7 +32,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.mapPair": supported, "value.mapPair.iteration": supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.multiLine": supported, "collectionItem.unenclosed.iteration": supported, "statement.misc": supported, @@ -43,6 +43,9 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Multiline unenclosed item + "collectionItem.unenclosed.singleLine": notApplicable, + // Variable "statement.variable": notApplicable, "statement.assignment": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index a78a8bb97e..e5a7feb120 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -267,7 +267,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": notApplicable, // Collection item - "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, // Static diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index f6f387a5c2..f02bd3b2d5 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -47,7 +47,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.constructor.singleLine": supported, "argumentList.formal.constructor.multiLine": supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.singleLine": supported, + "collectionItem.unenclosed.multiLine": supported, "collectionItem.unenclosed.iteration": supported, "branch.if": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 2dcd0db13e..32116a4e78 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -11,7 +11,8 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { disqualifyDelimiter: supported, pairDelimiter: supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.singleLine": supported, + "collectionItem.unenclosed.multiLine": supported, "collectionItem.unenclosed.iteration": supported, "textFragment.string.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 4045d3d9ac..8c3bdc91cf 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -300,7 +300,8 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.typeAlias": notApplicable, // Collection item - "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, // Miscellaneous statements diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 86e04dbfaa..bad6a64bc9 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -14,13 +14,16 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { notebookCell: supported, "interior.cell": supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.multiLine": supported, "collectionItem.unenclosed.iteration": supported, list: supported, /* NOT APPLICABLE */ + // Single line unenclosed item + "collectionItem.unenclosed.singleLine": notApplicable, + // Variable "statement.variable": notApplicable, "statement.assignment": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 58a17d62bd..f198b0d519 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -121,7 +121,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.constructor.singleLine": supported, "argumentList.formal.constructor.multiLine": supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.singleLine": supported, "collectionItem.unenclosed.iteration": supported, "branch.if": supported, @@ -212,6 +212,9 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Multiline unenclosed item + "collectionItem.unenclosed.multiLine": notApplicable, + // Element and tags element: notApplicable, tags: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 289b73d8b8..112090e022 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -307,7 +307,8 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.typeAlias": notApplicable, // Collection item - "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, // Miscellaneous statements diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index daf1940fbc..11991aff2b 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -561,9 +561,14 @@ export const scopeSupportFacetInfos: Record< "ternary expression branches", "the ternary expression", ), - "collectionItem.unenclosed": { + "collectionItem.unenclosed.singleLine": { description: - "An item in a comma-separated list without enclosing delimiters. This could be multi-variable declarations, import statements, etc.", + "An item in a comma-separated single line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc.", + scopeType: "collectionItem", + }, + "collectionItem.unenclosed.multiLine": { + description: + "An item in a comma-separated multi line list without enclosing delimiters. This could be multi-variable declarations, import statements, etc. Insertion delimiter should include new line.", scopeType: "collectionItem", }, "collectionItem.unenclosed.iteration": iteration( diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 1a574409cb..f2026432b7 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -153,7 +153,8 @@ export const scopeSupportFacets = [ "branch.loop", "branch.loop.iteration", - "collectionItem.unenclosed", + "collectionItem.unenclosed.singleLine", + "collectionItem.unenclosed.multiLine", "collectionItem.unenclosed.iteration", "condition.if", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 37942c443f..a8891ade14 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -318,7 +318,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.typeAlias": notApplicable, // Collection item - "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, // Miscellaneous statements diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 17688c761c..7f55d3b1a2 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -267,7 +267,8 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": notApplicable, // Collection item - "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, // Static diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 1579ce7d3e..4cffd5f301 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -9,7 +9,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { list: supported, map: supported, - "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.multiLine": supported, "collectionItem.unenclosed.iteration": supported, "key.mapPair": supported, @@ -29,6 +29,9 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Single line unenclosed item + "collectionItem.unenclosed.singleLine": notApplicable, + // Variable "statement.variable": notApplicable, "statement.assignment": notApplicable, diff --git a/queries/c.scm b/queries/c.scm index ef8b688fcd..786cfc8c7c 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -451,9 +451,16 @@ ;;!! int foo, bar; ;;! ^^^ ^^^ -(declaration - type: (_) - (_) @collectionItem +( + (declaration + type: (_) + (_)? @_.leading.endOf + . + (_) @collectionItem + . + (_)? @_.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") ) (declaration diff --git a/queries/csharp.scm b/queries/csharp.scm index 340f6a84d3..2d2f3946f4 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -576,6 +576,31 @@ ")" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf ) +;;!! int foo, bar; +;;! ^^^ ^^^ +( + (variable_declaration + type: (_) + (variable_declarator)? @_.leading.endOf + . + (variable_declarator) @collectionItem + . + (variable_declarator)? @_.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") +) + +;;!! int foo, bar; +;;! ^^^^^^^^ +;;! ------------- +(_ + (variable_declaration + type: (_) + . + (_) @collectionItem.iteration.start.startOf + ) @collectionItem.iteration.end.endOf +) @collectionItem.iteration.domain + ;;!! catch(Exception ex) {} ;;! ^^^^^^^^^^^^ ;;! ^^^^^^^^^ diff --git a/queries/java.scm b/queries/java.scm index 7fe3ba595b..024bfe7d2e 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -472,8 +472,8 @@ (variable_declarator) @collectionItem . (variable_declarator)? @_.trailing.startOf - ) - (#insertion-delimiter! @collectionItem ", ") + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") ) ( @@ -484,8 +484,8 @@ (variable_declarator) @collectionItem . (variable_declarator)? @_.trailing.startOf - ) - (#insertion-delimiter! @collectionItem ", ") + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") ) ;;!! int foo, bar; @@ -505,6 +505,27 @@ ";"? @collectionItem.iteration.end.startOf ) @collectionItem.iteration.domain +;;!! throws Exception, IOException +;;! ^^^^^^^^^ ^^^^^^^^^^^ +( + (throws + (_)? @_.leading.endOf + . + (_) @collectionItem + . + (_)? @_.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") +) + +( + (throws + . + (_) @collectionItem.iteration.start.startOf + ) @collectionItem.iteration.end.endOf +) + @collectionItem.iteration.domain + ;;!! value = 1; ;;! ^ ;;! xxxx @@ -547,13 +568,15 @@ ;;!! Map foo; ;;! ^^^ ^^^ -(type_arguments - (_)? @_.leading.endOf - . - (_) @type - . - (_)? @_.trailing.startOf - (#insertion-delimiter! @type ", ") +( + (type_arguments + (_)? @_.leading.endOf + . + (_) @type + . + (_)? @_.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @type @_dummy ", " ",\n") ) ;;!! Map foo; diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 77dfd7bdf7..56f75f02dc 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -340,8 +340,8 @@ (variable_declarator) @collectionItem . (variable_declarator)? @_.trailing.startOf - ) - (#insertion-delimiter! @collectionItem ", ") + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") ) (lexical_declaration