diff --git a/data/fixtures/recorded/queryBasedMatchers/clearCoreEveryClass.yml b/data/fixtures/recorded/queryBasedMatchers/clearCoreEveryClass.yml index 0424fad6bd..f9c67417ff 100644 --- a/data/fixtures/recorded/queryBasedMatchers/clearCoreEveryClass.yml +++ b/data/fixtures/recorded/queryBasedMatchers/clearCoreEveryClass.yml @@ -32,8 +32,8 @@ initialState: def fff(): pass selections: - - anchor: {line: 8, character: 19} - active: {line: 8, character: 19} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} marks: {} finalState: documentContents: | diff --git a/data/fixtures/recorded/queryBasedMatchers/clearEveryClass.yml b/data/fixtures/recorded/queryBasedMatchers/clearEveryClass.yml index 134c75efa5..73bb472a9f 100644 --- a/data/fixtures/recorded/queryBasedMatchers/clearEveryClass.yml +++ b/data/fixtures/recorded/queryBasedMatchers/clearEveryClass.yml @@ -31,8 +31,8 @@ initialState: def fff(): pass selections: - - anchor: {line: 8, character: 13} - active: {line: 8, character: 13} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} marks: {} finalState: documentContents: |+ diff --git a/data/fixtures/recorded/queryBasedMatchers/clearEveryClass2.yml b/data/fixtures/recorded/queryBasedMatchers/clearEveryClass2.yml index b7ea070f71..73bb472a9f 100644 --- a/data/fixtures/recorded/queryBasedMatchers/clearEveryClass2.yml +++ b/data/fixtures/recorded/queryBasedMatchers/clearEveryClass2.yml @@ -31,8 +31,8 @@ initialState: def fff(): pass selections: - - anchor: {line: 10, character: 16} - active: {line: 10, character: 16} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} marks: {} finalState: documentContents: |+ diff --git a/data/fixtures/scopes/c/interior/interior.switchCase.scope b/data/fixtures/scopes/c/interior/interior.switchCase.scope index db0d61b7cc..a4d31bfb69 100644 --- a/data/fixtures/scopes/c/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/c/interior/interior.switchCase.scope @@ -2,39 +2,33 @@ switch (foo) { case 0: bar; break; - case 1: { - break; - } default: + bar; break; } --- -[#1 Content] = 1:4-8:14 +[#1 Content] = 1:4-6:14 >------- 1| case 0: 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< [#1 Removal] = -[#1 Domain] = 0:14-9:0 +[#1 Domain] = 0:14-7:0 > 0| switch (foo) { 1| case 0: 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } +4| default: +5| bar; +6| break; +7| } < [#1 Insertion delimiter] = " " @@ -57,30 +51,18 @@ switch (foo) { [#2 Insertion delimiter] = " " -[#3 Content] = 5:8-5:14 - >------< -5| break; +[#3 Content] = 5:8-6:14 + >---- +5| bar; +6| break; + --------------< [#3 Removal] = -[#3 Domain] = 4:13-6:4 - > -4| case 1: { -5| break; -6| } - ----< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = 8:8-8:14 - >------< -8| break; - -[#4 Removal] = -[#4 Domain] = 7:12-8:14 +[#3 Domain] = 4:12-6:14 > -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< -[#4 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.switchCase2.scope b/data/fixtures/scopes/c/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..7380c0cc2a --- /dev/null +++ b/data/fixtures/scopes/c/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +switch (foo) { + case 0: { } + default: { } +} +--- + +[#1 Content] = 1:4-2:16 + >----------- +1| case 0: { } +2| default: { } + ----------------< + +[#1 Removal] = +[#1 Domain] = 0:14-3:0 + > +0| switch (foo) { +1| case 0: { } +2| default: { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:13-1:14 + >-< +1| case 0: { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:14-2:15 + >-< +2| default: { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/cpp/name/name.argument.formal.iteration.scope index 8fea0c4c3b..c0ef6df089 100644 --- a/data/fixtures/scopes/cpp/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/cpp/name/name.argument.formal.iteration.scope @@ -1,13 +1,13 @@ -void foo(int aaa = 0, int bbb = 1) {} +void foo(int aaa, int bbb = 1) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:37 - >-------------------------------------< -0| void foo(int aaa = 0, int bbb = 1) {} +[#1 Domain] = 0:0-0:33 + >---------------------------------< +0| void foo(int aaa, int bbb = 1) {} [#2 Content] = -[#2 Domain] = 0:9-0:33 - >------------------------< -0| void foo(int aaa = 0, int bbb = 1) {} +[#2 Domain] = 0:9-0:29 + >--------------------< +0| void foo(int aaa, int bbb = 1) {} diff --git a/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.iteration.scope index a74a2e4ade..a198fe85d2 100644 --- a/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.iteration.scope +++ b/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.iteration.scope @@ -1,13 +1,13 @@ -[](int aaa, int bbb) {} +[](int aaa, int bbb = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| [](int aaa, int bbb) {} +[#1 Domain] = 0:0-0:27 + >---------------------------< +0| [](int aaa, int bbb = 0) {} [#2 Content] = -[#2 Domain] = 0:3-0:19 - >----------------< -0| [](int aaa, int bbb) {} +[#2 Domain] = 0:3-0:23 + >--------------------< +0| [](int aaa, int bbb = 0) {} diff --git a/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.scope b/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.scope index 00da09bc76..1ff9161562 100644 --- a/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.scope +++ b/data/fixtures/scopes/cpp/name/name.argument.formal.lambda.scope @@ -1,39 +1,43 @@ -[](int aaa, int bbb) {} +[](int aaa, int bbb = 0) {} --- [#1 Content] = 0:7-0:10 >---< -0| [](int aaa, int bbb) {} +0| [](int aaa, int bbb = 0) {} [#1 Removal] = 0:6-0:10 >----< -0| [](int aaa, int bbb) {} +0| [](int aaa, int bbb = 0) {} [#1 Leading delimiter] = 0:6-0:7 >-< -0| [](int aaa, int bbb) {} +0| [](int aaa, int bbb = 0) {} [#1 Domain] = 0:3-0:10 >-------< -0| [](int aaa, int bbb) {} +0| [](int aaa, int bbb = 0) {} [#1 Insertion delimiter] = " " [#2 Content] = 0:16-0:19 >---< -0| [](int aaa, int bbb) {} +0| [](int aaa, int bbb = 0) {} -[#2 Removal] = 0:15-0:19 - >----< -0| [](int aaa, int bbb) {} +[#2 Removal] = 0:16-0:20 + >----< +0| [](int aaa, int bbb = 0) {} [#2 Leading delimiter] = 0:15-0:16 >-< -0| [](int aaa, int bbb) {} +0| [](int aaa, int bbb = 0) {} -[#2 Domain] = 0:12-0:19 - >-------< -0| [](int aaa, int bbb) {} +[#2 Trailing delimiter] = 0:19-0:20 + >-< +0| [](int aaa, int bbb = 0) {} + +[#2 Domain] = 0:12-0:23 + >-----------< +0| [](int aaa, int bbb = 0) {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.argument.formal.scope b/data/fixtures/scopes/cpp/name/name.argument.formal.scope index e1a7159fd3..9ee40edee3 100644 --- a/data/fixtures/scopes/cpp/name/name.argument.formal.scope +++ b/data/fixtures/scopes/cpp/name/name.argument.formal.scope @@ -1,63 +1,59 @@ -void foo(int aaa = 0, int bbb = 1) {} +void foo(int aaa, int bbb = 0) {} --- [#1 Content] = [#1 Removal] = 0:5-0:8 >---< -0| void foo(int aaa = 0, int bbb = 1) {} +0| void foo(int aaa, int bbb = 0) {} [#1 Leading delimiter] = 0:4-0:5 >-< -0| void foo(int aaa = 0, int bbb = 1) {} +0| void foo(int aaa, int bbb = 0) {} -[#1 Domain] = 0:0-0:37 - >-------------------------------------< -0| void foo(int aaa = 0, int bbb = 1) {} +[#1 Domain] = 0:0-0:33 + >---------------------------------< +0| void foo(int aaa, int bbb = 0) {} [#1 Insertion delimiter] = " " [#2 Content] = 0:13-0:16 >---< -0| void foo(int aaa = 0, int bbb = 1) {} +0| void foo(int aaa, int bbb = 0) {} -[#2 Removal] = 0:13-0:17 - >----< -0| void foo(int aaa = 0, int bbb = 1) {} +[#2 Removal] = 0:12-0:16 + >----< +0| void foo(int aaa, int bbb = 0) {} [#2 Leading delimiter] = 0:12-0:13 >-< -0| void foo(int aaa = 0, int bbb = 1) {} +0| void foo(int aaa, int bbb = 0) {} -[#2 Trailing delimiter] = 0:16-0:17 - >-< -0| void foo(int aaa = 0, int bbb = 1) {} - -[#2 Domain] = 0:9-0:20 - >-----------< -0| void foo(int aaa = 0, int bbb = 1) {} +[#2 Domain] = 0:9-0:16 + >-------< +0| void foo(int aaa, int bbb = 0) {} [#2 Insertion delimiter] = " " -[#3 Content] = 0:26-0:29 - >---< -0| void foo(int aaa = 0, int bbb = 1) {} +[#3 Content] = 0:22-0:25 + >---< +0| void foo(int aaa, int bbb = 0) {} -[#3 Removal] = 0:26-0:30 - >----< -0| void foo(int aaa = 0, int bbb = 1) {} +[#3 Removal] = 0:22-0:26 + >----< +0| void foo(int aaa, int bbb = 0) {} -[#3 Leading delimiter] = 0:25-0:26 - >-< -0| void foo(int aaa = 0, int bbb = 1) {} +[#3 Leading delimiter] = 0:21-0:22 + >-< +0| void foo(int aaa, int bbb = 0) {} -[#3 Trailing delimiter] = 0:29-0:30 - >-< -0| void foo(int aaa = 0, int bbb = 1) {} +[#3 Trailing delimiter] = 0:25-0:26 + >-< +0| void foo(int aaa, int bbb = 0) {} -[#3 Domain] = 0:22-0:33 - >-----------< -0| void foo(int aaa = 0, int bbb = 1) {} +[#3 Domain] = 0:18-0:29 + >-----------< +0| void foo(int aaa, int bbb = 0) {} [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/cpp/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..4017be3e6e --- /dev/null +++ b/data/fixtures/scopes/cpp/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,13 @@ +[](int aaa = 0, int bbb = 1) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:31 + >-------------------------------< +0| [](int aaa = 0, int bbb = 1) {} + + +[#2 Content] = +[#2 Domain] = 0:3-0:27 + >------------------------< +0| [](int aaa = 0, int bbb = 1) {} diff --git a/data/fixtures/scopes/cpp/value/value.argument.formal.lambda.scope b/data/fixtures/scopes/cpp/value/value.argument.formal.lambda.scope new file mode 100644 index 0000000000..8432c1c31f --- /dev/null +++ b/data/fixtures/scopes/cpp/value/value.argument.formal.lambda.scope @@ -0,0 +1,39 @@ +[](int aaa = 0, int bbb = 1) {} +--- + +[#1 Content] = 0:13-0:14 + >-< +0| [](int aaa = 0, int bbb = 1) {} + +[#1 Removal] = 0:10-0:14 + >----< +0| [](int aaa = 0, int bbb = 1) {} + +[#1 Leading delimiter] = 0:10-0:13 + >---< +0| [](int aaa = 0, int bbb = 1) {} + +[#1 Domain] = 0:3-0:14 + >-----------< +0| [](int aaa = 0, int bbb = 1) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:26-0:27 + >-< +0| [](int aaa = 0, int bbb = 1) {} + +[#2 Removal] = 0:23-0:27 + >----< +0| [](int aaa = 0, int bbb = 1) {} + +[#2 Leading delimiter] = 0:23-0:26 + >---< +0| [](int aaa = 0, int bbb = 1) {} + +[#2 Domain] = 0:16-0:27 + >-----------< +0| [](int aaa = 0, int bbb = 1) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/class.iteration.block.scope b/data/fixtures/scopes/csharp/class.iteration.block.scope deleted file mode 100644 index 8a0caa305b..0000000000 --- a/data/fixtures/scopes/csharp/class.iteration.block.scope +++ /dev/null @@ -1,27 +0,0 @@ -public class Foo { - public class Bar { } -} ---- - -[#1 Content] = -[#1 Domain] = 0:0-2:1 - >------------------ -0| public class Foo { -1| public class Bar { } -2| } - -< - - -[#2 Content] = -[#2 Domain] = 0:18-2:0 - > -0| public class Foo { -1| public class Bar { } -2| } - < - - -[#3 Content] = -[#3 Domain] = 1:22-1:23 - >-< -1| public class Bar { } diff --git a/data/fixtures/scopes/java/class.iteration.block.scope b/data/fixtures/scopes/csharp/class.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/java/class.iteration.block.scope rename to data/fixtures/scopes/csharp/class.iteration.class.scope diff --git a/data/fixtures/scopes/csharp/interior/interior.switchCase.scope b/data/fixtures/scopes/csharp/interior/interior.switchCase.scope index db0d61b7cc..a4d31bfb69 100644 --- a/data/fixtures/scopes/csharp/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/csharp/interior/interior.switchCase.scope @@ -2,39 +2,33 @@ switch (foo) { case 0: bar; break; - case 1: { - break; - } default: + bar; break; } --- -[#1 Content] = 1:4-8:14 +[#1 Content] = 1:4-6:14 >------- 1| case 0: 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< [#1 Removal] = -[#1 Domain] = 0:14-9:0 +[#1 Domain] = 0:14-7:0 > 0| switch (foo) { 1| case 0: 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } +4| default: +5| bar; +6| break; +7| } < [#1 Insertion delimiter] = " " @@ -57,30 +51,18 @@ switch (foo) { [#2 Insertion delimiter] = " " -[#3 Content] = 5:8-5:14 - >------< -5| break; +[#3 Content] = 5:8-6:14 + >---- +5| bar; +6| break; + --------------< [#3 Removal] = -[#3 Domain] = 4:13-6:4 - > -4| case 1: { -5| break; -6| } - ----< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = 8:8-8:14 - >------< -8| break; - -[#4 Removal] = -[#4 Domain] = 7:12-8:14 +[#3 Domain] = 4:12-6:14 > -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< -[#4 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.switchCase2.scope b/data/fixtures/scopes/csharp/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..7380c0cc2a --- /dev/null +++ b/data/fixtures/scopes/csharp/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +switch (foo) { + case 0: { } + default: { } +} +--- + +[#1 Content] = 1:4-2:16 + >----------- +1| case 0: { } +2| default: { } + ----------------< + +[#1 Removal] = +[#1 Domain] = 0:14-3:0 + > +0| switch (foo) { +1| case 0: { } +2| default: { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:13-1:14 + >-< +1| case 0: { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:14-2:15 + >-< +2| default: { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.iteration.scope index 38b73085f5..6f397b0afd 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.iteration.scope @@ -1,5 +1,5 @@ class Foo { - Foo(int aaa, int bbb) {} + Foo(int aaa, int bbb = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:8-1:24 - >----------------< -1| Foo(int aaa, int bbb) {} +[#3 Domain] = 1:8-1:28 + >--------------------< +1| Foo(int aaa, int bbb = 0) {} diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.scope index 3a6057cbbf..5464c1822e 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.constructor.scope @@ -1,5 +1,5 @@ class Foo { - Foo(int aaa, int bbb) {} + Foo(int aaa, int bbb = 0) {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} 2| } -< @@ -32,52 +32,56 @@ class Foo { [#2 Content] = [#2 Removal] = 1:4-1:7 >---< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} [#2 Leading delimiter] = 1:0-1:4 >----< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} -[#2 Domain] = 1:4-1:28 - >------------------------< -1| Foo(int aaa, int bbb) {} +[#2 Domain] = 1:4-1:32 + >----------------------------< +1| Foo(int aaa, int bbb = 0) {} [#2 Insertion delimiter] = " " [#3 Content] = 1:12-1:15 >---< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} [#3 Removal] = 1:11-1:15 >----< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} [#3 Leading delimiter] = 1:11-1:12 >-< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} [#3 Domain] = 1:8-1:15 >-------< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} [#3 Insertion delimiter] = " " [#4 Content] = 1:21-1:24 >---< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} -[#4 Removal] = 1:20-1:24 - >----< -1| Foo(int aaa, int bbb) {} +[#4 Removal] = 1:21-1:25 + >----< +1| Foo(int aaa, int bbb = 0) {} [#4 Leading delimiter] = 1:20-1:21 >-< -1| Foo(int aaa, int bbb) {} +1| Foo(int aaa, int bbb = 0) {} -[#4 Domain] = 1:17-1:24 - >-------< -1| Foo(int aaa, int bbb) {} +[#4 Trailing delimiter] = 1:24-1:25 + >-< +1| Foo(int aaa, int bbb = 0) {} + +[#4 Domain] = 1:17-1:28 + >-----------< +1| Foo(int aaa, int bbb = 0) {} [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.iteration.scope index 23ff30aaea..bce0797a63 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.iteration.scope @@ -1,13 +1,13 @@ -void Foo(int aaa, int bbb) {} +void Foo(int aaa, int bbb = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:29 - >-----------------------------< -0| void Foo(int aaa, int bbb) {} +[#1 Domain] = 0:0-0:33 + >---------------------------------< +0| void Foo(int aaa, int bbb = 0) {} [#2 Content] = -[#2 Domain] = 0:9-0:25 - >----------------< -0| void Foo(int aaa, int bbb) {} +[#2 Domain] = 0:9-0:29 + >--------------------< +0| void Foo(int aaa, int bbb = 0) {} diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.iteration.scope index 3d9947fc2f..bdb3b8b8f8 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.iteration.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.iteration.scope @@ -1,13 +1,13 @@ -(int aaa, int bbb) => {} +(int aaa, int bbb = 0) => {} --- [#1 Content] = -[#1 Domain] = 0:0-0:24 - >------------------------< -0| (int aaa, int bbb) => {} +[#1 Domain] = 0:0-0:28 + >----------------------------< +0| (int aaa, int bbb = 0) => {} [#2 Content] = -[#2 Domain] = 0:1-0:17 - >----------------< -0| (int aaa, int bbb) => {} +[#2 Domain] = 0:1-0:21 + >--------------------< +0| (int aaa, int bbb = 0) => {} diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.scope index b8a4e10a52..28b8581c6d 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.lambda.scope @@ -1,39 +1,43 @@ -(int aaa, int bbb) => {} +(int aaa, int bbb = 0) => {} --- [#1 Content] = 0:5-0:8 >---< -0| (int aaa, int bbb) => {} +0| (int aaa, int bbb = 0) => {} [#1 Removal] = 0:4-0:8 >----< -0| (int aaa, int bbb) => {} +0| (int aaa, int bbb = 0) => {} [#1 Leading delimiter] = 0:4-0:5 >-< -0| (int aaa, int bbb) => {} +0| (int aaa, int bbb = 0) => {} [#1 Domain] = 0:1-0:8 >-------< -0| (int aaa, int bbb) => {} +0| (int aaa, int bbb = 0) => {} [#1 Insertion delimiter] = " " [#2 Content] = 0:14-0:17 >---< -0| (int aaa, int bbb) => {} +0| (int aaa, int bbb = 0) => {} -[#2 Removal] = 0:13-0:17 - >----< -0| (int aaa, int bbb) => {} +[#2 Removal] = 0:14-0:18 + >----< +0| (int aaa, int bbb = 0) => {} [#2 Leading delimiter] = 0:13-0:14 >-< -0| (int aaa, int bbb) => {} +0| (int aaa, int bbb = 0) => {} -[#2 Domain] = 0:10-0:17 - >-------< -0| (int aaa, int bbb) => {} +[#2 Trailing delimiter] = 0:17-0:18 + >-< +0| (int aaa, int bbb = 0) => {} + +[#2 Domain] = 0:10-0:21 + >-----------< +0| (int aaa, int bbb = 0) => {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.method.iteration.scope index 038d21833d..ff3edfb708 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.method.iteration.scope @@ -1,5 +1,5 @@ class Foo { - void Bar(int aaa, int bbb) {} + void Bar(int aaa, int bbb = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:13-1:29 - >----------------< -1| void Bar(int aaa, int bbb) {} +[#3 Domain] = 1:13-1:33 + >--------------------< +1| void Bar(int aaa, int bbb = 0) {} diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.method.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.method.scope index d9ad6eed7a..b1aa91bc78 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.method.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.method.scope @@ -1,5 +1,5 @@ class Foo { - void Bar(int aaa, int bbb) {} + void Bar(int aaa, int bbb = 0) {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} 2| } -< @@ -32,52 +32,56 @@ class Foo { [#2 Content] = [#2 Removal] = 1:9-1:12 >---< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} [#2 Leading delimiter] = 1:8-1:9 >-< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} -[#2 Domain] = 1:4-1:33 - >-----------------------------< -1| void Bar(int aaa, int bbb) {} +[#2 Domain] = 1:4-1:37 + >---------------------------------< +1| void Bar(int aaa, int bbb = 0) {} [#2 Insertion delimiter] = " " [#3 Content] = 1:17-1:20 >---< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} [#3 Removal] = 1:16-1:20 >----< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} [#3 Leading delimiter] = 1:16-1:17 >-< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} [#3 Domain] = 1:13-1:20 >-------< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} [#3 Insertion delimiter] = " " [#4 Content] = 1:26-1:29 >---< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} -[#4 Removal] = 1:25-1:29 - >----< -1| void Bar(int aaa, int bbb) {} +[#4 Removal] = 1:26-1:30 + >----< +1| void Bar(int aaa, int bbb = 0) {} [#4 Leading delimiter] = 1:25-1:26 >-< -1| void Bar(int aaa, int bbb) {} +1| void Bar(int aaa, int bbb = 0) {} -[#4 Domain] = 1:22-1:29 - >-------< -1| void Bar(int aaa, int bbb) {} +[#4 Trailing delimiter] = 1:29-1:30 + >-< +1| void Bar(int aaa, int bbb = 0) {} + +[#4 Domain] = 1:22-1:33 + >-----------< +1| void Bar(int aaa, int bbb = 0) {} [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.argument.formal.scope b/data/fixtures/scopes/csharp/name/name.argument.formal.scope index 80c4dae32b..6ecef2d103 100644 --- a/data/fixtures/scopes/csharp/name/name.argument.formal.scope +++ b/data/fixtures/scopes/csharp/name/name.argument.formal.scope @@ -1,55 +1,59 @@ -void Foo(int aaa, int bbb) {} +void Foo(int aaa, int bbb = 0) {} --- [#1 Content] = [#1 Removal] = 0:5-0:8 >---< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} [#1 Leading delimiter] = 0:4-0:5 >-< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} -[#1 Domain] = 0:0-0:29 - >-----------------------------< -0| void Foo(int aaa, int bbb) {} +[#1 Domain] = 0:0-0:33 + >---------------------------------< +0| void Foo(int aaa, int bbb = 0) {} [#1 Insertion delimiter] = " " [#2 Content] = 0:13-0:16 >---< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} [#2 Removal] = 0:12-0:16 >----< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} [#2 Leading delimiter] = 0:12-0:13 >-< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} [#2 Domain] = 0:9-0:16 >-------< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} [#2 Insertion delimiter] = " " [#3 Content] = 0:22-0:25 >---< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} -[#3 Removal] = 0:21-0:25 - >----< -0| void Foo(int aaa, int bbb) {} +[#3 Removal] = 0:22-0:26 + >----< +0| void Foo(int aaa, int bbb = 0) {} [#3 Leading delimiter] = 0:21-0:22 >-< -0| void Foo(int aaa, int bbb) {} +0| void Foo(int aaa, int bbb = 0) {} -[#3 Domain] = 0:18-0:25 - >-------< -0| void Foo(int aaa, int bbb) {} +[#3 Trailing delimiter] = 0:25-0:26 + >-< +0| void Foo(int aaa, int bbb = 0) {} + +[#3 Domain] = 0:18-0:29 + >-----------< +0| void Foo(int aaa, int bbb = 0) {} [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/csharp/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..b2c145d4c4 --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,13 @@ +(int aaa = 0, int bbb = 1) => {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:32 + >--------------------------------< +0| (int aaa = 0, int bbb = 1) => {} + + +[#2 Content] = +[#2 Domain] = 0:1-0:25 + >------------------------< +0| (int aaa = 0, int bbb = 1) => {} diff --git a/data/fixtures/scopes/csharp/value/value.argument.formal.lambda.scope b/data/fixtures/scopes/csharp/value/value.argument.formal.lambda.scope new file mode 100644 index 0000000000..b647c09d53 --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.argument.formal.lambda.scope @@ -0,0 +1,39 @@ +(int aaa = 0, int bbb = 1) => {} +--- + +[#1 Content] = 0:11-0:12 + >-< +0| (int aaa = 0, int bbb = 1) => {} + +[#1 Removal] = 0:8-0:12 + >----< +0| (int aaa = 0, int bbb = 1) => {} + +[#1 Leading delimiter] = 0:8-0:11 + >---< +0| (int aaa = 0, int bbb = 1) => {} + +[#1 Domain] = 0:1-0:12 + >-----------< +0| (int aaa = 0, int bbb = 1) => {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:24-0:25 + >-< +0| (int aaa = 0, int bbb = 1) => {} + +[#2 Removal] = 0:21-0:25 + >----< +0| (int aaa = 0, int bbb = 1) => {} + +[#2 Leading delimiter] = 0:21-0:24 + >---< +0| (int aaa = 0, int bbb = 1) => {} + +[#2 Domain] = 0:14-0:25 + >-----------< +0| (int aaa = 0, int bbb = 1) => {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/class.iteration.block.scope b/data/fixtures/scopes/go/class.iteration.block.scope deleted file mode 100644 index eb1487158f..0000000000 --- a/data/fixtures/scopes/go/class.iteration.block.scope +++ /dev/null @@ -1,13 +0,0 @@ -func foo() { } ---- - -[#1 Content] = -[#1 Domain] = 0:0-0:14 - >--------------< -0| func foo() { } - - -[#2 Content] = -[#2 Domain] = 0:12-0:13 - >-< -0| func foo() { } diff --git a/data/fixtures/scopes/go/interior/interior.switchCase.scope b/data/fixtures/scopes/go/interior/interior.switchCase.scope index 52039fb2b3..446c31b18e 100644 --- a/data/fixtures/scopes/go/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/go/interior/interior.switchCase.scope @@ -1,100 +1,68 @@ switch foo { case 0: - bar + bar; break - case 1: { - break - } default: + bar; break } --- -[#1 Content] = 1:4-8:13 +[#1 Content] = 1:4-6:13 >------- 1| case 0: -2| bar +2| bar; 3| break -4| case 1: { -5| break -6| } -7| default: -8| break +4| default: +5| bar; +6| break -------------< [#1 Removal] = -[#1 Domain] = 0:12-9:0 +[#1 Domain] = 0:12-7:0 > 0| switch foo { 1| case 0: -2| bar +2| bar; 3| break -4| case 1: { -5| break -6| } -7| default: -8| break -9| } +4| default: +5| bar; +6| break +7| } < [#1 Insertion delimiter] = " " -[#2 Content] = 2:8-2:11 - >---< -2| bar - -[#2 Removal] = -[#2 Domain] = 1:11-2:11 - > -1| case 0: -2| bar - -----------< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 2:8-3:13 - >--- -2| bar +[#2 Content] = 2:8-3:13 + >---- +2| bar; 3| break -------------< -[#3 Removal] = -[#3 Domain] = 1:11-3:13 +[#2 Removal] = +[#2 Domain] = 1:11-3:13 > 1| case 0: -2| bar +2| bar; 3| break -------------< -[#3 Insertion delimiter] = " " - - -[#4 Content] = 5:8-5:13 - >-----< -5| break - -[#4 Removal] = -[#4 Domain] = 4:13-6:4 - > -4| case 1: { -5| break -6| } - ----< - -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#5 Content] = 8:8-8:13 - >-----< -8| break +[#3 Content] = 5:8-6:13 + >---- +5| bar; +6| break + -------------< -[#5 Removal] = -[#5 Domain] = 7:12-8:13 +[#3 Removal] = +[#3 Domain] = 4:12-6:13 > -7| default: -8| break +4| default: +5| bar; +6| break -------------< -[#5 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.switchCase2.scope b/data/fixtures/scopes/go/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..92b45b80bf --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +switch foo { + case 0: { } + default: { } +} +--- + +[#1 Content] = 1:4-2:16 + >----------- +1| case 0: { } +2| default: { } + ----------------< + +[#1 Removal] = +[#1 Domain] = 0:12-3:0 + > +0| switch foo { +1| case 0: { } +2| default: { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:13-1:14 + >-< +1| case 0: { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:14-2:15 + >-< +2| default: { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/class.iteration.class.scope b/data/fixtures/scopes/java/class.iteration.class.scope new file mode 100644 index 0000000000..40123c5055 --- /dev/null +++ b/data/fixtures/scopes/java/class.iteration.class.scope @@ -0,0 +1,13 @@ +public class Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:20 + >--------------------< +0| public class Foo { } + + +[#2 Content] = +[#2 Domain] = 0:18-0:19 + >-< +0| public class Foo { } diff --git a/data/fixtures/scopes/java/interior/interior.switchCase.scope b/data/fixtures/scopes/java/interior/interior.switchCase.scope index 1e00f488d5..a4d31bfb69 100644 --- a/data/fixtures/scopes/java/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/java/interior/interior.switchCase.scope @@ -1,40 +1,34 @@ -switch (value) { +switch (foo) { case 0: - foo; + bar; break; - case 1: { - break; - } default: + bar; break; } --- -[#1 Content] = 1:4-8:14 +[#1 Content] = 1:4-6:14 >------- 1| case 0: -2| foo; +2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< [#1 Removal] = -[#1 Domain] = 0:16-9:0 - > -0| switch (value) { +[#1 Domain] = 0:14-7:0 + > +0| switch (foo) { 1| case 0: -2| foo; +2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } +4| default: +5| bar; +6| break; +7| } < [#1 Insertion delimiter] = " " @@ -42,7 +36,7 @@ switch (value) { [#2 Content] = 2:8-3:14 >---- -2| foo; +2| bar; 3| break; --------------< @@ -50,37 +44,25 @@ switch (value) { [#2 Domain] = 1:11-3:14 > 1| case 0: -2| foo; +2| bar; 3| break; --------------< [#2 Insertion delimiter] = " " -[#3 Content] = 5:8-5:14 - >------< -5| break; +[#3 Content] = 5:8-6:14 + >---- +5| bar; +6| break; + --------------< [#3 Removal] = -[#3 Domain] = 4:13-6:4 - > -4| case 1: { -5| break; -6| } - ----< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = 8:8-8:14 - >------< -8| break; - -[#4 Removal] = -[#4 Domain] = 7:12-8:14 +[#3 Domain] = 4:12-6:14 > -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< -[#4 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.switchCase2.scope b/data/fixtures/scopes/java/interior/interior.switchCase2.scope index b413e0e58c..7380c0cc2a 100644 --- a/data/fixtures/scopes/java/interior/interior.switchCase2.scope +++ b/data/fixtures/scopes/java/interior/interior.switchCase2.scope @@ -1,70 +1,40 @@ switch (foo) { - case 0 -> 1; - case 1 -> { - yield 2; - }; - default -> 3; + case 0: { } + default: { } } --- -[#1 Content] = 1:4-5:17 - >------------ -1| case 0 -> 1; -2| case 1 -> { -3| yield 2; -4| }; -5| default -> 3; - -----------------< +[#1 Content] = 1:4-2:16 + >----------- +1| case 0: { } +2| default: { } + ----------------< [#1 Removal] = -[#1 Domain] = 0:14-6:0 +[#1 Domain] = 0:14-3:0 > 0| switch (foo) { -1| case 0 -> 1; -2| case 1 -> { -3| yield 2; -4| }; -5| default -> 3; -6| } +1| case 0: { } +2| default: { } +3| } < [#1 Insertion delimiter] = " " -[#2 Content] = 1:14-1:16 - >--< -1| case 0 -> 1; - +[#2 Content] = [#2 Removal] = -[#2 Domain] = 1:13-1:16 - >---< -1| case 0 -> 1; +[#2 Domain] = 1:13-1:14 + >-< +1| case 0: { } [#2 Insertion delimiter] = " " -[#3 Content] = 3:8-3:16 - >--------< -3| yield 2; - +[#3 Content] = [#3 Removal] = -[#3 Domain] = 2:15-4:4 - > -2| case 1 -> { -3| yield 2; -4| }; - ----< +[#3 Domain] = 2:14-2:15 + >-< +2| default: { } [#3 Insertion delimiter] = " " - - -[#4 Content] = 5:15-5:17 - >--< -5| default -> 3; - -[#4 Removal] = -[#4 Domain] = 5:14-5:17 - >---< -5| default -> 3; - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope b/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope index db0d61b7cc..a4d31bfb69 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope @@ -2,39 +2,33 @@ switch (foo) { case 0: bar; break; - case 1: { - break; - } default: + bar; break; } --- -[#1 Content] = 1:4-8:14 +[#1 Content] = 1:4-6:14 >------- 1| case 0: 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< [#1 Removal] = -[#1 Domain] = 0:14-9:0 +[#1 Domain] = 0:14-7:0 > 0| switch (foo) { 1| case 0: 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } +4| default: +5| bar; +6| break; +7| } < [#1 Insertion delimiter] = " " @@ -57,30 +51,18 @@ switch (foo) { [#2 Insertion delimiter] = " " -[#3 Content] = 5:8-5:14 - >------< -5| break; +[#3 Content] = 5:8-6:14 + >---- +5| bar; +6| break; + --------------< [#3 Removal] = -[#3 Domain] = 4:13-6:4 - > -4| case 1: { -5| break; -6| } - ----< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = 8:8-8:14 - >------< -8| break; - -[#4 Removal] = -[#4 Domain] = 7:12-8:14 +[#3 Domain] = 4:12-6:14 > -7| default: -8| break; +4| default: +5| bar; +6| break; --------------< -[#4 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.switchCase2.scope b/data/fixtures/scopes/javascript.core/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..7380c0cc2a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +switch (foo) { + case 0: { } + default: { } +} +--- + +[#1 Content] = 1:4-2:16 + >----------- +1| case 0: { } +2| default: { } + ----------------< + +[#1 Removal] = +[#1 Domain] = 0:14-3:0 + > +0| switch (foo) { +1| case 0: { } +2| default: { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:13-1:14 + >-< +1| case 0: { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:14-2:15 + >-< +2| default: { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/javascript.core/name/name.argument.formal.constructor.iteration.scope index 9d07da7665..d347aebdf0 100644 --- a/data/fixtures/scopes/javascript.core/name/name.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/javascript.core/name/name.argument.formal.constructor.iteration.scope @@ -1,5 +1,5 @@ class Foo { - constructor(aaa, bbb) {} + constructor(aaa, bbb = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| constructor(aaa, bbb) {} +1| constructor(aaa, bbb = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| constructor(aaa, bbb) {} +1| constructor(aaa, bbb = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:16-1:24 - >--------< -1| constructor(aaa, bbb) {} +[#3 Domain] = 1:16-1:28 + >------------< +1| constructor(aaa, bbb = 0) {} diff --git a/data/fixtures/scopes/javascript.core/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/javascript.core/name/name.argument.formal.iteration.scope index 0a1c0f6d7f..5b0c1ddbbb 100644 --- a/data/fixtures/scopes/javascript.core/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/javascript.core/name/name.argument.formal.iteration.scope @@ -1,13 +1,13 @@ -function foo(aaa, bbb) {} +function foo(aaa, bbb = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:25 - >-------------------------< -0| function foo(aaa, bbb) {} +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| function foo(aaa, bbb = 0) {} [#2 Content] = -[#2 Domain] = 0:13-0:21 - >--------< -0| function foo(aaa, bbb) {} +[#2 Domain] = 0:13-0:25 + >------------< +0| function foo(aaa, bbb = 0) {} diff --git a/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.iteration.scope index eedb9defeb..a461630c0e 100644 --- a/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.iteration.scope +++ b/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.iteration.scope @@ -1,13 +1,13 @@ -(aaa, bbb) => {} +(aaa, bbb = 0) => {} --- [#1 Content] = -[#1 Domain] = 0:0-0:16 - >----------------< -0| (aaa, bbb) => {} +[#1 Domain] = 0:0-0:20 + >--------------------< +0| (aaa, bbb = 0) => {} [#2 Content] = -[#2 Domain] = 0:1-0:9 - >--------< -0| (aaa, bbb) => {} +[#2 Domain] = 0:1-0:13 + >------------< +0| (aaa, bbb = 0) => {} diff --git a/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.scope b/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.scope index e9109ff898..580abb23bc 100644 --- a/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.scope +++ b/data/fixtures/scopes/javascript.core/name/name.argument.formal.lambda.scope @@ -1,26 +1,33 @@ -(aaa, bbb) => {} +(aaa, bbb = 0) => {} --- [#1 Content] = [#1 Removal] = [#1 Domain] = 0:1-0:4 >---< -0| (aaa, bbb) => {} +0| (aaa, bbb = 0) => {} [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Domain] = 0:6-0:9 +[#2 Content] = 0:6-0:9 >---< -0| (aaa, bbb) => {} +0| (aaa, bbb = 0) => {} -[#2 Removal] = 0:5-0:9 - >----< -0| (aaa, bbb) => {} +[#2 Removal] = 0:6-0:10 + >----< +0| (aaa, bbb = 0) => {} [#2 Leading delimiter] = 0:5-0:6 >-< -0| (aaa, bbb) => {} +0| (aaa, bbb = 0) => {} + +[#2 Trailing delimiter] = 0:9-0:10 + >-< +0| (aaa, bbb = 0) => {} + +[#2 Domain] = 0:6-0:13 + >-------< +0| (aaa, bbb = 0) => {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/javascript.core/name/name.argument.formal.method.iteration.scope index 06175ce515..4f1c653885 100644 --- a/data/fixtures/scopes/javascript.core/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/javascript.core/name/name.argument.formal.method.iteration.scope @@ -1,5 +1,5 @@ class Foo { - bar(aaa, bbb) {} + bar(aaa, bbb = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| bar(aaa, bbb) {} +1| bar(aaa, bbb = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| bar(aaa, bbb) {} +1| bar(aaa, bbb = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:8-1:16 - >--------< -1| bar(aaa, bbb) {} +[#3 Domain] = 1:8-1:20 + >------------< +1| bar(aaa, bbb = 0) {} diff --git a/data/fixtures/scopes/javascript.core/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/javascript.core/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..7dc3e6ccdf --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,13 @@ +(aaa = 0, bbb = 1) => {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:24 + >------------------------< +0| (aaa = 0, bbb = 1) => {} + + +[#2 Content] = +[#2 Domain] = 0:1-0:17 + >----------------< +0| (aaa = 0, bbb = 1) => {} diff --git a/data/fixtures/scopes/javascript.core/value/value.argument.formal.lambda.scope b/data/fixtures/scopes/javascript.core/value/value.argument.formal.lambda.scope new file mode 100644 index 0000000000..0d3abf166a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value/value.argument.formal.lambda.scope @@ -0,0 +1,39 @@ +(aaa = 0, bbb = 1) => {} +--- + +[#1 Content] = 0:7-0:8 + >-< +0| (aaa = 0, bbb = 1) => {} + +[#1 Removal] = 0:4-0:8 + >----< +0| (aaa = 0, bbb = 1) => {} + +[#1 Leading delimiter] = 0:4-0:7 + >---< +0| (aaa = 0, bbb = 1) => {} + +[#1 Domain] = 0:1-0:8 + >-------< +0| (aaa = 0, bbb = 1) => {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:16-0:17 + >-< +0| (aaa = 0, bbb = 1) => {} + +[#2 Removal] = 0:13-0:17 + >----< +0| (aaa = 0, bbb = 1) => {} + +[#2 Leading delimiter] = 0:13-0:16 + >---< +0| (aaa = 0, bbb = 1) => {} + +[#2 Domain] = 0:10-0:17 + >-------< +0| (aaa = 0, bbb = 1) => {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/class.iteration.block.scope b/data/fixtures/scopes/kotlin/class.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/scala/class.iteration.block.scope rename to data/fixtures/scopes/kotlin/class.iteration.class.scope diff --git a/data/fixtures/scopes/kotlin/interior/interior.switchCase.scope b/data/fixtures/scopes/kotlin/interior/interior.switchCase.scope index d9d9833bd0..8787b99602 100644 --- a/data/fixtures/scopes/kotlin/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/kotlin/interior/interior.switchCase.scope @@ -1,87 +1,46 @@ when (foo) { - 0 -> - bar() - 1 -> { - bar() - break - } - else -> bar() + 0 -> bar + else -> bar +} --- -[#1 Content] = 2:8-2:13 - >-----< -2| bar() - -[#1 Removal] = 1:8-2:13 - > -1| 0 -> -2| bar() - -------------< - -[#1 Domain] = 1:4-2:13 - >---- -1| 0 -> -2| bar() - -------------< +[#1 Content] = 1:4-2:15 + >-------- +1| 0 -> bar +2| else -> bar + ---------------< + +[#1 Removal] = +[#1 Domain] = 0:12-3:0 + > +0| when (foo) { +1| 0 -> bar +2| else -> bar +3| } + < [#1 Insertion delimiter] = " " -[#2 Content] = 3:9-6:5 - >- -3| 1 -> { -4| bar() -5| break -6| } - -----< +[#2 Content] = 1:9-1:12 + >---< +1| 0 -> bar -[#2 Removal] = 3:8-6:5 - >-- -3| 1 -> { -4| bar() -5| break -6| } - -----< - -[#2 Domain] = 3:4-6:5 - >------ -3| 1 -> { -4| bar() -5| break -6| } - -----< +[#2 Removal] = +[#2 Domain] = 1:8-1:12 + >----< +1| 0 -> bar [#2 Insertion delimiter] = " " -[#3 Content] = 4:8-5:13 - >----- -4| bar() -5| break - -------------< +[#3 Content] = 2:12-2:15 + >---< +2| else -> bar [#3 Removal] = -[#3 Domain] = 3:10-6:4 - > -3| 1 -> { -4| bar() -5| break -6| } - ----< +[#3 Domain] = 2:11-2:15 + >----< +2| else -> bar [#3 Insertion delimiter] = " " - - -[#4 Content] = 7:12-7:17 - >-----< -7| else -> bar() - -[#4 Removal] = 7:11-7:17 - >------< -7| else -> bar() - -[#4 Domain] = 7:4-7:17 - >-------------< -7| else -> bar() - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/interior/interior.switchCase2.scope b/data/fixtures/scopes/kotlin/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..e52caf32b0 --- /dev/null +++ b/data/fixtures/scopes/kotlin/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +when (foo) { + 0 -> { } + else -> { } +} +--- + +[#1 Content] = 1:4-2:15 + >-------- +1| 0 -> { } +2| else -> { } + ---------------< + +[#1 Removal] = +[#1 Domain] = 0:12-3:0 + > +0| when (foo) { +1| 0 -> { } +2| else -> { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:10-1:11 + >-< +1| 0 -> { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:13-2:14 + >-< +2| else -> { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration.scope index d58138ab5c..305ab120bc 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration.scope @@ -1,5 +1,5 @@ class Foo { - constructor(aaa: Int, bbb: Int) {} + constructor(aaa: Int, bbb: Int = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| constructor(aaa: Int, bbb: Int) {} +1| constructor(aaa: Int, bbb: Int = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| constructor(aaa: Int, bbb: Int) {} +1| constructor(aaa: Int, bbb: Int = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:16-1:34 - >------------------< -1| constructor(aaa: Int, bbb: Int) {} +[#3 Domain] = 1:16-1:38 + >----------------------< +1| constructor(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration2.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration2.scope index 44868ed858..d7fefc6b39 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration2.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.iteration2.scope @@ -1,13 +1,13 @@ -class Foo(aaa: Int, bbb: Int) {} +class Foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:32 - >--------------------------------< -0| class Foo(aaa: Int, bbb: Int) {} +[#1 Domain] = 0:0-0:36 + >------------------------------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} [#2 Content] = -[#2 Domain] = 0:10-0:28 - >------------------< -0| class Foo(aaa: Int, bbb: Int) {} +[#2 Domain] = 0:10-0:32 + >----------------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.scope index 1dac5abd48..4d3730078b 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor.scope @@ -1,5 +1,5 @@ class Foo { - constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} + constructor(aaa: Int, bbb: Int = 0) {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| constructor(aaa: Int, bbb: Int = 0) {} 2| } -< @@ -32,15 +32,15 @@ class Foo { [#2 Content] = [#2 Removal] = 1:4-1:15 >-----------< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| constructor(aaa: Int, bbb: Int = 0) {} [#2 Leading delimiter] = 1:0-1:4 >----< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| constructor(aaa: Int, bbb: Int = 0) {} -[#2 Domain] = 1:4-1:80 - >----------------------------------------------------------------------------< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Domain] = 1:4-1:42 + >--------------------------------------< +1| constructor(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " @@ -48,67 +48,29 @@ class Foo { [#3 Content] = [#3 Removal] = 1:16-1:19 >---< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| constructor(aaa: Int, bbb: Int = 0) {} [#3 Domain] = 1:16-1:24 >--------< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| constructor(aaa: Int, bbb: Int = 0) {} [#3 Insertion delimiter] = " " -[#4 Content] = 1:33-1:36 - >---< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Content] = 1:26-1:29 + >---< +1| constructor(aaa: Int, bbb: Int = 0) {} -[#4 Removal] = 1:32-1:36 - >----< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Removal] = 1:25-1:29 + >----< +1| constructor(aaa: Int, bbb: Int = 0) {} -[#4 Leading delimiter] = 1:32-1:33 - >-< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Leading delimiter] = 1:25-1:26 + >-< +1| constructor(aaa: Int, bbb: Int = 0) {} -[#4 Domain] = 1:26-1:41 - >---------------< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Domain] = 1:26-1:38 + >------------< +1| constructor(aaa: Int, bbb: Int = 0) {} [#4 Insertion delimiter] = " " - - -[#5 Content] = 1:43-1:46 - >---< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Removal] = 1:42-1:46 - >----< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Leading delimiter] = 1:42-1:43 - >-< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Domain] = 1:43-1:55 - >------------< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 1:64-1:67 - >---< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Removal] = 1:63-1:67 - >----< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Leading delimiter] = 1:63-1:64 - >-< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Domain] = 1:57-1:76 - >-------------------< -1| constructor(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor2.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor2.scope index 6e764d4197..a0e8249e0f 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor2.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor2.scope @@ -1,86 +1,83 @@ -class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +class Foo { + constructor(vararg aaa: Int, vararg bbb: Int = 1) {} +} --- -[#1 Content] = -[#1 Removal] = 0:6-0:9 +[#1 Content] = 0:6-0:9 >---< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| class Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { [#1 Leading delimiter] = 0:5-0:6 >-< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| class Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { -[#1 Domain] = 0:0-0:74 - >--------------------------------------------------------------------------< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} +2| } + -< [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:10-0:13 - >---< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Removal] = 1:4-1:15 + >-----------< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#2 Domain] = 0:10-0:18 - >--------< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Domain] = 1:4-1:56 + >----------------------------------------------------< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} [#2 Insertion delimiter] = " " -[#3 Content] = 0:27-0:30 - >---< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Content] = 1:23-1:26 + >---< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#3 Removal] = 0:26-0:30 - >----< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Removal] = 1:22-1:26 + >----< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#3 Leading delimiter] = 0:26-0:27 - >-< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Leading delimiter] = 1:22-1:23 + >-< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#3 Domain] = 0:20-0:35 - >---------------< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Domain] = 1:16-1:31 + >---------------< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} [#3 Insertion delimiter] = " " -[#4 Content] = 0:37-0:40 - >---< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Content] = 1:40-1:43 + >---< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#4 Removal] = 0:36-0:40 - >----< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Removal] = 1:39-1:43 + >----< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#4 Leading delimiter] = 0:36-0:37 - >-< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Leading delimiter] = 1:39-1:40 + >-< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} -[#4 Domain] = 0:37-0:49 - >------------< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Domain] = 1:33-1:52 + >-------------------< +1| constructor(vararg aaa: Int, vararg bbb: Int = 1) {} [#4 Insertion delimiter] = " " - - -[#5 Content] = 0:58-0:61 - >---< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Removal] = 0:57-0:61 - >----< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Leading delimiter] = 0:57-0:58 - >-< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Domain] = 0:51-0:70 - >-------------------< -0| class Foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor3.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor3.scope new file mode 100644 index 0000000000..5d9e8eff09 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor3.scope @@ -0,0 +1,48 @@ +class Foo(aaa: Int, bbb: Int = 0) {} +--- + +[#1 Content] = +[#1 Removal] = 0:6-0:9 + >---< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#1 Domain] = 0:0-0:36 + >------------------------------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:10-0:13 + >---< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#2 Domain] = 0:10-0:18 + >--------< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:20-0:23 + >---< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#3 Removal] = 0:19-0:23 + >----< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#3 Leading delimiter] = 0:19-0:20 + >-< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#3 Domain] = 0:20-0:32 + >------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor4.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor4.scope new file mode 100644 index 0000000000..cefc290751 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.constructor4.scope @@ -0,0 +1,55 @@ +class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} +--- + +[#1 Content] = +[#1 Removal] = 0:6-0:9 + >---< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#1 Domain] = 0:0-0:50 + >--------------------------------------------------< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:17-0:20 + >---< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#2 Removal] = 0:16-0:20 + >----< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#2 Leading delimiter] = 0:16-0:17 + >-< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#2 Domain] = 0:10-0:25 + >---------------< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:34-0:37 + >---< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#3 Removal] = 0:33-0:37 + >----< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#3 Leading delimiter] = 0:33-0:34 + >-< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#3 Domain] = 0:27-0:46 + >-------------------< +0| class Foo(vararg aaa: Int, vararg bbb: Int = 1) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.iteration.scope index bfafcabc7e..891ecd9ee8 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.iteration.scope @@ -1,13 +1,13 @@ -fun foo(aaa: Int, bbb: Int) {} +fun foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:30 - >------------------------------< -0| fun foo(aaa: Int, bbb: Int) {} +[#1 Domain] = 0:0-0:34 + >----------------------------------< +0| fun foo(aaa: Int, bbb: Int = 0) {} [#2 Content] = -[#2 Domain] = 0:8-0:26 - >------------------< -0| fun foo(aaa: Int, bbb: Int) {} +[#2 Domain] = 0:8-0:30 + >----------------------< +0| fun foo(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.method.iteration.scope index d4b45da11e..d5f5c1779f 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.method.iteration.scope @@ -1,5 +1,5 @@ class Foo { - fun bar(aaa: Int, bbb: Int) {} + fun bar(aaa: Int, bbb: Int = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| fun bar(aaa: Int, bbb: Int) {} +1| fun bar(aaa: Int, bbb: Int = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| fun bar(aaa: Int, bbb: Int) {} +1| fun bar(aaa: Int, bbb: Int = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:12-1:30 - >------------------< -1| fun bar(aaa: Int, bbb: Int) {} +[#3 Domain] = 1:12-1:34 + >----------------------< +1| fun bar(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.method.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.method.scope index dabfb505d8..fee51e0c87 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.method.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.method.scope @@ -1,5 +1,5 @@ class Foo { - fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} + fun foo(aaa: Int, bbb: Int = 0) {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| fun foo(aaa: Int, bbb: Int = 0) {} 2| } -< @@ -32,15 +32,15 @@ class Foo { [#2 Content] = [#2 Removal] = 1:8-1:11 >---< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| fun foo(aaa: Int, bbb: Int = 0) {} [#2 Leading delimiter] = 1:7-1:8 >-< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| fun foo(aaa: Int, bbb: Int = 0) {} -[#2 Domain] = 1:4-1:76 - >------------------------------------------------------------------------< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Domain] = 1:4-1:38 + >----------------------------------< +1| fun foo(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " @@ -48,67 +48,29 @@ class Foo { [#3 Content] = [#3 Removal] = 1:12-1:15 >---< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| fun foo(aaa: Int, bbb: Int = 0) {} [#3 Domain] = 1:12-1:20 >--------< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +1| fun foo(aaa: Int, bbb: Int = 0) {} [#3 Insertion delimiter] = " " -[#4 Content] = 1:29-1:32 - >---< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Content] = 1:22-1:25 + >---< +1| fun foo(aaa: Int, bbb: Int = 0) {} -[#4 Removal] = 1:28-1:32 - >----< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Removal] = 1:21-1:25 + >----< +1| fun foo(aaa: Int, bbb: Int = 0) {} -[#4 Leading delimiter] = 1:28-1:29 - >-< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Leading delimiter] = 1:21-1:22 + >-< +1| fun foo(aaa: Int, bbb: Int = 0) {} -[#4 Domain] = 1:22-1:37 - >---------------< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#4 Domain] = 1:22-1:34 + >------------< +1| fun foo(aaa: Int, bbb: Int = 0) {} [#4 Insertion delimiter] = " " - - -[#5 Content] = 1:39-1:42 - >---< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Removal] = 1:38-1:42 - >----< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Leading delimiter] = 1:38-1:39 - >-< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Domain] = 1:39-1:51 - >------------< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 1:60-1:63 - >---< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Removal] = 1:59-1:63 - >----< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Leading delimiter] = 1:59-1:60 - >-< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Domain] = 1:53-1:72 - >-------------------< -1| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#6 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.method2.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.method2.scope index e8f6cdbfa9..3cfac710db 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.method2.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.method2.scope @@ -1,5 +1,5 @@ class Foo { - set(aaa: Int) {} + fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| set(aaa: Int) {} +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} 2| } -< @@ -32,10 +32,52 @@ class Foo { [#2 Content] = [#2 Removal] = 1:8-1:11 >---< -1| set(aaa: Int) {} +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} -[#2 Domain] = 1:8-1:16 - >--------< -1| set(aaa: Int) {} +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Domain] = 1:4-1:52 + >------------------------------------------------< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} [#2 Insertion delimiter] = " " + + +[#3 Content] = 1:19-1:22 + >---< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Removal] = 1:18-1:22 + >----< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Leading delimiter] = 1:18-1:19 + >-< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Domain] = 1:12-1:27 + >---------------< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 1:36-1:39 + >---< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#4 Removal] = 1:35-1:39 + >----< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#4 Leading delimiter] = 1:35-1:36 + >-< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#4 Domain] = 1:29-1:48 + >-------------------< +1| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.method3.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.method3.scope new file mode 100644 index 0000000000..e8f6cdbfa9 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.method3.scope @@ -0,0 +1,41 @@ +class Foo { + set(aaa: Int) {} +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| class Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { + +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| set(aaa: Int) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:8-1:11 + >---< +1| set(aaa: Int) {} + +[#2 Domain] = 1:8-1:16 + >--------< +1| set(aaa: Int) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal.scope index e76cbdf9d1..5af10a94eb 100644 --- a/data/fixtures/scopes/kotlin/name/name.argument.formal.scope +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal.scope @@ -1,18 +1,18 @@ -fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +fun foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = [#1 Removal] = 0:4-0:7 >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#1 Leading delimiter] = 0:3-0:4 >-< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#1 Domain] = 0:0-0:72 - >------------------------------------------------------------------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#1 Domain] = 0:0-0:34 + >----------------------------------< +0| fun foo(aaa: Int, bbb: Int = 0) {} [#1 Insertion delimiter] = " " @@ -20,67 +20,29 @@ fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} [#2 Content] = [#2 Removal] = 0:8-0:11 >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#2 Domain] = 0:8-0:16 >--------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " -[#3 Content] = 0:25-0:28 - >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Content] = 0:18-0:21 + >---< +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#3 Removal] = 0:24-0:28 - >----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Removal] = 0:17-0:21 + >----< +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#3 Leading delimiter] = 0:24-0:25 - >-< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Leading delimiter] = 0:17-0:18 + >-< +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#3 Domain] = 0:18-0:33 - >---------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#3 Domain] = 0:18-0:30 + >------------< +0| fun foo(aaa: Int, bbb: Int = 0) {} [#3 Insertion delimiter] = " " - - -[#4 Content] = 0:35-0:38 - >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Removal] = 0:34-0:38 - >----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Leading delimiter] = 0:34-0:35 - >-< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Domain] = 0:35-0:47 - >------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Insertion delimiter] = " " - - -[#5 Content] = 0:56-0:59 - >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Removal] = 0:55-0:59 - >----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Leading delimiter] = 0:55-0:56 - >-< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Domain] = 0:49-0:68 - >-------------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.argument.formal2.scope b/data/fixtures/scopes/kotlin/name/name.argument.formal2.scope new file mode 100644 index 0000000000..e747ea7fd8 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.argument.formal2.scope @@ -0,0 +1,55 @@ +fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} +--- + +[#1 Content] = +[#1 Removal] = 0:4-0:7 + >---< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Leading delimiter] = 0:3-0:4 + >-< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Domain] = 0:0-0:48 + >------------------------------------------------< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:15-0:18 + >---< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Removal] = 0:14-0:18 + >----< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Leading delimiter] = 0:14-0:15 + >-< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Domain] = 0:8-0:23 + >---------------< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:32-0:35 + >---< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Removal] = 0:31-0:35 + >----< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Leading delimiter] = 0:31-0:32 + >-< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Domain] = 0:25-0:44 + >-------------------< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/latex/list.scope b/data/fixtures/scopes/latex/list.scope index d59e812055..6b1dcbf6c5 100644 --- a/data/fixtures/scopes/latex/list.scope +++ b/data/fixtures/scopes/latex/list.scope @@ -1,6 +1,6 @@ \begin{itemize} - \item one - \item two + \item aaa + \item bbb \end{itemize} --- @@ -9,8 +9,8 @@ [Domain] = 0:0-3:13 >--------------- 0| \begin{itemize} -1| \item one -2| \item two +1| \item aaa +2| \item bbb 3| \end{itemize} -------------< diff --git a/data/fixtures/scopes/lua/list.scope b/data/fixtures/scopes/lua/list.scope index 33d894016e..6b148aee80 100644 --- a/data/fixtures/scopes/lua/list.scope +++ b/data/fixtures/scopes/lua/list.scope @@ -1,10 +1,10 @@ -{ 1, 2, 3 } +{aaa, bbb} --- [Content] = [Removal] = -[Domain] = 0:0-0:11 - >-----------< -0| { 1, 2, 3 } +[Domain] = 0:0-0:10 + >----------< +0| {aaa, bbb} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/class.iteration.class.scope b/data/fixtures/scopes/python/class.iteration.class.scope new file mode 100644 index 0000000000..0d7bd00dfa --- /dev/null +++ b/data/fixtures/scopes/python/class.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo: pass +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:15 + >---------------< +0| class Foo: pass + + +[#2 Content] = +[#2 Domain] = 0:10-0:15 + >-----< +0| class Foo: pass diff --git a/data/fixtures/scopes/python/class.iteration.document.scope b/data/fixtures/scopes/python/class.iteration.document.scope index 23774e47c6..1498dc9e09 100644 --- a/data/fixtures/scopes/python/class.iteration.document.scope +++ b/data/fixtures/scopes/python/class.iteration.document.scope @@ -1,14 +1,18 @@ -class Foo: - pass +class Foo: pass --- -[Content] = -[Domain] = 0:0-3:0 +[#1 Content] = +[#1 Domain] = 0:0-2:0 > 0| -1| class Foo: -2| pass -3| +1| class Foo: pass +2| < + + +[#2 Content] = +[#2 Domain] = 1:10-1:15 + >-----< +1| class Foo: pass diff --git a/data/fixtures/scopes/python/interior/interior.switch.scope b/data/fixtures/scopes/python/interior/interior.switch.scope index 584110fc82..b5e20c0263 100644 --- a/data/fixtures/scopes/python/interior/interior.switch.scope +++ b/data/fixtures/scopes/python/interior/interior.switch.scope @@ -1,28 +1,16 @@ match value: - case 0: pass + pass --- -[#1 Content] = 1:4-1:16 - >------------< -1| case 0: pass +[Content] = 1:4-1:8 + >----< +1| pass -[#1 Removal] = -[#1 Domain] = 0:12-1:16 +[Removal] = +[Domain] = 0:12-1:8 > 0| match value: -1| case 0: pass - ----------------< +1| pass + --------< -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:12-1:16 - >----< -1| case 0: pass - -[#2 Removal] = -[#2 Domain] = 1:11-1:16 - >-----< -1| case 0: pass - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.switchCase.scope b/data/fixtures/scopes/python/interior/interior.switchCase.scope index d915b94297..c570ff9197 100644 --- a/data/fixtures/scopes/python/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/python/interior/interior.switchCase.scope @@ -1,60 +1,66 @@ match foo: case 0: bar - pass + baz case _: - pass + bar + baz --- -[#1 Content] = 1:4-5:12 +[#1 Content] = 1:4-6:11 >------- 1| case 0: 2| bar -3| pass +3| baz 4| case _: -5| pass - ------------< +5| bar +6| baz + -----------< [#1 Removal] = -[#1 Domain] = 0:10-5:12 +[#1 Domain] = 0:10-6:11 > 0| match foo: 1| case 0: 2| bar -3| pass +3| baz 4| case _: -5| pass - ------------< +5| bar +6| baz + -----------< [#1 Insertion delimiter] = " " -[#2 Content] = 2:8-3:12 +[#2 Content] = 2:8-3:11 >--- 2| bar -3| pass - ------------< +3| baz + -----------< [#2 Removal] = -[#2 Domain] = 1:11-3:12 +[#2 Domain] = 1:11-3:11 > 1| case 0: 2| bar -3| pass - ------------< +3| baz + -----------< [#2 Insertion delimiter] = " " -[#3 Content] = 5:8-5:12 - >----< -5| pass +[#3 Content] = 5:8-6:11 + >--- +5| bar +6| baz + -----------< [#3 Removal] = -[#3 Domain] = 4:11-5:12 +[#3 Domain] = 4:11-6:11 > 4| case _: -5| pass - ------------< +5| bar +6| baz + -----------< [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/list2.scope b/data/fixtures/scopes/python/list2.scope new file mode 100644 index 0000000000..d886cb3aa2 --- /dev/null +++ b/data/fixtures/scopes/python/list2.scope @@ -0,0 +1,10 @@ +[aaa for i in bbb] +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| [aaa for i in bbb] + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/list3.scope b/data/fixtures/scopes/python/list3.scope new file mode 100644 index 0000000000..6b148aee80 --- /dev/null +++ b/data/fixtures/scopes/python/list3.scope @@ -0,0 +1,10 @@ +{aaa, bbb} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:10 + >----------< +0| {aaa, bbb} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/list4.scope b/data/fixtures/scopes/python/list4.scope new file mode 100644 index 0000000000..b52121c4e6 --- /dev/null +++ b/data/fixtures/scopes/python/list4.scope @@ -0,0 +1,10 @@ +{aaa for i in bbb} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| {aaa for i in bbb} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/list5.scope b/data/fixtures/scopes/python/list5.scope new file mode 100644 index 0000000000..61420bcff5 --- /dev/null +++ b/data/fixtures/scopes/python/list5.scope @@ -0,0 +1,10 @@ +(aaa, bbb) +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:10 + >----------< +0| (aaa, bbb) + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/python/name/name.argument.formal.constructor.iteration.scope index 36081af4ef..1f11d834a4 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.constructor.iteration.scope @@ -1,28 +1,28 @@ class Foo: - def __init__(self, aaa: int, bbb: int): pass + def __init__(self, aaa: int, bbb: int = 0): pass --- [#1 Content] = -[#1 Domain] = 0:0-1:48 +[#1 Domain] = 0:0-1:52 >---------- 0| class Foo: -1| def __init__(self, aaa: int, bbb: int): pass - ------------------------------------------------< +1| def __init__(self, aaa: int, bbb: int = 0): pass + ----------------------------------------------------< [#2 Content] = -[#2 Domain] = 1:4-1:48 - >--------------------------------------------< -1| def __init__(self, aaa: int, bbb: int): pass +[#2 Domain] = 1:4-1:52 + >------------------------------------------------< +1| def __init__(self, aaa: int, bbb: int = 0): pass [#3 Content] = -[#3 Domain] = 1:17-1:41 - >------------------------< -1| def __init__(self, aaa: int, bbb: int): pass +[#3 Domain] = 1:17-1:45 + >----------------------------< +1| def __init__(self, aaa: int, bbb: int = 0): pass [#4 Content] = -[#4 Domain] = 1:44-1:48 - >----< -1| def __init__(self, aaa: int, bbb: int): pass +[#4 Domain] = 1:48-1:52 + >----< +1| def __init__(self, aaa: int, bbb: int = 0): pass diff --git a/data/fixtures/scopes/python/name/name.argument.formal.constructor.scope b/data/fixtures/scopes/python/name/name.argument.formal.constructor.scope index 369b69c3d3..84c5293ede 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.constructor.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.constructor.scope @@ -1,5 +1,5 @@ class Foo: - def __init__(self, aaa: int, bbb: int): pass + def __init__(self, aaa: int, bbb: int = 0): pass --- [#1 Content] = 0:6-0:9 @@ -14,11 +14,11 @@ class Foo: >-< 0| class Foo: -[#1 Domain] = 0:0-1:48 +[#1 Domain] = 0:0-1:52 >---------- 0| class Foo: -1| def __init__(self, aaa: int, bbb: int): pass - ------------------------------------------------< +1| def __init__(self, aaa: int, bbb: int = 0): pass + ----------------------------------------------------< [#1 Insertion delimiter] = " " @@ -26,15 +26,15 @@ class Foo: [#2 Content] = [#2 Removal] = 1:8-1:16 >--------< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#2 Leading delimiter] = 1:7-1:8 >-< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass -[#2 Domain] = 1:4-1:48 - >--------------------------------------------< -1| def __init__(self, aaa: int, bbb: int): pass +[#2 Domain] = 1:4-1:52 + >------------------------------------------------< +1| def __init__(self, aaa: int, bbb: int = 0): pass [#2 Insertion delimiter] = " " @@ -43,44 +43,44 @@ class Foo: [#3 Removal] = [#3 Domain] = 1:17-1:21 >----< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#3 Insertion delimiter] = " " [#4 Content] = 1:23-1:26 >---< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#4 Removal] = 1:22-1:26 >----< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#4 Leading delimiter] = 1:22-1:23 >-< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#4 Domain] = 1:23-1:31 >--------< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#4 Insertion delimiter] = " " [#5 Content] = 1:33-1:36 >---< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#5 Removal] = 1:32-1:36 >----< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass [#5 Leading delimiter] = 1:32-1:33 >-< -1| def __init__(self, aaa: int, bbb: int): pass +1| def __init__(self, aaa: int, bbb: int = 0): pass -[#5 Domain] = 1:33-1:41 - >--------< -1| def __init__(self, aaa: int, bbb: int): pass +[#5 Domain] = 1:33-1:45 + >------------< +1| def __init__(self, aaa: int, bbb: int = 0): pass [#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/python/name/name.argument.formal.iteration.scope index f98647c74a..b688f0f999 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.iteration.scope @@ -1,19 +1,19 @@ -def bar(aaa: int, bbb: int): pass +def bar(aaa: int, bbb: int = 0): pass --- [#1 Content] = -[#1 Domain] = 0:0-0:33 - >---------------------------------< -0| def bar(aaa: int, bbb: int): pass +[#1 Domain] = 0:0-0:37 + >-------------------------------------< +0| def bar(aaa: int, bbb: int = 0): pass [#2 Content] = -[#2 Domain] = 0:8-0:26 - >------------------< -0| def bar(aaa: int, bbb: int): pass +[#2 Domain] = 0:8-0:30 + >----------------------< +0| def bar(aaa: int, bbb: int = 0): pass [#3 Content] = -[#3 Domain] = 0:29-0:33 - >----< -0| def bar(aaa: int, bbb: int): pass +[#3 Domain] = 0:33-0:37 + >----< +0| def bar(aaa: int, bbb: int = 0): pass diff --git a/data/fixtures/scopes/python/name/name.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/python/name/name.argument.formal.lambda.iteration.scope index a0dc96a0f5..89747c2402 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.lambda.iteration.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.lambda.iteration.scope @@ -1,13 +1,13 @@ -lambda aaa, bbb: pass +lambda aaa, bbb = 0: pass --- [#1 Content] = -[#1 Domain] = 0:0-0:21 - >---------------------< -0| lambda aaa, bbb: pass +[#1 Domain] = 0:0-0:25 + >-------------------------< +0| lambda aaa, bbb = 0: pass [#2 Content] = -[#2 Domain] = 0:7-0:15 - >--------< -0| lambda aaa, bbb: pass +[#2 Domain] = 0:7-0:19 + >------------< +0| lambda aaa, bbb = 0: pass diff --git a/data/fixtures/scopes/python/name/name.argument.formal.lambda.scope b/data/fixtures/scopes/python/name/name.argument.formal.lambda.scope index 92d95b6b02..d4d2105b6b 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.lambda.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.lambda.scope @@ -1,33 +1,40 @@ -lambda aaa, bbb: pass +lambda aaa, bbb = 0: pass --- [#1 Content] = [#1 Domain] = 0:7-0:10 >---< -0| lambda aaa, bbb: pass +0| lambda aaa, bbb = 0: pass [#1 Removal] = 0:6-0:10 >----< -0| lambda aaa, bbb: pass +0| lambda aaa, bbb = 0: pass [#1 Leading delimiter] = 0:6-0:7 >-< -0| lambda aaa, bbb: pass +0| lambda aaa, bbb = 0: pass [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Domain] = 0:12-0:15 +[#2 Content] = 0:12-0:15 >---< -0| lambda aaa, bbb: pass +0| lambda aaa, bbb = 0: pass -[#2 Removal] = 0:11-0:15 - >----< -0| lambda aaa, bbb: pass +[#2 Removal] = 0:12-0:16 + >----< +0| lambda aaa, bbb = 0: pass [#2 Leading delimiter] = 0:11-0:12 >-< -0| lambda aaa, bbb: pass +0| lambda aaa, bbb = 0: pass + +[#2 Trailing delimiter] = 0:15-0:16 + >-< +0| lambda aaa, bbb = 0: pass + +[#2 Domain] = 0:12-0:19 + >-------< +0| lambda aaa, bbb = 0: pass [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/python/name/name.argument.formal.method.iteration.scope index 343ab37437..2925b7d581 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.method.iteration.scope @@ -1,28 +1,28 @@ class Foo: - def bar(aaa: int, bbb: int): pass + def bar(aaa: int, bbb: int = 0): pass --- [#1 Content] = -[#1 Domain] = 0:0-1:37 +[#1 Domain] = 0:0-1:41 >---------- 0| class Foo: -1| def bar(aaa: int, bbb: int): pass - -------------------------------------< +1| def bar(aaa: int, bbb: int = 0): pass + -----------------------------------------< [#2 Content] = -[#2 Domain] = 1:4-1:37 - >---------------------------------< -1| def bar(aaa: int, bbb: int): pass +[#2 Domain] = 1:4-1:41 + >-------------------------------------< +1| def bar(aaa: int, bbb: int = 0): pass [#3 Content] = -[#3 Domain] = 1:12-1:30 - >------------------< -1| def bar(aaa: int, bbb: int): pass +[#3 Domain] = 1:12-1:34 + >----------------------< +1| def bar(aaa: int, bbb: int = 0): pass [#4 Content] = -[#4 Domain] = 1:33-1:37 - >----< -1| def bar(aaa: int, bbb: int): pass +[#4 Domain] = 1:37-1:41 + >----< +1| def bar(aaa: int, bbb: int = 0): pass diff --git a/data/fixtures/scopes/python/name/name.argument.formal.method.scope b/data/fixtures/scopes/python/name/name.argument.formal.method.scope index eeea94b286..43e64baa4c 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.method.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.method.scope @@ -1,5 +1,5 @@ class Foo: - def bar(aaa: int, bbb: int): pass + def bar(aaa: int, bbb: int = 0): pass --- [#1 Content] = 0:6-0:9 @@ -14,11 +14,11 @@ class Foo: >-< 0| class Foo: -[#1 Domain] = 0:0-1:37 +[#1 Domain] = 0:0-1:41 >---------- 0| class Foo: -1| def bar(aaa: int, bbb: int): pass - -------------------------------------< +1| def bar(aaa: int, bbb: int = 0): pass + -----------------------------------------< [#1 Insertion delimiter] = " " @@ -26,15 +26,15 @@ class Foo: [#2 Content] = [#2 Removal] = 1:8-1:11 >---< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass [#2 Leading delimiter] = 1:7-1:8 >-< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass -[#2 Domain] = 1:4-1:37 - >---------------------------------< -1| def bar(aaa: int, bbb: int): pass +[#2 Domain] = 1:4-1:41 + >-------------------------------------< +1| def bar(aaa: int, bbb: int = 0): pass [#2 Insertion delimiter] = " " @@ -42,29 +42,29 @@ class Foo: [#3 Content] = [#3 Removal] = 1:12-1:15 >---< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass [#3 Domain] = 1:12-1:20 >--------< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass [#3 Insertion delimiter] = " " [#4 Content] = 1:22-1:25 >---< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass [#4 Removal] = 1:21-1:25 >----< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass [#4 Leading delimiter] = 1:21-1:22 >-< -1| def bar(aaa: int, bbb: int): pass +1| def bar(aaa: int, bbb: int = 0): pass -[#4 Domain] = 1:22-1:30 - >--------< -1| def bar(aaa: int, bbb: int): pass +[#4 Domain] = 1:22-1:34 + >------------< +1| def bar(aaa: int, bbb: int = 0): pass [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.argument.formal.scope b/data/fixtures/scopes/python/name/name.argument.formal.scope index 0a421e5927..ef9e54746c 100644 --- a/data/fixtures/scopes/python/name/name.argument.formal.scope +++ b/data/fixtures/scopes/python/name/name.argument.formal.scope @@ -1,18 +1,18 @@ -def foo(aaa: int, bbb: int): pass +def foo(aaa: int, bbb: int = 0): pass --- [#1 Content] = [#1 Removal] = 0:4-0:7 >---< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass [#1 Leading delimiter] = 0:3-0:4 >-< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass -[#1 Domain] = 0:0-0:33 - >---------------------------------< -0| def foo(aaa: int, bbb: int): pass +[#1 Domain] = 0:0-0:37 + >-------------------------------------< +0| def foo(aaa: int, bbb: int = 0): pass [#1 Insertion delimiter] = " " @@ -20,29 +20,29 @@ def foo(aaa: int, bbb: int): pass [#2 Content] = [#2 Removal] = 0:8-0:11 >---< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass [#2 Domain] = 0:8-0:16 >--------< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass [#2 Insertion delimiter] = " " [#3 Content] = 0:18-0:21 >---< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass [#3 Removal] = 0:17-0:21 >----< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass [#3 Leading delimiter] = 0:17-0:18 >-< -0| def foo(aaa: int, bbb: int): pass +0| def foo(aaa: int, bbb: int = 0): pass -[#3 Domain] = 0:18-0:26 - >--------< -0| def foo(aaa: int, bbb: int): pass +[#3 Domain] = 0:18-0:30 + >------------< +0| def foo(aaa: int, bbb: int = 0): pass [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/python/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..be5a27e379 --- /dev/null +++ b/data/fixtures/scopes/python/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,13 @@ +lambda aaa = 0, bbb = 1: pass +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| lambda aaa = 0, bbb = 1: pass + + +[#2 Content] = +[#2 Domain] = 0:7-0:23 + >----------------< +0| lambda aaa = 0, bbb = 1: pass diff --git a/data/fixtures/scopes/python/value/value.argument.formal.lambda.scope b/data/fixtures/scopes/python/value/value.argument.formal.lambda.scope new file mode 100644 index 0000000000..0cf9149abf --- /dev/null +++ b/data/fixtures/scopes/python/value/value.argument.formal.lambda.scope @@ -0,0 +1,39 @@ +lambda aaa = 0, bbb = 1: +--- + +[#1 Content] = 0:13-0:14 + >-< +0| lambda aaa = 0, bbb = 1: + +[#1 Removal] = 0:10-0:14 + >----< +0| lambda aaa = 0, bbb = 1: + +[#1 Leading delimiter] = 0:10-0:13 + >---< +0| lambda aaa = 0, bbb = 1: + +[#1 Domain] = 0:7-0:14 + >-------< +0| lambda aaa = 0, bbb = 1: + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:22-0:23 + >-< +0| lambda aaa = 0, bbb = 1: + +[#2 Removal] = 0:19-0:23 + >----< +0| lambda aaa = 0, bbb = 1: + +[#2 Leading delimiter] = 0:19-0:22 + >---< +0| lambda aaa = 0, bbb = 1: + +[#2 Domain] = 0:16-0:23 + >-------< +0| lambda aaa = 0, bbb = 1: + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/interior/interior.switchCase.scope b/data/fixtures/scopes/r/interior/interior.switchCase.scope index 8ed16096cd..3c002deee3 100644 --- a/data/fixtures/scopes/r/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/r/interior/interior.switchCase.scope @@ -1,9 +1,6 @@ switch(foo, a = bar, - b = { - baz - }, - "_" + "_" = bar ) --- @@ -19,16 +16,13 @@ switch(foo, [#1 Insertion delimiter] = " " -[#2 Content] = 3:8-3:11 - >---< -3| baz +[#2 Content] = 2:10-2:13 + >---< +2| "_" = bar [#2 Removal] = -[#2 Domain] = 2:9-4:4 - > -2| b = { -3| baz -4| }, - ----< +[#2 Domain] = 2:9-2:13 + >----< +2| "_" = bar [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/interior/interior.switchCase2.scope b/data/fixtures/scopes/r/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..b66ce7ab51 --- /dev/null +++ b/data/fixtures/scopes/r/interior/interior.switchCase2.scope @@ -0,0 +1,22 @@ +switch(foo, + a = { }, + "_" = { } +) +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 1:9-1:10 + >-< +1| a = { }, + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 2:11-2:12 + >-< +2| "_" = { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/list.scope b/data/fixtures/scopes/r/list.scope index b52f10a913..59f91ed404 100644 --- a/data/fixtures/scopes/r/list.scope +++ b/data/fixtures/scopes/r/list.scope @@ -1,10 +1,10 @@ -list(1, 2, 3) +list(aaa, bbb) --- [Content] = [Removal] = -[Domain] = 0:0-0:13 - >-------------< -0| list(1, 2, 3) +[Domain] = 0:0-0:14 + >--------------< +0| list(aaa, bbb) [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/r/name/name.argument.formal.iteration.scope index 1a73d43ddb..d7c286fb96 100644 --- a/data/fixtures/scopes/r/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/r/name/name.argument.formal.iteration.scope @@ -1,13 +1,13 @@ -function(aaa, bbb) {} +function(aaa, bbb = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:21 - >---------------------< -0| function(aaa, bbb) {} +[#1 Domain] = 0:0-0:25 + >-------------------------< +0| function(aaa, bbb = 0) {} [#2 Content] = -[#2 Domain] = 0:9-0:17 - >--------< -0| function(aaa, bbb) {} +[#2 Domain] = 0:9-0:21 + >------------< +0| function(aaa, bbb = 0) {} diff --git a/data/fixtures/scopes/r/name/name.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/r/name/name.argument.formal.lambda.iteration.scope index 1a73d43ddb..d7c286fb96 100644 --- a/data/fixtures/scopes/r/name/name.argument.formal.lambda.iteration.scope +++ b/data/fixtures/scopes/r/name/name.argument.formal.lambda.iteration.scope @@ -1,13 +1,13 @@ -function(aaa, bbb) {} +function(aaa, bbb = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:21 - >---------------------< -0| function(aaa, bbb) {} +[#1 Domain] = 0:0-0:25 + >-------------------------< +0| function(aaa, bbb = 0) {} [#2 Content] = -[#2 Domain] = 0:9-0:17 - >--------< -0| function(aaa, bbb) {} +[#2 Domain] = 0:9-0:21 + >------------< +0| function(aaa, bbb = 0) {} diff --git a/data/fixtures/scopes/r/name/name.argument.formal.lambda.scope b/data/fixtures/scopes/r/name/name.argument.formal.lambda.scope index 0e4fa3baae..e96adb9f1e 100644 --- a/data/fixtures/scopes/r/name/name.argument.formal.lambda.scope +++ b/data/fixtures/scopes/r/name/name.argument.formal.lambda.scope @@ -1,26 +1,29 @@ -function(aaa, bbb) {} +function(aaa, bbb = 0) {} --- [#1 Content] = [#1 Removal] = [#1 Domain] = 0:9-0:12 >---< -0| function(aaa, bbb) {} +0| function(aaa, bbb = 0) {} [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Domain] = 0:14-0:17 +[#2 Content] = 0:14-0:17 >---< -0| function(aaa, bbb) {} +0| function(aaa, bbb = 0) {} -[#2 Removal] = 0:13-0:17 - >----< -0| function(aaa, bbb) {} +[#2 Removal] = 0:14-0:20 + >------< +0| function(aaa, bbb = 0) {} -[#2 Leading delimiter] = 0:13-0:14 - >-< -0| function(aaa, bbb) {} +[#2 Trailing delimiter] = 0:17-0:20 + >---< +0| function(aaa, bbb = 0) {} + +[#2 Domain] = 0:14-0:21 + >-------< +0| function(aaa, bbb = 0) {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/name/name.argument.formal.scope b/data/fixtures/scopes/r/name/name.argument.formal.scope index 0e4fa3baae..e96adb9f1e 100644 --- a/data/fixtures/scopes/r/name/name.argument.formal.scope +++ b/data/fixtures/scopes/r/name/name.argument.formal.scope @@ -1,26 +1,29 @@ -function(aaa, bbb) {} +function(aaa, bbb = 0) {} --- [#1 Content] = [#1 Removal] = [#1 Domain] = 0:9-0:12 >---< -0| function(aaa, bbb) {} +0| function(aaa, bbb = 0) {} [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Domain] = 0:14-0:17 +[#2 Content] = 0:14-0:17 >---< -0| function(aaa, bbb) {} +0| function(aaa, bbb = 0) {} -[#2 Removal] = 0:13-0:17 - >----< -0| function(aaa, bbb) {} +[#2 Removal] = 0:14-0:20 + >------< +0| function(aaa, bbb = 0) {} -[#2 Leading delimiter] = 0:13-0:14 - >-< -0| function(aaa, bbb) {} +[#2 Trailing delimiter] = 0:17-0:20 + >---< +0| function(aaa, bbb = 0) {} + +[#2 Domain] = 0:14-0:21 + >-------< +0| function(aaa, bbb = 0) {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/r/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..37437323ca --- /dev/null +++ b/data/fixtures/scopes/r/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,13 @@ +function(aaa = 0, bbb = 1) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| function(aaa = 0, bbb = 1) {} + + +[#2 Content] = +[#2 Domain] = 0:9-0:25 + >----------------< +0| function(aaa = 0, bbb = 1) {} diff --git a/data/fixtures/scopes/r/name/name.argument.formal2.scope b/data/fixtures/scopes/r/value/value.argument.formal.lambda.scope similarity index 65% rename from data/fixtures/scopes/r/name/name.argument.formal2.scope rename to data/fixtures/scopes/r/value/value.argument.formal.lambda.scope index 15911bd390..84d8ed99d0 100644 --- a/data/fixtures/scopes/r/name/name.argument.formal2.scope +++ b/data/fixtures/scopes/r/value/value.argument.formal.lambda.scope @@ -1,15 +1,15 @@ function(aaa = 0, bbb = 1) {} --- -[#1 Content] = 0:9-0:12 - >---< +[#1 Content] = 0:15-0:16 + >-< 0| function(aaa = 0, bbb = 1) {} -[#1 Removal] = 0:9-0:15 - >------< +[#1 Removal] = 0:12-0:16 + >----< 0| function(aaa = 0, bbb = 1) {} -[#1 Trailing delimiter] = 0:12-0:15 +[#1 Leading delimiter] = 0:12-0:15 >---< 0| function(aaa = 0, bbb = 1) {} @@ -20,15 +20,15 @@ function(aaa = 0, bbb = 1) {} [#1 Insertion delimiter] = " " -[#2 Content] = 0:18-0:21 - >---< +[#2 Content] = 0:24-0:25 + >-< 0| function(aaa = 0, bbb = 1) {} -[#2 Removal] = 0:18-0:24 - >------< +[#2 Removal] = 0:21-0:25 + >----< 0| function(aaa = 0, bbb = 1) {} -[#2 Trailing delimiter] = 0:21-0:24 +[#2 Leading delimiter] = 0:21-0:24 >---< 0| function(aaa = 0, bbb = 1) {} diff --git a/data/fixtures/scopes/ruby/class.iteration.class.scope b/data/fixtures/scopes/ruby/class.iteration.class.scope new file mode 100644 index 0000000000..e4f15ca612 --- /dev/null +++ b/data/fixtures/scopes/ruby/class.iteration.class.scope @@ -0,0 +1,21 @@ +class Foo + a +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >--------- +0| class Foo +1| a +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 0:9-2:0 + > +0| class Foo +1| a +2| end + < diff --git a/data/fixtures/scopes/ruby/interior/interior.switch.scope b/data/fixtures/scopes/ruby/interior/interior.switch.scope index be53ba631b..38583f265c 100644 --- a/data/fixtures/scopes/ruby/interior/interior.switch.scope +++ b/data/fixtures/scopes/ruby/interior/interior.switch.scope @@ -1,36 +1,18 @@ case foo when 0 - a end --- -[#1 Content] = 1:0-2:5 - >------ +[Content] = 1:0-1:6 + >------< 1| when 0 -2| a - -----< -[#1 Removal] = -[#1 Domain] = 0:8-3:0 +[Removal] = +[Domain] = 0:8-2:0 > 0| case foo 1| when 0 -2| a -3| end +2| end < -[#1 Insertion delimiter] = " " - - -[#2 Content] = 2:4-2:5 - >-< -2| a - -[#2 Removal] = -[#2 Domain] = 1:6-2:5 - > -1| when 0 -2| a - -----< - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/interior/interior.switch2.scope b/data/fixtures/scopes/ruby/interior/interior.switch2.scope index c5e9959938..9da3ee4ab4 100644 --- a/data/fixtures/scopes/ruby/interior/interior.switch2.scope +++ b/data/fixtures/scopes/ruby/interior/interior.switch2.scope @@ -1,36 +1,18 @@ case foo in 0 - a end --- -[#1 Content] = 1:0-2:5 - >---- +[Content] = 1:0-1:4 + >----< 1| in 0 -2| a - -----< -[#1 Removal] = -[#1 Domain] = 0:8-3:0 +[Removal] = +[Domain] = 0:8-2:0 > 0| case foo 1| in 0 -2| a -3| end +2| end < -[#1 Insertion delimiter] = " " - - -[#2 Content] = 2:4-2:5 - >-< -2| a - -[#2 Removal] = -[#2 Domain] = 1:4-2:5 - > -1| in 0 -2| a - -----< - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/interior/interior.switchCase.scope b/data/fixtures/scopes/ruby/interior/interior.switchCase.scope index f01376b8ec..ec24674e0f 100644 --- a/data/fixtures/scopes/ruby/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/ruby/interior/interior.switchCase.scope @@ -1,56 +1,68 @@ case foo when 0 - a + bar + baz else - a + bar + baz end --- -[#1 Content] = 1:0-4:5 +[#1 Content] = 1:0-6:7 >------ 1| when 0 -2| a -3| else -4| a - -----< +2| bar +3| baz +4| else +5| bar +6| baz + -------< [#1 Removal] = -[#1 Domain] = 0:8-5:0 +[#1 Domain] = 0:8-7:0 > 0| case foo 1| when 0 -2| a -3| else -4| a -5| end +2| bar +3| baz +4| else +5| bar +6| baz +7| end < [#1 Insertion delimiter] = " " -[#2 Content] = 2:4-2:5 - >-< -2| a +[#2 Content] = 2:4-3:7 + >--- +2| bar +3| baz + -------< [#2 Removal] = -[#2 Domain] = 1:6-2:5 +[#2 Domain] = 1:6-3:7 > 1| when 0 -2| a - -----< +2| bar +3| baz + -------< [#2 Insertion delimiter] = " " -[#3 Content] = 4:4-4:5 - >-< -4| a +[#3 Content] = 5:4-6:7 + >--- +5| bar +6| baz + -------< [#3 Removal] = -[#3 Domain] = 3:4-4:5 +[#3 Domain] = 4:4-6:7 > -3| else -4| a - -----< +4| else +5| bar +6| baz + -------< [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/interior/interior.switchCase2.scope b/data/fixtures/scopes/ruby/interior/interior.switchCase2.scope index fb28184e0a..8cb9806289 100644 --- a/data/fixtures/scopes/ruby/interior/interior.switchCase2.scope +++ b/data/fixtures/scopes/ruby/interior/interior.switchCase2.scope @@ -1,56 +1,68 @@ case foo in 0 - a + bar + baz else - a + bar + baz end --- -[#1 Content] = 1:0-4:5 +[#1 Content] = 1:0-6:7 >---- 1| in 0 -2| a -3| else -4| a - -----< +2| bar +3| baz +4| else +5| bar +6| baz + -------< [#1 Removal] = -[#1 Domain] = 0:8-5:0 +[#1 Domain] = 0:8-7:0 > 0| case foo 1| in 0 -2| a -3| else -4| a -5| end +2| bar +3| baz +4| else +5| bar +6| baz +7| end < [#1 Insertion delimiter] = " " -[#2 Content] = 2:4-2:5 - >-< -2| a +[#2 Content] = 2:4-3:7 + >--- +2| bar +3| baz + -------< [#2 Removal] = -[#2 Domain] = 1:4-2:5 +[#2 Domain] = 1:4-3:7 > 1| in 0 -2| a - -----< +2| bar +3| baz + -------< [#2 Insertion delimiter] = " " -[#3 Content] = 4:4-4:5 - >-< -4| a +[#3 Content] = 5:4-6:7 + >--- +5| bar +6| baz + -------< [#3 Removal] = -[#3 Domain] = 3:4-4:5 +[#3 Domain] = 4:4-6:7 > -3| else -4| a - -----< +4| else +5| bar +6| baz + -------< [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/list.scope b/data/fixtures/scopes/ruby/list.scope index 54a5d795c2..053c607f96 100644 --- a/data/fixtures/scopes/ruby/list.scope +++ b/data/fixtures/scopes/ruby/list.scope @@ -1,10 +1,10 @@ -[1, 2, 3] +[aaa, bbb] --- [Content] = [Removal] = -[Domain] = 0:0-0:9 - >---------< -0| [1, 2, 3] +[Domain] = 0:0-0:10 + >----------< +0| [aaa, bbb] [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/list2.scope b/data/fixtures/scopes/ruby/list2.scope index 2d3722141d..17324d60a1 100644 --- a/data/fixtures/scopes/ruby/list2.scope +++ b/data/fixtures/scopes/ruby/list2.scope @@ -1,10 +1,10 @@ -%w[foo bar baz] +%w[aaa bbb] --- [Content] = [Removal] = -[Domain] = 0:0-0:15 - >---------------< -0| %w[foo bar baz] +[Domain] = 0:0-0:11 + >-----------< +0| %w[aaa bbb] [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/list3.scope b/data/fixtures/scopes/ruby/list3.scope index a86a6e28d3..a00b29aeda 100644 --- a/data/fixtures/scopes/ruby/list3.scope +++ b/data/fixtures/scopes/ruby/list3.scope @@ -1,10 +1,10 @@ -%i[foo bar baz] +%i[aaa bbb] --- [Content] = [Removal] = -[Domain] = 0:0-0:15 - >---------------< -0| %i[foo bar baz] +[Domain] = 0:0-0:11 + >-----------< +0| %i[aaa bbb] [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/ruby/namedFunction.iteration.class.scope b/data/fixtures/scopes/ruby/namedFunction.iteration.class.scope index 37cb946c03..e4f15ca612 100644 --- a/data/fixtures/scopes/ruby/namedFunction.iteration.class.scope +++ b/data/fixtures/scopes/ruby/namedFunction.iteration.class.scope @@ -1,13 +1,21 @@ -class Foo end +class Foo + a +end --- [#1 Content] = -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo end +[#1 Domain] = 0:0-2:3 + >--------- +0| class Foo +1| a +2| end + ---< [#2 Content] = -[#2 Domain] = 0:9-0:10 - >-< -0| class Foo end +[#2 Domain] = 0:9-2:0 + > +0| class Foo +1| a +2| end + < diff --git a/data/fixtures/scopes/ruby/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/ruby/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..1d7f24f82e --- /dev/null +++ b/data/fixtures/scopes/ruby/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,13 @@ +->(aaa = 0, bbb = 1) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:23 + >-----------------------< +0| ->(aaa = 0, bbb = 1) {} + + +[#2 Content] = +[#2 Domain] = 0:3-0:19 + >----------------< +0| ->(aaa = 0, bbb = 1) {} diff --git a/data/fixtures/scopes/ruby/value/value.argument.formal.lambda.scope b/data/fixtures/scopes/ruby/value/value.argument.formal.lambda.scope new file mode 100644 index 0000000000..f71b322cda --- /dev/null +++ b/data/fixtures/scopes/ruby/value/value.argument.formal.lambda.scope @@ -0,0 +1,39 @@ +->(aaa = 0, bbb = 1) {} +--- + +[#1 Content] = 0:9-0:10 + >-< +0| ->(aaa = 0, bbb = 1) {} + +[#1 Removal] = 0:6-0:10 + >----< +0| ->(aaa = 0, bbb = 1) {} + +[#1 Leading delimiter] = 0:6-0:9 + >---< +0| ->(aaa = 0, bbb = 1) {} + +[#1 Domain] = 0:3-0:10 + >-------< +0| ->(aaa = 0, bbb = 1) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:18-0:19 + >-< +0| ->(aaa = 0, bbb = 1) {} + +[#2 Removal] = 0:15-0:19 + >----< +0| ->(aaa = 0, bbb = 1) {} + +[#2 Leading delimiter] = 0:15-0:18 + >---< +0| ->(aaa = 0, bbb = 1) {} + +[#2 Domain] = 0:12-0:19 + >-------< +0| ->(aaa = 0, bbb = 1) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.switchCase.scope b/data/fixtures/scopes/rust/interior/interior.switchCase.scope index 4d3fa56172..0574465a70 100644 --- a/data/fixtures/scopes/rust/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/rust/interior/interior.switchCase.scope @@ -1,55 +1,46 @@ match foo { - 0 => 0, - 1 => { } - _ => { } + 0 => bar + _ => bar } --- -[#1 Content] = 1:4-3:12 - >------- -1| 0 => 0, -2| 1 => { } -3| _ => { } +[#1 Content] = 1:4-2:12 + >-------- +1| 0 => bar +2| _ => bar ------------< [#1 Removal] = -[#1 Domain] = 0:11-4:0 +[#1 Domain] = 0:11-3:0 > 0| match foo { -1| 0 => 0, -2| 1 => { } -3| _ => { } -4| } +1| 0 => bar +2| _ => bar +3| } < [#1 Insertion delimiter] = " " -[#2 Content] = 1:9-1:11 - >--< -1| 0 => 0, +[#2 Content] = 1:9-1:12 + >---< +1| 0 => bar [#2 Removal] = -[#2 Domain] = 1:8-1:11 - >---< -1| 0 => 0, +[#2 Domain] = 1:8-1:12 + >----< +1| 0 => bar [#2 Insertion delimiter] = " " -[#3 Content] = +[#3 Content] = 2:9-2:12 + >---< +2| _ => bar + [#3 Removal] = -[#3 Domain] = 2:10-2:11 - >-< -2| 1 => { } +[#3 Domain] = 2:8-2:12 + >----< +2| _ => bar [#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = -[#4 Domain] = 3:10-3:11 - >-< -3| _ => { } - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.switchCase2.scope b/data/fixtures/scopes/rust/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..c6f1e3ebd0 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +match foo { + 0 => { } + _ => { } +} +--- + +[#1 Content] = 1:4-2:12 + >-------- +1| 0 => { } +2| _ => { } + ------------< + +[#1 Removal] = +[#1 Domain] = 0:11-3:0 + > +0| match foo { +1| 0 => { } +2| _ => { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:10-1:11 + >-< +1| 0 => { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:10-2:11 + >-< +2| _ => { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/list.scope b/data/fixtures/scopes/rust/list.scope index 2671d6c135..053c607f96 100644 --- a/data/fixtures/scopes/rust/list.scope +++ b/data/fixtures/scopes/rust/list.scope @@ -1,17 +1,10 @@ -let foo = [1, 2, 3]; +[aaa, bbb] --- [Content] = -[Domain] = 0:10-0:19 - >---------< -0| let foo = [1, 2, 3]; - -[Removal] = 0:9-0:19 - >----------< -0| let foo = [1, 2, 3]; - -[Leading delimiter] = 0:9-0:10 - >-< -0| let foo = [1, 2, 3]; +[Removal] = +[Domain] = 0:0-0:10 + >----------< +0| [aaa, bbb] [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/list2.scope b/data/fixtures/scopes/rust/list2.scope index 1689e4bd5a..61420bcff5 100644 --- a/data/fixtures/scopes/rust/list2.scope +++ b/data/fixtures/scopes/rust/list2.scope @@ -1,17 +1,10 @@ -let foo = (1, "2", true); +(aaa, bbb) --- [Content] = -[Domain] = 0:10-0:24 - >--------------< -0| let foo = (1, "2", true); - -[Removal] = 0:9-0:24 - >---------------< -0| let foo = (1, "2", true); - -[Leading delimiter] = 0:9-0:10 - >-< -0| let foo = (1, "2", true); +[Removal] = +[Domain] = 0:0-0:10 + >----------< +0| (aaa, bbb) [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/class.iteration.class.scope b/data/fixtures/scopes/scala/class.iteration.class.scope new file mode 100644 index 0000000000..a3ec5f3456 --- /dev/null +++ b/data/fixtures/scopes/scala/class.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Content] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/scala/interior/interior.switchCase.scope b/data/fixtures/scopes/scala/interior/interior.switchCase.scope index 4497b3606a..b5bef5b45d 100644 --- a/data/fixtures/scopes/scala/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/scala/interior/interior.switchCase.scope @@ -1,58 +1,68 @@ foo match { - case 0 => 0 - case 1 => { } - case _ => 1 + case 0 => + foo + bar + case _ => + foo + bar } --- -[#1 Content] = 1:4-3:15 - >----------- -1| case 0 => 0 -2| case 1 => { } -3| case _ => 1 - ---------------< +[#1 Content] = 1:4-6:11 + >--------- +1| case 0 => +2| foo +3| bar +4| case _ => +5| foo +6| bar + -----------< [#1 Removal] = -[#1 Domain] = 0:11-4:0 +[#1 Domain] = 0:11-7:0 > 0| foo match { -1| case 0 => 0 -2| case 1 => { } -3| case _ => 1 -4| } +1| case 0 => +2| foo +3| bar +4| case _ => +5| foo +6| bar +7| } < [#1 Insertion delimiter] = " " -[#2 Content] = 1:14-1:15 - >-< -1| case 0 => 0 +[#2 Content] = 2:8-3:11 + >--- +2| foo +3| bar + -----------< [#2 Removal] = -[#2 Domain] = 1:13-1:15 - >--< -1| case 0 => 0 +[#2 Domain] = 1:13-3:11 + > +1| case 0 => +2| foo +3| bar + -----------< [#2 Insertion delimiter] = " " -[#3 Content] = +[#3 Content] = 5:8-6:11 + >--- +5| foo +6| bar + -----------< + [#3 Removal] = -[#3 Domain] = 2:15-2:16 - >-< -2| case 1 => { } +[#3 Domain] = 4:13-6:11 + > +4| case _ => +5| foo +6| bar + -----------< [#3 Insertion delimiter] = " " - - -[#4 Content] = 3:14-3:15 - >-< -3| case _ => 1 - -[#4 Removal] = -[#4 Domain] = 3:13-3:15 - >--< -3| case _ => 1 - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/interior/interior.switchCase2.scope b/data/fixtures/scopes/scala/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..d2af89b43f --- /dev/null +++ b/data/fixtures/scopes/scala/interior/interior.switchCase2.scope @@ -0,0 +1,40 @@ +foo match { + case 0 => { } + case _ => { } +} +--- + +[#1 Content] = 1:4-2:17 + >------------- +1| case 0 => { } +2| case _ => { } + -----------------< + +[#1 Removal] = +[#1 Domain] = 0:11-3:0 + > +0| foo match { +1| case 0 => { } +2| case _ => { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:15-1:16 + >-< +1| case 0 => { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:15-2:16 + >-< +2| case _ => { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/name/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/scala/name/name.argument.formal.constructor.iteration.scope index 44868ed858..d7fefc6b39 100644 --- a/data/fixtures/scopes/scala/name/name.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/scala/name/name.argument.formal.constructor.iteration.scope @@ -1,13 +1,13 @@ -class Foo(aaa: Int, bbb: Int) {} +class Foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:32 - >--------------------------------< -0| class Foo(aaa: Int, bbb: Int) {} +[#1 Domain] = 0:0-0:36 + >------------------------------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} [#2 Content] = -[#2 Domain] = 0:10-0:28 - >------------------< -0| class Foo(aaa: Int, bbb: Int) {} +[#2 Domain] = 0:10-0:32 + >----------------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/scala/name/name.argument.formal.constructor.scope b/data/fixtures/scopes/scala/name/name.argument.formal.constructor.scope index 7fe4e513b6..5d9e8eff09 100644 --- a/data/fixtures/scopes/scala/name/name.argument.formal.constructor.scope +++ b/data/fixtures/scopes/scala/name/name.argument.formal.constructor.scope @@ -1,18 +1,18 @@ -class Foo(aaa: Int, bbb: Int) {} +class Foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = [#1 Removal] = 0:6-0:9 >---< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} [#1 Leading delimiter] = 0:5-0:6 >-< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} -[#1 Domain] = 0:0-0:32 - >--------------------------------< -0| class Foo(aaa: Int, bbb: Int) {} +[#1 Domain] = 0:0-0:36 + >------------------------------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} [#1 Insertion delimiter] = " " @@ -20,29 +20,29 @@ class Foo(aaa: Int, bbb: Int) {} [#2 Content] = [#2 Removal] = 0:10-0:13 >---< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} [#2 Domain] = 0:10-0:18 >--------< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " [#3 Content] = 0:20-0:23 >---< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} [#3 Removal] = 0:19-0:23 >----< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} [#3 Leading delimiter] = 0:19-0:20 >-< -0| class Foo(aaa: Int, bbb: Int) {} +0| class Foo(aaa: Int, bbb: Int = 0) {} -[#3 Domain] = 0:20-0:28 - >--------< -0| class Foo(aaa: Int, bbb: Int) {} +[#3 Domain] = 0:20-0:32 + >------------< +0| class Foo(aaa: Int, bbb: Int = 0) {} [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/scala/name/name.argument.formal.iteration.scope index 546094f0d9..7c8ad2c8ed 100644 --- a/data/fixtures/scopes/scala/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/scala/name/name.argument.formal.iteration.scope @@ -1,13 +1,13 @@ -def foo(aaa: Int, bbb: Int) {} +def foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = -[#1 Domain] = 0:0-0:30 - >------------------------------< -0| def foo(aaa: Int, bbb: Int) {} +[#1 Domain] = 0:0-0:34 + >----------------------------------< +0| def foo(aaa: Int, bbb: Int = 0) {} [#2 Content] = -[#2 Domain] = 0:8-0:26 - >------------------< -0| def foo(aaa: Int, bbb: Int) {} +[#2 Domain] = 0:8-0:30 + >----------------------< +0| def foo(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/scala/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/scala/name/name.argument.formal.method.iteration.scope index 78163cdb61..aac2695c67 100644 --- a/data/fixtures/scopes/scala/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/scala/name/name.argument.formal.method.iteration.scope @@ -1,5 +1,5 @@ class Foo { - def bar(aaa: Int, bbb: Int) {} + def bar(aaa: Int, bbb: Int = 0) {} } --- @@ -7,7 +7,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} 2| } -< @@ -16,12 +16,12 @@ class Foo { [#2 Domain] = 0:11-2:0 > 0| class Foo { -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} 2| } < [#3 Content] = -[#3 Domain] = 1:12-1:30 - >------------------< -1| def bar(aaa: Int, bbb: Int) {} +[#3 Domain] = 1:12-1:34 + >----------------------< +1| def bar(aaa: Int, bbb: Int = 0) {} diff --git a/data/fixtures/scopes/scala/name/name.argument.formal.method.scope b/data/fixtures/scopes/scala/name/name.argument.formal.method.scope index 344d7741f4..05986ba547 100644 --- a/data/fixtures/scopes/scala/name/name.argument.formal.method.scope +++ b/data/fixtures/scopes/scala/name/name.argument.formal.method.scope @@ -1,5 +1,5 @@ class Foo { - def bar(aaa: Int, bbb: Int) {} + def bar(aaa: Int, bbb: Int = 0) {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} 2| } -< @@ -32,15 +32,15 @@ class Foo { [#2 Content] = [#2 Removal] = 1:8-1:11 >---< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} [#2 Leading delimiter] = 1:7-1:8 >-< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} -[#2 Domain] = 1:4-1:34 - >------------------------------< -1| def bar(aaa: Int, bbb: Int) {} +[#2 Domain] = 1:4-1:38 + >----------------------------------< +1| def bar(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " @@ -48,29 +48,29 @@ class Foo { [#3 Content] = [#3 Removal] = 1:12-1:15 >---< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} [#3 Domain] = 1:12-1:20 >--------< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} [#3 Insertion delimiter] = " " [#4 Content] = 1:22-1:25 >---< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} [#4 Removal] = 1:21-1:25 >----< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} [#4 Leading delimiter] = 1:21-1:22 >-< -1| def bar(aaa: Int, bbb: Int) {} +1| def bar(aaa: Int, bbb: Int = 0) {} -[#4 Domain] = 1:22-1:30 - >--------< -1| def bar(aaa: Int, bbb: Int) {} +[#4 Domain] = 1:22-1:34 + >------------< +1| def bar(aaa: Int, bbb: Int = 0) {} [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/name/name.argument.formal.scope b/data/fixtures/scopes/scala/name/name.argument.formal.scope index ba77d19249..b122244771 100644 --- a/data/fixtures/scopes/scala/name/name.argument.formal.scope +++ b/data/fixtures/scopes/scala/name/name.argument.formal.scope @@ -1,18 +1,18 @@ -def foo(aaa: Int, bbb: Int) {} +def foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = [#1 Removal] = 0:4-0:7 >---< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} [#1 Leading delimiter] = 0:3-0:4 >-< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} -[#1 Domain] = 0:0-0:30 - >------------------------------< -0| def foo(aaa: Int, bbb: Int) {} +[#1 Domain] = 0:0-0:34 + >----------------------------------< +0| def foo(aaa: Int, bbb: Int = 0) {} [#1 Insertion delimiter] = " " @@ -20,29 +20,29 @@ def foo(aaa: Int, bbb: Int) {} [#2 Content] = [#2 Removal] = 0:8-0:11 >---< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} [#2 Domain] = 0:8-0:16 >--------< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " [#3 Content] = 0:18-0:21 >---< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} [#3 Removal] = 0:17-0:21 >----< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} [#3 Leading delimiter] = 0:17-0:18 >-< -0| def foo(aaa: Int, bbb: Int) {} +0| def foo(aaa: Int, bbb: Int = 0) {} -[#3 Domain] = 0:18-0:26 - >--------< -0| def foo(aaa: Int, bbb: Int) {} +[#3 Domain] = 0:18-0:30 + >------------< +0| def foo(aaa: Int, bbb: Int = 0) {} [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scm/list.scope b/data/fixtures/scopes/scm/list.scope index d65e8a21de..bd07a973d3 100644 --- a/data/fixtures/scopes/scm/list.scope +++ b/data/fixtures/scopes/scm/list.scope @@ -1,20 +1,10 @@ -[(aaa) (bbb)] @list +[(aaa) (bbb)] --- -[Content] = 0:0-0:13 +[Content] = +[Removal] = +[Domain] = 0:0-0:13 >-------------< -0| [(aaa) (bbb)] @list - -[Removal] = 0:0-0:14 - >--------------< -0| [(aaa) (bbb)] @list - -[Trailing delimiter] = 0:13-0:14 - >-< -0| [(aaa) (bbb)] @list - -[Domain] = 0:0-0:19 - >-------------------< -0| [(aaa) (bbb)] @list +0| [(aaa) (bbb)] [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.argument.formal.scope b/data/fixtures/scopes/typescript.core/name/name.argument.formal.scope index d07a115741..8f2b07a154 100644 --- a/data/fixtures/scopes/typescript.core/name/name.argument.formal.scope +++ b/data/fixtures/scopes/typescript.core/name/name.argument.formal.scope @@ -1,18 +1,18 @@ -function foo(aaa?: number, bbb?: number = 0) {} +function foo(aaa?: number, bbb: number = 0) {} --- [#1 Content] = [#1 Removal] = 0:9-0:12 >---< -0| function foo(aaa?: number, bbb?: number = 0) {} +0| function foo(aaa?: number, bbb: number = 0) {} [#1 Leading delimiter] = 0:8-0:9 >-< -0| function foo(aaa?: number, bbb?: number = 0) {} +0| function foo(aaa?: number, bbb: number = 0) {} -[#1 Domain] = 0:0-0:47 - >-----------------------------------------------< -0| function foo(aaa?: number, bbb?: number = 0) {} +[#1 Domain] = 0:0-0:46 + >----------------------------------------------< +0| function foo(aaa?: number, bbb: number = 0) {} [#1 Insertion delimiter] = " " @@ -20,26 +20,29 @@ function foo(aaa?: number, bbb?: number = 0) {} [#2 Content] = [#2 Removal] = 0:13-0:16 >---< -0| function foo(aaa?: number, bbb?: number = 0) {} +0| function foo(aaa?: number, bbb: number = 0) {} [#2 Domain] = 0:13-0:25 >------------< -0| function foo(aaa?: number, bbb?: number = 0) {} +0| function foo(aaa?: number, bbb: number = 0) {} [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Removal] = 0:27-0:30 +[#3 Content] = 0:27-0:30 >---< -0| function foo(aaa?: number, bbb?: number = 0) {} +0| function foo(aaa?: number, bbb: number = 0) {} + +[#3 Removal] = 0:26-0:30 + >----< +0| function foo(aaa?: number, bbb: number = 0) {} [#3 Leading delimiter] = 0:26-0:27 >-< -0| function foo(aaa?: number, bbb?: number = 0) {} +0| function foo(aaa?: number, bbb: number = 0) {} -[#3 Domain] = 0:27-0:43 - >----------------< -0| function foo(aaa?: number, bbb?: number = 0) {} +[#3 Domain] = 0:27-0:42 + >---------------< +0| function foo(aaa?: number, bbb: number = 0) {} [#3 Insertion delimiter] = " " diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 6098f1f0cc..a89136bc22 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -87,7 +87,7 @@ ### class - `class` A class/struct in an object-oriented language -- `class.iteration.block` Iteration scope for classes: statement blocks (body of functions/if-statements/for-loops/etc). +- `class.iteration.class` Iteration scope for classes: class bodies. - `class.iteration.document` Iteration scope for classes: the entire document including leading and trailing empty lines. ### collectionItem @@ -420,11 +420,13 @@ - `value.argument.actual` The value of a (keyword) argument in a function call - `value.argument.actual.iteration` Iteration scope for values of (keyword) arguments in a function call: the arguments list. -- `value.argument.formal` The value of a (keyword) argument in a function declaration -- `value.argument.formal.constructor` The value of a parameter in a constructor declaration +- `value.argument.formal` The (default) value of a argument in a function declaration +- `value.argument.formal.constructor` The (default) value of a parameter in a constructor declaration - `value.argument.formal.constructor.iteration` Iteration scope for values of formal parameters in a constructor declaration: the parameters list. - `value.argument.formal.iteration` Iteration scope for values of formal parameters in a function declaration: the parameters list. -- `value.argument.formal.method` The value of a parameter in a class method declaration +- `value.argument.formal.lambda` The (default) value of a parameter in a lambda declaration +- `value.argument.formal.lambda.iteration` Iteration scope for values of formal parameters in a lambda declaration: the parameters list. +- `value.argument.formal.method` The (default) value of a parameter in a method declaration - `value.argument.formal.method.iteration` Iteration scope for values of formal parameters in a method declaration: the parameters list. - `value.assignment` Value (RHS) of an assignment - `value.assignment.compound` Value (RHS) of a compound assignment, eg +=/-= diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 0641842f04..35fe197ba7 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -217,7 +217,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "interior.cell": notApplicable, // Nested class - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -282,6 +282,8 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "interior.lambda": notApplicable, "value.return.lambda": notApplicable, anonymousFunction: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index a810fe9f0e..6d124663dc 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -76,6 +76,8 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": supported, "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, "value.foreach": supported, "value.field.class": supported, "value.throw": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 9255c7ca8b..de94867c4b 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -12,7 +12,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { class: supported, "class.iteration.document": supported, - "class.iteration.block": supported, + "class.iteration.class": supported, "comment.line": supported, "comment.block": supported, @@ -84,12 +84,14 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.enum": supported, "name.iteration.document": supported, - "value.argument.formal.constructor": supported, - "value.argument.formal.constructor.iteration": supported, + "value.argument.formal": supported, "value.argument.formal.iteration": supported, "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, - "value.argument.formal": supported, + "value.argument.formal.constructor": supported, + "value.argument.formal.constructor.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, "value.field.class": supported, "value.field.enum": supported, "value.field.interface": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 7f7c35fa28..70d27e5a7b 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -78,7 +78,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -178,6 +178,8 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index 691dc4426b..29971d7532 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -12,7 +12,6 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, class: supported, - "class.iteration.block": supported, "class.iteration.document": supported, "statement.class": supported, @@ -317,6 +316,8 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.iteration": notApplicable, "value.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, // Yield "statement.yield": notApplicable, @@ -344,6 +345,7 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "value.return.lambda": notApplicable, "type.foreach": notApplicable, "type.cast": notApplicable, + "class.iteration.class": notApplicable, regularExpression: notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 551c4a85af..d2f10fcf8a 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -52,7 +52,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -152,6 +152,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index be53e48462..013f0bb1e8 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -63,7 +63,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": supported, class: supported, - "class.iteration.block": supported, + "class.iteration.class": supported, "class.iteration.document": supported, "comment.block": supported, @@ -287,10 +287,12 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { // Default argument value "value.argument.formal": notApplicable, "value.argument.formal.iteration": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, "value.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, // Type alias "type.alias": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 3ded4b01a3..8f5a6f25d0 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -179,6 +179,8 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": supported, "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, "value.assignment": supported, @@ -216,7 +218,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE (JS & TS) */ // Nested classes - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, // Section section: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 4ade4f3a51..f469cc093a 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -55,7 +55,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -155,6 +155,8 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index c57f9f4a96..44c4b0bba4 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -64,6 +64,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": supported, class: supported, + "class.iteration.class": supported, "class.iteration.document": supported, "comment.block": supported, @@ -319,6 +320,10 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment.destructuring": notApplicable, "value.assignment.destructuring": notApplicable, + // Default argument value in lambdas + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, + // Miscellaneous environment: notApplicable, regularExpression: notApplicable, @@ -327,7 +332,6 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { pairDelimiter: notApplicable, list: notApplicable, map: notApplicable, - "class.iteration.block": notApplicable, "type.cast": notApplicable, "statement.misc": notApplicable, "value.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index af36435154..a30d0fd9ce 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -67,7 +67,7 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -167,6 +167,8 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index aaa9422a03..ab54483ed3 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -171,7 +171,7 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, "class.iteration.document": notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "statement.class": notApplicable, "statement.field.class": notApplicable, "statement.continue": notApplicable, @@ -282,6 +282,8 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.iteration": notApplicable, "value.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.switch": notApplicable, "value.field.class": notApplicable, "value.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index e963210ec6..15afa286e7 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -56,7 +56,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -156,6 +156,8 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index ef00dd6532..138afca818 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -25,7 +25,7 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -140,6 +140,8 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 70dfe729ef..be6a57fe82 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -39,6 +39,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal": supported, "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, "value.argument.formal.iteration": supported, "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, @@ -146,6 +148,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "branch.loop.iteration": supported, class: supported, + "class.iteration.class": supported, "class.iteration.document": supported, "interior.class": supported, @@ -267,9 +270,6 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, - // Nested classes - "class.iteration.block": notApplicable, - // Type. Python have some types, but not these. "type.cast": notApplicable, "type.foreach": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index 0480735e58..58428eac8f 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -99,6 +99,8 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual.iteration": supported, "value.argument.formal": supported, "value.argument.formal.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, "value.assignment": supported, "value.foreach": supported, "value.return": supported, @@ -147,7 +149,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/ruby.ts b/packages/common/src/scopeSupportFacets/ruby.ts index 3ed0c21c05..e2aec59995 100644 --- a/packages/common/src/scopeSupportFacets/ruby.ts +++ b/packages/common/src/scopeSupportFacets/ruby.ts @@ -12,6 +12,7 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { anonymousFunction: supported, class: supported, + "class.iteration.class": supported, "class.iteration.document": supported, namedFunction: supported, @@ -133,6 +134,8 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.iteration": supported, "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, "value.assignment": supported, @@ -343,7 +346,6 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { // Misc "statement.package": notApplicable, "statement.import": notApplicable, - "class.iteration.block": notApplicable, pairDelimiter: notApplicable, environment: notApplicable, selector: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 8ee45dfc93..2d860a9431 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -285,6 +285,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.iteration": notApplicable, "value.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, // For loop "statement.for": notApplicable, @@ -337,7 +339,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.misc": notApplicable, "value.field.class": notApplicable, "type.foreach": notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, environment: notApplicable, regularExpression: notApplicable, selector: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 2ad667db80..1ab4b83e9b 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -66,7 +66,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "branch.switchCase.iteration": supported, class: supported, - "class.iteration.block": supported, + "class.iteration.class": supported, "class.iteration.document": supported, "comment.block": supported, @@ -328,6 +328,10 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment.destructuring": notApplicable, "value.assignment.destructuring": notApplicable, + // Default argument value in lambdas + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, + // Miscellaneous pairDelimiter: notApplicable, regularExpression: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 292b94c75d..16f4721ba5 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -57,7 +57,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -157,6 +157,8 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 5d5e364e00..c2967faf4e 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -229,7 +229,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "class", }, "class.iteration.document": documentIter("class", "classes"), - "class.iteration.block": blockIter("class", "classes"), + "class.iteration.class": classIter("class", "classes"), namedFunction: { description: "A named function declaration", @@ -885,7 +885,7 @@ export const scopeSupportFacetInfos: Record< "the arguments list", ), "value.argument.formal": { - description: "The value of a (keyword) argument in a function declaration", + description: "The (default) value of a argument in a function declaration", scopeType: "value", }, "value.argument.formal.iteration": iteration( @@ -894,7 +894,7 @@ export const scopeSupportFacetInfos: Record< "the parameters list", ), "value.argument.formal.method": { - description: "The value of a parameter in a class method declaration", + description: "The (default) value of a parameter in a method declaration", scopeType: "value", }, "value.argument.formal.method.iteration": iteration( @@ -903,7 +903,8 @@ export const scopeSupportFacetInfos: Record< "the parameters list", ), "value.argument.formal.constructor": { - description: "The value of a parameter in a constructor declaration", + description: + "The (default) value of a parameter in a constructor declaration", scopeType: "value", }, "value.argument.formal.constructor.iteration": iteration( @@ -911,6 +912,15 @@ export const scopeSupportFacetInfos: Record< "values of formal parameters in a constructor declaration", "the parameters list", ), + "value.argument.formal.lambda": { + description: "The (default) value of a parameter in a lambda declaration", + scopeType: "value", + }, + "value.argument.formal.lambda.iteration": iteration( + "value", + "values of formal parameters in a lambda declaration", + "the parameters list", + ), "value.typeAlias": { description: "Value of a type alias declaration", scopeType: "value", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index ffbd2a7768..8dc1102fec 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -72,7 +72,7 @@ export const scopeSupportFacets = [ "class", "class.iteration.document", - "class.iteration.block", + "class.iteration.class", "anonymousFunction", @@ -253,6 +253,8 @@ export const scopeSupportFacets = [ "value.argument.formal.method.iteration", "value.argument.formal.constructor", "value.argument.formal.constructor.iteration", + "value.argument.formal.lambda", + "value.argument.formal.lambda.iteration", "value.iteration.block", "value.iteration.class", "value.iteration.enum", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 66fe30e4de..d748a39c09 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -60,7 +60,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -164,6 +164,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index f3f698348d..31a4b2d0fd 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -28,7 +28,7 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -143,6 +143,8 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 7f2f70c1d7..a8f66f671c 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -52,7 +52,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -152,6 +152,8 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 6ae04ee70a..263c52c46a 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -61,7 +61,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { // Class class: notApplicable, - "class.iteration.block": notApplicable, + "class.iteration.class": notApplicable, "class.iteration.document": notApplicable, "name.class": notApplicable, "name.field.class": notApplicable, @@ -161,6 +161,8 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "value.argument.formal.lambda": notApplicable, + "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, "interior.lambda": notApplicable, diff --git a/queries/go.scm b/queries/go.scm index 46bcc01da7..be8c1b5aee 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -207,8 +207,10 @@ (#insertion-delimiter! @branch "\n") ) -;; The parent object has trailing whitespace that we want to exclude. -;; Our trim predicate can't operate on positions only ranges. +;;!! case 0: 0 +;;!! ^^ +;;!! default: 0 +;;!! ^^ (_ [ "case" @@ -216,22 +218,11 @@ ] ":" @interior.start.endOf . - (_) @_dummy - (_) @interior.end.endOf + (_) @interior.end.endOf @_dummy + (_)? @interior.end.endOf . (#not-type? @_dummy block) ) -(_ - [ - "case" - "default" - ] - ":" @interior.start.endOf - . - (_) @interior.end.endOf - . - (#not-type? @interior.end.endOf block) -) ;;!! switch foo {} (expression_switch_statement diff --git a/queries/kotlin.scm b/queries/kotlin.scm index 9ccd72f015..028de07cb8 100644 --- a/queries/kotlin.scm +++ b/queries/kotlin.scm @@ -247,15 +247,15 @@ "->" ) @condition.domain -;;!! 0 -> break -;;! ^^^^^^ +;;!! 0 -> 0 +;;! ^^ (when_entry "->" @interior.start.endOf (control_structure_body . (_) ) @interior.end.endOf -) @interior.domain +) ;;!! while (true) {} ;;! ^^^^ @@ -277,6 +277,10 @@ ;;!! class Foo {} (class_declaration (type_identifier) @name + (class_body + "{" @class.iteration.start.endOf + "}" @class.iteration.end.startOf + )? ) @class @type @name.domain ;;!! object Foo {} diff --git a/queries/python.scm b/queries/python.scm index 6a92e962f2..4a44d1d3e6 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -185,13 +185,6 @@ (with_clause) @name ) @name.domain -;;!! lambda str: len(str) > 0 -;;! ^^^^^^^^^^^^ -;;! ------------------------ -(lambda - body: (_) @value -) @_.domain - ;; value: ;;!! for aaa in bbb: ;;! ^^^ @@ -218,9 +211,16 @@ ] @map [ + ;;!! [aaa, bbb] (list) + ;;!! [aaa for i in bbb] (list_comprehension) + ;;!! {aaa, bbb} (set) + ;;!! {aaa for i in bbb} + (set_comprehension) + ;;!! (aaa, bbb) + (tuple) ] @list ;;!! def foo(): pass @@ -252,7 +252,7 @@ return_type: (_) @type ) @_.domain -;;!! class MyClass: +;;!! class Foo: ( (class_definition) @class @type @statement (#not-parent-type? @class decorated_definition) @@ -266,7 +266,7 @@ ) ;;!! @value -;;!! class MyClass: +;;!! class Foo: (decorated_definition (class_definition) ) @class @type @statement @@ -277,6 +277,13 @@ ) ) @name.domain +;;!! class Foo: pass +;;! ^^^^^ +(class_definition + ":" @class.iteration.start.endOf + body: (_) @class.iteration.end.endOf +) + ( (module) @statement.iteration @class.iteration @namedFunction.iteration (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) @@ -609,21 +616,28 @@ (#child-range! @argumentList 1 -2) ) @argumentList.domain @argumentOrParameter.iteration.domain -;;!! lambda _: pass -;;! ^^^^^^^^^^^^^^ -(lambda) @anonymousFunction +;;!! lambda: 0 +;;! ^^^^^^^^^ +;;! ^ +(lambda + body: (_) @value +) @anonymousFunction @value.domain ;;!! lambda aaa, bbb: pass ;;! ^^^^^^^^ (lambda - (lambda_parameters) @argumentList @argumentOrParameter.iteration @name.iteration + (lambda_parameters) @argumentList @argumentOrParameter.iteration (#insertion-delimiter! @argumentList ", ") ) @argumentList.domain @argumentOrParameter.iteration.domain +;;!! lambda aaa, bbb: pass +;;! ^^^^^^^^ +(lambda_parameters) @name.iteration @value.iteration + ;;!! lambda aaa, bbb: pass ;;! ^^^ ^^^ (lambda_parameters - (_) @name + (identifier) @name ) ;;!! lambda: pass diff --git a/queries/scala.scm b/queries/scala.scm index 01dbec4c0f..bf3562322b 100644 --- a/queries/scala.scm +++ b/queries/scala.scm @@ -384,10 +384,13 @@ (case_block (case_clause "=>" @interior.start.endOf - body: (_) @interior.end.endOf + . + (_) @interior.end.endOf @_dummy + (_)? @interior.end.endOf + . ) ) - (#not-type? @interior.end.endOf block) + (#not-type? @_dummy block) ) ;;!! try {}