From 2592fc9a37e187d5b66cc334e3d07ac812e9d570 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 15 Feb 2026 09:00:36 +0100 Subject: [PATCH] Split branch switch case scope into separate files --- .../scopes/c/branch/branch.switchCase.scope | 31 +++---------- .../scopes/c/branch/branch.switchCase2.scope | 21 +++++++++ .../csharp/branch/branch.switchCase.scope | 31 +++---------- .../csharp/branch/branch.switchCase2.scope | 21 +++++++++ .../scopes/go/branch/branch.switchCase.scope | 31 +++---------- .../scopes/go/branch/branch.switchCase2.scope | 21 +++++++++ .../java/branch/branch.switchCase.scope | 31 +++---------- .../java/branch/branch.switchCase2.scope | 21 +++++++++ .../branch/branch.switchCase.scope | 31 +++---------- .../branch/branch.switchCase2.scope | 21 +++++++++ .../kotlin/branch/branch.switchCase.scope | 31 +++---------- .../kotlin/branch/branch.switchCase2.scope | 21 +++++++++ .../python/branch/branch.switchCase.scope | 39 ++++------------ .../python/branch/branch.switchCase2.scope | 24 ++++++++++ .../scopes/r/branch/branch.switchCase.scope | 46 ++----------------- .../scopes/r/branch/branch.switchCase2.scope | 19 ++++++++ .../scopes/r/branch/branch.switchCase3.scope | 21 +++++++++ .../rust/branch/branch.switchCase.scope | 31 +++---------- .../rust/branch/branch.switchCase2.scope | 21 +++++++++ .../scala/branch/branch.switchCase.scope | 31 +++---------- .../scala/branch/branch.switchCase2.scope | 21 +++++++++ 21 files changed, 293 insertions(+), 272 deletions(-) create mode 100644 data/fixtures/scopes/c/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/csharp/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/go/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/java/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/javascript.core/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/kotlin/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/python/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/r/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/r/branch/branch.switchCase3.scope create mode 100644 data/fixtures/scopes/rust/branch/branch.switchCase2.scope create mode 100644 data/fixtures/scopes/scala/branch/branch.switchCase2.scope diff --git a/data/fixtures/scopes/c/branch/branch.switchCase.scope b/data/fixtures/scopes/c/branch/branch.switchCase.scope index c67cd2b4cc..3588e59aa8 100644 --- a/data/fixtures/scopes/c/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/c/branch/branch.switchCase.scope @@ -1,44 +1,25 @@ switch (foo) { case 0: break; - default: {} } --- -[#1 Content] = -[#1 Domain] = 1:4-2:14 +[Content] = +[Domain] = 1:4-2:14 >------- 1| case 0: 2| break; --------------< -[#1 Removal] = 1:0-3:0 +[Removal] = 1:0-3:0 >----------- 1| case 0: 2| break; -3| default: {} +3| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| case 0: -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-3:15 - >-----------< -3| default: {} - -[#2 Removal] = 3:0-4:0 - >--------------- -3| default: {} -4| } - < - -[#2 Leading delimiter] = 3:0-3:4 - >----< -3| default: {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/branch/branch.switchCase2.scope b/data/fixtures/scopes/c/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..7a0666b69a --- /dev/null +++ b/data/fixtures/scopes/c/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +switch (foo) { + default: {} +} +--- + +[Content] = +[Domain] = 1:4-1:15 + >-----------< +1| default: {} + +[Removal] = 1:0-2:0 + >--------------- +1| default: {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| default: {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/branch/branch.switchCase.scope b/data/fixtures/scopes/csharp/branch/branch.switchCase.scope index c67cd2b4cc..3588e59aa8 100644 --- a/data/fixtures/scopes/csharp/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/csharp/branch/branch.switchCase.scope @@ -1,44 +1,25 @@ switch (foo) { case 0: break; - default: {} } --- -[#1 Content] = -[#1 Domain] = 1:4-2:14 +[Content] = +[Domain] = 1:4-2:14 >------- 1| case 0: 2| break; --------------< -[#1 Removal] = 1:0-3:0 +[Removal] = 1:0-3:0 >----------- 1| case 0: 2| break; -3| default: {} +3| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| case 0: -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-3:15 - >-----------< -3| default: {} - -[#2 Removal] = 3:0-4:0 - >--------------- -3| default: {} -4| } - < - -[#2 Leading delimiter] = 3:0-3:4 - >----< -3| default: {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/branch/branch.switchCase2.scope b/data/fixtures/scopes/csharp/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..7a0666b69a --- /dev/null +++ b/data/fixtures/scopes/csharp/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +switch (foo) { + default: {} +} +--- + +[Content] = +[Domain] = 1:4-1:15 + >-----------< +1| default: {} + +[Removal] = 1:0-2:0 + >--------------- +1| default: {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| default: {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/branch/branch.switchCase.scope b/data/fixtures/scopes/go/branch/branch.switchCase.scope index 2573c6a39a..473af1374e 100644 --- a/data/fixtures/scopes/go/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/go/branch/branch.switchCase.scope @@ -1,44 +1,25 @@ switch (foo) { case 0: break - default: {} } --- -[#1 Content] = -[#1 Domain] = 1:4-2:13 +[Content] = +[Domain] = 1:4-2:13 >------- 1| case 0: 2| break -------------< -[#1 Removal] = 1:0-3:0 +[Removal] = 1:0-3:0 >----------- 1| case 0: 2| break -3| default: {} +3| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| case 0: -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-3:15 - >-----------< -3| default: {} - -[#2 Removal] = 3:0-4:0 - >--------------- -3| default: {} -4| } - < - -[#2 Leading delimiter] = 3:0-3:4 - >----< -3| default: {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/branch/branch.switchCase2.scope b/data/fixtures/scopes/go/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..7a0666b69a --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +switch (foo) { + default: {} +} +--- + +[Content] = +[Domain] = 1:4-1:15 + >-----------< +1| default: {} + +[Removal] = 1:0-2:0 + >--------------- +1| default: {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| default: {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/branch/branch.switchCase.scope b/data/fixtures/scopes/java/branch/branch.switchCase.scope index c67cd2b4cc..3588e59aa8 100644 --- a/data/fixtures/scopes/java/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/java/branch/branch.switchCase.scope @@ -1,44 +1,25 @@ switch (foo) { case 0: break; - default: {} } --- -[#1 Content] = -[#1 Domain] = 1:4-2:14 +[Content] = +[Domain] = 1:4-2:14 >------- 1| case 0: 2| break; --------------< -[#1 Removal] = 1:0-3:0 +[Removal] = 1:0-3:0 >----------- 1| case 0: 2| break; -3| default: {} +3| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| case 0: -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-3:15 - >-----------< -3| default: {} - -[#2 Removal] = 3:0-4:0 - >--------------- -3| default: {} -4| } - < - -[#2 Leading delimiter] = 3:0-3:4 - >----< -3| default: {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/branch/branch.switchCase2.scope b/data/fixtures/scopes/java/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..7a0666b69a --- /dev/null +++ b/data/fixtures/scopes/java/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +switch (foo) { + default: {} +} +--- + +[Content] = +[Domain] = 1:4-1:15 + >-----------< +1| default: {} + +[Removal] = 1:0-2:0 + >--------------- +1| default: {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| default: {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/branch/branch.switchCase.scope b/data/fixtures/scopes/javascript.core/branch/branch.switchCase.scope index c67cd2b4cc..3588e59aa8 100644 --- a/data/fixtures/scopes/javascript.core/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/javascript.core/branch/branch.switchCase.scope @@ -1,44 +1,25 @@ switch (foo) { case 0: break; - default: {} } --- -[#1 Content] = -[#1 Domain] = 1:4-2:14 +[Content] = +[Domain] = 1:4-2:14 >------- 1| case 0: 2| break; --------------< -[#1 Removal] = 1:0-3:0 +[Removal] = 1:0-3:0 >----------- 1| case 0: 2| break; -3| default: {} +3| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| case 0: -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-3:15 - >-----------< -3| default: {} - -[#2 Removal] = 3:0-4:0 - >--------------- -3| default: {} -4| } - < - -[#2 Leading delimiter] = 3:0-3:4 - >----< -3| default: {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/branch/branch.switchCase2.scope b/data/fixtures/scopes/javascript.core/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..7a0666b69a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +switch (foo) { + default: {} +} +--- + +[Content] = +[Domain] = 1:4-1:15 + >-----------< +1| default: {} + +[Removal] = 1:0-2:0 + >--------------- +1| default: {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| default: {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/branch/branch.switchCase.scope b/data/fixtures/scopes/kotlin/branch/branch.switchCase.scope index a4db6df212..984ffb75db 100644 --- a/data/fixtures/scopes/kotlin/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/kotlin/branch/branch.switchCase.scope @@ -1,44 +1,25 @@ when (foo) { 0 -> break - else -> {} } --- -[#1 Content] = -[#1 Domain] = 1:4-2:13 +[Content] = +[Domain] = 1:4-2:13 >---- 1| 0 -> 2| break -------------< -[#1 Removal] = 1:0-3:0 +[Removal] = 1:0-3:0 >-------- 1| 0 -> 2| break -3| else -> {} +3| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| 0 -> -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-3:14 - >----------< -3| else -> {} - -[#2 Removal] = 3:0-4:0 - >-------------- -3| else -> {} -4| } - < - -[#2 Leading delimiter] = 3:0-3:4 - >----< -3| else -> {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/branch/branch.switchCase2.scope b/data/fixtures/scopes/kotlin/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..ed62079803 --- /dev/null +++ b/data/fixtures/scopes/kotlin/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +when (foo) { + else -> {} +} +--- + +[Content] = +[Domain] = 1:4-1:14 + >----------< +1| else -> {} + +[Removal] = 1:0-2:0 + >-------------- +1| else -> {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| else -> {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/branch/branch.switchCase.scope b/data/fixtures/scopes/python/branch/branch.switchCase.scope index 27b2d53dee..4fd1c6f272 100644 --- a/data/fixtures/scopes/python/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/python/branch/branch.switchCase.scope @@ -1,47 +1,24 @@ match foo: case 0: pass - case _: - pass --- -[#1 Content] = -[#1 Domain] = 1:4-2:12 +[Content] = +[Domain] = 1:4-2:12 >------- 1| case 0: 2| pass ------------< -[#1 Removal] = 1:0-3:0 - >----------- -1| case 0: -2| pass -3| case _: - < - -[#1 Leading delimiter] = 1:0-1:4 - >----< +[Removal] = 0:10-2:12 + > +0| match foo: 1| case 0: - -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 3:4-4:12 - >------- -3| case _: -4| pass - ------------< - -[#2 Removal] = 2:12-4:12 - > 2| pass -3| case _: -4| pass ------------< -[#2 Leading delimiter] = 3:0-3:4 +[Leading delimiter] = 1:0-1:4 >----< -3| case _: +1| case 0: -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/branch/branch.switchCase2.scope b/data/fixtures/scopes/python/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..5d92384f49 --- /dev/null +++ b/data/fixtures/scopes/python/branch/branch.switchCase2.scope @@ -0,0 +1,24 @@ +match foo: + case _: + pass +--- + +[Content] = +[Domain] = 1:4-2:12 + >------- +1| case _: +2| pass + ------------< + +[Removal] = 0:10-2:12 + > +0| match foo: +1| case _: +2| pass + ------------< + +[Leading delimiter] = 1:0-1:4 + >----< +1| case _: + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/r/branch/branch.switchCase.scope b/data/fixtures/scopes/r/branch/branch.switchCase.scope index 2b5fe6f85a..a1ea30e6dd 100644 --- a/data/fixtures/scopes/r/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/r/branch/branch.switchCase.scope @@ -1,55 +1,19 @@ switch(foo, a = 0, - b = {}, - "_" ) --- -[#1 Content] = -[#1 Domain] = 1:4-1:9 +[Content] = +[Domain] = 1:4-1:9 >-----< 1| a = 0, -[#1 Removal] = 1:0-1:9 +[Removal] = 1:0-1:9 >---------< 1| a = 0, -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| a = 0, -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 2:4-2:10 - >------< -2| b = {}, - -[#2 Removal] = 2:0-2:10 - >----------< -2| b = {}, - -[#2 Leading delimiter] = 2:0-2:4 - >----< -2| b = {}, - -[#2 Insertion delimiter] = "\n" - - -[#3 Content] = -[#3 Domain] = 3:4-3:7 - >---< -3| "_" - -[#3 Removal] = 3:0-4:0 - >------- -3| "_" -4| ) - < - -[#3 Leading delimiter] = 3:0-3:4 - >----< -3| "_" - -[#3 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/r/branch/branch.switchCase2.scope b/data/fixtures/scopes/r/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..b95f6607d2 --- /dev/null +++ b/data/fixtures/scopes/r/branch/branch.switchCase2.scope @@ -0,0 +1,19 @@ +switch(foo, + a = {}, +) +--- + +[Content] = +[Domain] = 1:4-1:10 + >------< +1| a = {}, + +[Removal] = 1:0-1:10 + >----------< +1| a = {}, + +[Leading delimiter] = 1:0-1:4 + >----< +1| a = {}, + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/r/branch/branch.switchCase3.scope b/data/fixtures/scopes/r/branch/branch.switchCase3.scope new file mode 100644 index 0000000000..8fc242c1c6 --- /dev/null +++ b/data/fixtures/scopes/r/branch/branch.switchCase3.scope @@ -0,0 +1,21 @@ +switch(foo, + "_" +) +--- + +[Content] = +[Domain] = 1:4-1:7 + >---< +1| "_" + +[Removal] = 1:0-2:0 + >------- +1| "_" +2| ) + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| "_" + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/branch/branch.switchCase.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.scope index 26ac8d3a4e..a40418f19c 100644 --- a/data/fixtures/scopes/rust/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/rust/branch/branch.switchCase.scope @@ -1,40 +1,21 @@ match foo { 0 => "0", - _ => "_", } --- -[#1 Content] = -[#1 Domain] = 1:4-1:13 +[Content] = +[Domain] = 1:4-1:13 >---------< 1| 0 => "0", -[#1 Removal] = 1:0-2:0 +[Removal] = 1:0-2:0 >------------- 1| 0 => "0", -2| _ => "_", +2| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| 0 => "0", -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 2:4-2:13 - >---------< -2| _ => "_", - -[#2 Removal] = 2:0-3:0 - >------------- -2| _ => "_", -3| } - < - -[#2 Leading delimiter] = 2:0-2:4 - >----< -2| _ => "_", - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/branch/branch.switchCase2.scope b/data/fixtures/scopes/rust/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..3cfac0b98f --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +match foo { + _ => "_", +} +--- + +[Content] = +[Domain] = 1:4-1:13 + >---------< +1| _ => "_", + +[Removal] = 1:0-2:0 + >------------- +1| _ => "_", +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| _ => "_", + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/branch/branch.switchCase.scope b/data/fixtures/scopes/scala/branch/branch.switchCase.scope index 224bda36a1..9a813d0afd 100644 --- a/data/fixtures/scopes/scala/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/scala/branch/branch.switchCase.scope @@ -1,40 +1,21 @@ foo match { case 0 => 0 - case _ => {} } --- -[#1 Content] = -[#1 Domain] = 1:4-1:15 +[Content] = +[Domain] = 1:4-1:15 >-----------< 1| case 0 => 0 -[#1 Removal] = 1:0-2:0 +[Removal] = 1:0-2:0 >--------------- 1| case 0 => 0 -2| case _ => {} +2| } < -[#1 Leading delimiter] = 1:0-1:4 +[Leading delimiter] = 1:0-1:4 >----< 1| case 0 => 0 -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 2:4-2:16 - >------------< -2| case _ => {} - -[#2 Removal] = 2:0-3:0 - >---------------- -2| case _ => {} -3| } - < - -[#2 Leading delimiter] = 2:0-2:4 - >----< -2| case _ => {} - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/branch/branch.switchCase2.scope b/data/fixtures/scopes/scala/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..01f1719ac9 --- /dev/null +++ b/data/fixtures/scopes/scala/branch/branch.switchCase2.scope @@ -0,0 +1,21 @@ +foo match { + case _ => {} +} +--- + +[Content] = +[Domain] = 1:4-1:16 + >------------< +1| case _ => {} + +[Removal] = 1:0-2:0 + >---------------- +1| case _ => {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| case _ => {} + +[Insertion delimiter] = "\n"