From 4e88f0db580f3eb51d7323ac2ea884e06d619347 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Mon, 30 Jun 2025 11:21:42 +0200 Subject: [PATCH 1/6] Added more facets to interior scope --- ...ior.loop3.scope => interior.doWhile.scope} | 0 ...interior.loop.scope => interior.for.scope} | 0 data/fixtures/scopes/c/interior.switch.scope | 37 +++++++++ ...erior.loop2.scope => interior.while.scope} | 0 data/fixtures/scopes/cpp/interior.class.scope | 25 ++++++ .../scopes/cpp/interior.constructor.scope | 81 +++++++++++++++++++ .../scopes/cpp/interior.foreach.scope | 37 +++++++++ ...mbda.scope => interior.lambda.block.scope} | 0 .../interior.method.scope} | 50 ++++++------ .../scopes/cpp/interior.namespace.scope | 25 ++++++ .../scopes/csharp/interior.constructor.scope | 81 +++++++++++++++++++ ...ior.loop2.scope => interior.doWhile.scope} | 0 ...nterior.loop3.scope => interior.for.scope} | 0 ...ior.loop4.scope => interior.foreach.scope} | 0 ...bda2.scope => interior.lambda.block.scope} | 0 ...scope => interior.lambda.expression.scope} | 0 .../interior.method.scope} | 50 ++++++------ .../scopes/csharp/interior.switch.scope | 37 +++++++++ .../scopes/csharp/interior.switchCase.scope | 36 ++++----- ...terior.loop.scope => interior.while.scope} | 0 .../scopes/java/interior.constructor.scope | 81 +++++++++++++++++++ ...ior.loop3.scope => interior.doWhile.scope} | 0 ...interior.loop.scope => interior.for.scope} | 0 .../scopes/java/interior.foreach.scope | 37 +++++++++ ...mbda.scope => interior.lambda.block.scope} | 0 ...scope => interior.lambda.expression.scope} | 0 .../fixtures/scopes/java/interior.loop4.scope | 37 --------- .../scopes/java/interior.method.scope | 81 +++++++++++++++++++ .../scopes/java/interior.switch.scope | 37 +++++++++ ...erior.loop2.scope => interior.while.scope} | 0 ...ior.loop3.scope => interior.doWhile.scope} | 0 ...interior.loop.scope => interior.for.scope} | 0 ...ior.loop4.scope => interior.foreach.scope} | 0 ...or.loop5.scope => interior.foreach2.scope} | 0 ...mbda.scope => interior.lambda.block.scope} | 0 ...scope => interior.lambda.expression.scope} | 0 .../javascript.core/interior.switch.scope | 2 + ...erior.loop2.scope => interior.while.scope} | 0 ...rior.loop.scope => interior.foreach.scope} | 0 ...scope => interior.lambda.expression.scope} | 0 ...cope => interior.lambda.expression2.scope} | 0 .../scopes/python/interior.switch.scope | 33 ++++++++ .../scopes/python/interior.switchCase.scope | 77 ++++++++++-------- ...erior.loop2.scope => interior.while.scope} | 0 packages/common/src/scopeSupportFacets/c.ts | 15 +++- packages/common/src/scopeSupportFacets/cpp.ts | 12 ++- .../common/src/scopeSupportFacets/csharp.ts | 13 ++- packages/common/src/scopeSupportFacets/css.ts | 13 ++- .../common/src/scopeSupportFacets/html.ts | 13 ++- .../common/src/scopeSupportFacets/java.ts | 15 +++- .../src/scopeSupportFacets/javascript.ts | 13 ++- .../common/src/scopeSupportFacets/json.ts | 13 ++- .../common/src/scopeSupportFacets/markdown.ts | 13 ++- .../common/src/scopeSupportFacets/python.ts | 13 ++- packages/common/src/scopeSupportFacets/r.ts | 3 +- packages/common/src/scopeSupportFacets/scm.ts | 13 ++- .../scopeSupportFacetInfos.ts | 78 +++++++++++++----- .../scopeSupportFacets.types.ts | 13 ++- .../common/src/scopeSupportFacets/talon.ts | 13 ++- packages/common/src/scopeSupportFacets/xml.ts | 13 ++- .../common/src/scopeSupportFacets/yaml.ts | 13 ++- queries/cpp.scm | 21 ++++- 62 files changed, 949 insertions(+), 195 deletions(-) rename data/fixtures/scopes/c/{interior.loop3.scope => interior.doWhile.scope} (100%) rename data/fixtures/scopes/c/{interior.loop.scope => interior.for.scope} (100%) create mode 100644 data/fixtures/scopes/c/interior.switch.scope rename data/fixtures/scopes/c/{interior.loop2.scope => interior.while.scope} (100%) create mode 100644 data/fixtures/scopes/cpp/interior.class.scope create mode 100644 data/fixtures/scopes/cpp/interior.constructor.scope create mode 100644 data/fixtures/scopes/cpp/interior.foreach.scope rename data/fixtures/scopes/cpp/{interior.lambda.scope => interior.lambda.block.scope} (100%) rename data/fixtures/scopes/{java/interior.function.scope => cpp/interior.method.scope} (55%) create mode 100644 data/fixtures/scopes/cpp/interior.namespace.scope create mode 100644 data/fixtures/scopes/csharp/interior.constructor.scope rename data/fixtures/scopes/csharp/{interior.loop2.scope => interior.doWhile.scope} (100%) rename data/fixtures/scopes/csharp/{interior.loop3.scope => interior.for.scope} (100%) rename data/fixtures/scopes/csharp/{interior.loop4.scope => interior.foreach.scope} (100%) rename data/fixtures/scopes/csharp/{interior.lambda2.scope => interior.lambda.block.scope} (100%) rename data/fixtures/scopes/csharp/{interior.lambda.scope => interior.lambda.expression.scope} (100%) rename data/fixtures/scopes/{java/interior.function2.scope => csharp/interior.method.scope} (53%) create mode 100644 data/fixtures/scopes/csharp/interior.switch.scope rename data/fixtures/scopes/csharp/{interior.loop.scope => interior.while.scope} (100%) create mode 100644 data/fixtures/scopes/java/interior.constructor.scope rename data/fixtures/scopes/java/{interior.loop3.scope => interior.doWhile.scope} (100%) rename data/fixtures/scopes/java/{interior.loop.scope => interior.for.scope} (100%) create mode 100644 data/fixtures/scopes/java/interior.foreach.scope rename data/fixtures/scopes/java/{interior.lambda.scope => interior.lambda.block.scope} (100%) rename data/fixtures/scopes/java/{interior.lambda2.scope => interior.lambda.expression.scope} (100%) delete mode 100644 data/fixtures/scopes/java/interior.loop4.scope create mode 100644 data/fixtures/scopes/java/interior.method.scope create mode 100644 data/fixtures/scopes/java/interior.switch.scope rename data/fixtures/scopes/java/{interior.loop2.scope => interior.while.scope} (100%) rename data/fixtures/scopes/javascript.core/{interior.loop3.scope => interior.doWhile.scope} (100%) rename data/fixtures/scopes/javascript.core/{interior.loop.scope => interior.for.scope} (100%) rename data/fixtures/scopes/javascript.core/{interior.loop4.scope => interior.foreach.scope} (100%) rename data/fixtures/scopes/javascript.core/{interior.loop5.scope => interior.foreach2.scope} (100%) rename data/fixtures/scopes/javascript.core/{interior.lambda.scope => interior.lambda.block.scope} (100%) rename data/fixtures/scopes/javascript.core/{interior.lambda2.scope => interior.lambda.expression.scope} (100%) create mode 100644 data/fixtures/scopes/javascript.core/interior.switch.scope rename data/fixtures/scopes/javascript.core/{interior.loop2.scope => interior.while.scope} (100%) rename data/fixtures/scopes/python/{interior.loop.scope => interior.foreach.scope} (100%) rename data/fixtures/scopes/python/{interior.lambda.scope => interior.lambda.expression.scope} (100%) rename data/fixtures/scopes/python/{interior.lambda2.scope => interior.lambda.expression2.scope} (100%) create mode 100644 data/fixtures/scopes/python/interior.switch.scope rename data/fixtures/scopes/python/{interior.loop2.scope => interior.while.scope} (100%) diff --git a/data/fixtures/scopes/c/interior.loop3.scope b/data/fixtures/scopes/c/interior.doWhile.scope similarity index 100% rename from data/fixtures/scopes/c/interior.loop3.scope rename to data/fixtures/scopes/c/interior.doWhile.scope diff --git a/data/fixtures/scopes/c/interior.loop.scope b/data/fixtures/scopes/c/interior.for.scope similarity index 100% rename from data/fixtures/scopes/c/interior.loop.scope rename to data/fixtures/scopes/c/interior.for.scope diff --git a/data/fixtures/scopes/c/interior.switch.scope b/data/fixtures/scopes/c/interior.switch.scope new file mode 100644 index 0000000000..e2ad168b18 --- /dev/null +++ b/data/fixtures/scopes/c/interior.switch.scope @@ -0,0 +1,37 @@ +switch (value) { } +--- + +[#1 Content] = +[#1 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#1 Domain] = 0:0-0:18 + >------------------< +0| switch (value) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:8-0:13 + >-----< +0| switch (value) { } + +[#2 Domain] = 0:7-0:14 + >-------< +0| switch (value) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#3 Domain] = 0:15-0:18 + >---< +0| switch (value) { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior.loop2.scope b/data/fixtures/scopes/c/interior.while.scope similarity index 100% rename from data/fixtures/scopes/c/interior.loop2.scope rename to data/fixtures/scopes/c/interior.while.scope diff --git a/data/fixtures/scopes/cpp/interior.class.scope b/data/fixtures/scopes/cpp/interior.class.scope new file mode 100644 index 0000000000..d6791ac419 --- /dev/null +++ b/data/fixtures/scopes/cpp/interior.class.scope @@ -0,0 +1,25 @@ +class MyClass { } +--- + +[#1 Content] = +[#1 Removal] = 0:15-0:16 + >-< +0| class MyClass { } + +[#1 Domain] = 0:0-0:17 + >-----------------< +0| class MyClass { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:15-0:16 + >-< +0| class MyClass { } + +[#2 Domain] = 0:14-0:17 + >---< +0| class MyClass { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior.constructor.scope b/data/fixtures/scopes/cpp/interior.constructor.scope new file mode 100644 index 0000000000..3f20dbf0b9 --- /dev/null +++ b/data/fixtures/scopes/cpp/interior.constructor.scope @@ -0,0 +1,81 @@ +class MyClass { + MyClass() { } +} +--- + +[#1 Content] = 1:4-1:17 + >-------------< +1| MyClass() { } + +[#1 Removal] = 0:15-2:0 + > +0| class MyClass { +1| MyClass() { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:17 + >-------------< +1| MyClass() { } + +[#2 Removal] = 0:15-2:0 + > +0| class MyClass { +1| MyClass() { } +2| } + < + +[#2 Domain] = 0:14-2:1 + >- +0| class MyClass { +1| MyClass() { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:15-1:16 + >-< +1| MyClass() { } + +[#3 Domain] = 1:4-1:17 + >-------------< +1| MyClass() { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:12-1:12 + >< +1| MyClass() { } + +[#4 Domain] = 1:11-1:13 + >--< +1| MyClass() { } + +[#4 Insertion delimiter] = " " + + +[#5 Content] = +[#5 Removal] = 1:15-1:16 + >-< +1| MyClass() { } + +[#5 Domain] = 1:14-1:17 + >---< +1| MyClass() { } + +[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior.foreach.scope b/data/fixtures/scopes/cpp/interior.foreach.scope new file mode 100644 index 0000000000..ca72187b39 --- /dev/null +++ b/data/fixtures/scopes/cpp/interior.foreach.scope @@ -0,0 +1,37 @@ +for (int value : values) { } +--- + +[#1 Content] = +[#1 Removal] = 0:26-0:27 + >-< +0| for (int value : values) { } + +[#1 Domain] = 0:0-0:28 + >----------------------------< +0| for (int value : values) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:5-0:23 + >------------------< +0| for (int value : values) { } + +[#2 Domain] = 0:4-0:24 + >--------------------< +0| for (int value : values) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:26-0:27 + >-< +0| for (int value : values) { } + +[#3 Domain] = 0:25-0:28 + >---< +0| for (int value : values) { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior.lambda.scope b/data/fixtures/scopes/cpp/interior.lambda.block.scope similarity index 100% rename from data/fixtures/scopes/cpp/interior.lambda.scope rename to data/fixtures/scopes/cpp/interior.lambda.block.scope diff --git a/data/fixtures/scopes/java/interior.function.scope b/data/fixtures/scopes/cpp/interior.method.scope similarity index 55% rename from data/fixtures/scopes/java/interior.function.scope rename to data/fixtures/scopes/cpp/interior.method.scope index f6ec2af746..126a5a1731 100644 --- a/data/fixtures/scopes/java/interior.function.scope +++ b/data/fixtures/scopes/cpp/interior.method.scope @@ -1,23 +1,23 @@ -class Foo { - void bar() { } +class MyClass { + void foo() { } } --- [#1 Content] = 1:4-1:18 >--------------< -1| void bar() { } +1| void foo() { } -[#1 Removal] = 0:11-2:0 - > -0| class Foo { -1| void bar() { } +[#1 Removal] = 0:15-2:0 + > +0| class MyClass { +1| void foo() { } 2| } < [#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| void bar() { } + >--------------- +0| class MyClass { +1| void foo() { } 2| } -< @@ -26,19 +26,19 @@ class Foo { [#2 Content] = 1:4-1:18 >--------------< -1| void bar() { } +1| void foo() { } -[#2 Removal] = 0:11-2:0 - > -0| class Foo { -1| void bar() { } +[#2 Removal] = 0:15-2:0 + > +0| class MyClass { +1| void foo() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| void bar() { } +[#2 Domain] = 0:14-2:1 + >- +0| class MyClass { +1| void foo() { } 2| } -< @@ -48,11 +48,11 @@ class Foo { [#3 Content] = [#3 Removal] = 1:16-1:17 >-< -1| void bar() { } +1| void foo() { } [#3 Domain] = 1:4-1:18 >--------------< -1| void bar() { } +1| void foo() { } [#3 Insertion delimiter] = " " @@ -60,11 +60,11 @@ class Foo { [#4 Content] = [#4 Removal] = 1:13-1:13 >< -1| void bar() { } +1| void foo() { } [#4 Domain] = 1:12-1:14 >--< -1| void bar() { } +1| void foo() { } [#4 Insertion delimiter] = " " @@ -72,10 +72,10 @@ class Foo { [#5 Content] = [#5 Removal] = 1:16-1:17 >-< -1| void bar() { } +1| void foo() { } [#5 Domain] = 1:15-1:18 >---< -1| void bar() { } +1| void foo() { } [#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior.namespace.scope b/data/fixtures/scopes/cpp/interior.namespace.scope new file mode 100644 index 0000000000..a1ad98ebff --- /dev/null +++ b/data/fixtures/scopes/cpp/interior.namespace.scope @@ -0,0 +1,25 @@ +namespace NS { } +--- + +[#1 Content] = +[#1 Removal] = 0:14-0:15 + >-< +0| namespace NS { } + +[#1 Domain] = 0:0-0:16 + >----------------< +0| namespace NS { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:14-0:15 + >-< +0| namespace NS { } + +[#2 Domain] = 0:13-0:16 + >---< +0| namespace NS { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior.constructor.scope b/data/fixtures/scopes/csharp/interior.constructor.scope new file mode 100644 index 0000000000..0f109078ff --- /dev/null +++ b/data/fixtures/scopes/csharp/interior.constructor.scope @@ -0,0 +1,81 @@ +class Program { + public Program() { } +} +--- + +[#1 Content] = 1:4-1:24 + >--------------------< +1| public Program() { } + +[#1 Removal] = 0:15-2:0 + > +0| class Program { +1| public Program() { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class Program { +1| public Program() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:24 + >--------------------< +1| public Program() { } + +[#2 Removal] = 0:15-2:0 + > +0| class Program { +1| public Program() { } +2| } + < + +[#2 Domain] = 0:14-2:1 + >- +0| class Program { +1| public Program() { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:22-1:23 + >-< +1| public Program() { } + +[#3 Domain] = 1:4-1:24 + >--------------------< +1| public Program() { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:19-1:19 + >< +1| public Program() { } + +[#4 Domain] = 1:18-1:20 + >--< +1| public Program() { } + +[#4 Insertion delimiter] = " " + + +[#5 Content] = +[#5 Removal] = 1:22-1:23 + >-< +1| public Program() { } + +[#5 Domain] = 1:21-1:24 + >---< +1| public Program() { } + +[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior.loop2.scope b/data/fixtures/scopes/csharp/interior.doWhile.scope similarity index 100% rename from data/fixtures/scopes/csharp/interior.loop2.scope rename to data/fixtures/scopes/csharp/interior.doWhile.scope diff --git a/data/fixtures/scopes/csharp/interior.loop3.scope b/data/fixtures/scopes/csharp/interior.for.scope similarity index 100% rename from data/fixtures/scopes/csharp/interior.loop3.scope rename to data/fixtures/scopes/csharp/interior.for.scope diff --git a/data/fixtures/scopes/csharp/interior.loop4.scope b/data/fixtures/scopes/csharp/interior.foreach.scope similarity index 100% rename from data/fixtures/scopes/csharp/interior.loop4.scope rename to data/fixtures/scopes/csharp/interior.foreach.scope diff --git a/data/fixtures/scopes/csharp/interior.lambda2.scope b/data/fixtures/scopes/csharp/interior.lambda.block.scope similarity index 100% rename from data/fixtures/scopes/csharp/interior.lambda2.scope rename to data/fixtures/scopes/csharp/interior.lambda.block.scope diff --git a/data/fixtures/scopes/csharp/interior.lambda.scope b/data/fixtures/scopes/csharp/interior.lambda.expression.scope similarity index 100% rename from data/fixtures/scopes/csharp/interior.lambda.scope rename to data/fixtures/scopes/csharp/interior.lambda.expression.scope diff --git a/data/fixtures/scopes/java/interior.function2.scope b/data/fixtures/scopes/csharp/interior.method.scope similarity index 53% rename from data/fixtures/scopes/java/interior.function2.scope rename to data/fixtures/scopes/csharp/interior.method.scope index 4e6bb1ebee..6a03249aa3 100644 --- a/data/fixtures/scopes/java/interior.function2.scope +++ b/data/fixtures/scopes/csharp/interior.method.scope @@ -1,23 +1,23 @@ -class Foo { - public void bar() { } +class Program { + public void foo() { } } --- [#1 Content] = 1:4-1:25 >---------------------< -1| public void bar() { } +1| public void foo() { } -[#1 Removal] = 0:11-2:0 - > -0| class Foo { -1| public void bar() { } +[#1 Removal] = 0:15-2:0 + > +0| class Program { +1| public void foo() { } 2| } < [#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| public void bar() { } + >--------------- +0| class Program { +1| public void foo() { } 2| } -< @@ -26,19 +26,19 @@ class Foo { [#2 Content] = 1:4-1:25 >---------------------< -1| public void bar() { } +1| public void foo() { } -[#2 Removal] = 0:11-2:0 - > -0| class Foo { -1| public void bar() { } +[#2 Removal] = 0:15-2:0 + > +0| class Program { +1| public void foo() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| public void bar() { } +[#2 Domain] = 0:14-2:1 + >- +0| class Program { +1| public void foo() { } 2| } -< @@ -48,11 +48,11 @@ class Foo { [#3 Content] = [#3 Removal] = 1:23-1:24 >-< -1| public void bar() { } +1| public void foo() { } [#3 Domain] = 1:4-1:25 >---------------------< -1| public void bar() { } +1| public void foo() { } [#3 Insertion delimiter] = " " @@ -60,11 +60,11 @@ class Foo { [#4 Content] = [#4 Removal] = 1:20-1:20 >< -1| public void bar() { } +1| public void foo() { } [#4 Domain] = 1:19-1:21 >--< -1| public void bar() { } +1| public void foo() { } [#4 Insertion delimiter] = " " @@ -72,10 +72,10 @@ class Foo { [#5 Content] = [#5 Removal] = 1:23-1:24 >-< -1| public void bar() { } +1| public void foo() { } [#5 Domain] = 1:22-1:25 >---< -1| public void bar() { } +1| public void foo() { } [#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior.switch.scope b/data/fixtures/scopes/csharp/interior.switch.scope new file mode 100644 index 0000000000..e2ad168b18 --- /dev/null +++ b/data/fixtures/scopes/csharp/interior.switch.scope @@ -0,0 +1,37 @@ +switch (value) { } +--- + +[#1 Content] = +[#1 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#1 Domain] = 0:0-0:18 + >------------------< +0| switch (value) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:8-0:13 + >-----< +0| switch (value) { } + +[#2 Domain] = 0:7-0:14 + >-------< +0| switch (value) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#3 Domain] = 0:15-0:18 + >---< +0| switch (value) { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior.switchCase.scope b/data/fixtures/scopes/csharp/interior.switchCase.scope index c0c5b32760..58797959fa 100644 --- a/data/fixtures/scopes/csharp/interior.switchCase.scope +++ b/data/fixtures/scopes/csharp/interior.switchCase.scope @@ -1,4 +1,4 @@ -switch (aaa) { +switch (value) { case 0: foo; break; @@ -22,9 +22,9 @@ switch (aaa) { 8| break; --------------< -[#1 Removal] = 0:14-9:0 - > -0| switch (aaa) { +[#1 Removal] = 0:16-9:0 + > +0| switch (value) { 1| case 0: 2| foo; 3| break; @@ -37,8 +37,8 @@ switch (aaa) { < [#1 Domain] = 0:0-9:1 - >-------------- -0| switch (aaa) { + >---------------- +0| switch (value) { 1| case 0: 2| foo; 3| break; @@ -54,13 +54,13 @@ switch (aaa) { [#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (aaa) { +[#2 Removal] = 0:8-0:13 + >-----< +0| switch (value) { -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (aaa) { +[#2 Domain] = 0:7-0:14 + >-------< +0| switch (value) { [#2 Insertion delimiter] = " " @@ -77,9 +77,9 @@ switch (aaa) { 8| break; --------------< -[#3 Removal] = 0:14-9:0 - > -0| switch (aaa) { +[#3 Removal] = 0:16-9:0 + > +0| switch (value) { 1| case 0: 2| foo; 3| break; @@ -91,9 +91,9 @@ switch (aaa) { 9| } < -[#3 Domain] = 0:13-9:1 - >- -0| switch (aaa) { +[#3 Domain] = 0:15-9:1 + >- +0| switch (value) { 1| case 0: 2| foo; 3| break; diff --git a/data/fixtures/scopes/csharp/interior.loop.scope b/data/fixtures/scopes/csharp/interior.while.scope similarity index 100% rename from data/fixtures/scopes/csharp/interior.loop.scope rename to data/fixtures/scopes/csharp/interior.while.scope diff --git a/data/fixtures/scopes/java/interior.constructor.scope b/data/fixtures/scopes/java/interior.constructor.scope new file mode 100644 index 0000000000..8fb5ad6349 --- /dev/null +++ b/data/fixtures/scopes/java/interior.constructor.scope @@ -0,0 +1,81 @@ +public class MyClass { + public MyClass() { } +} +--- + +[#1 Content] = 1:4-1:24 + >--------------------< +1| public MyClass() { } + +[#1 Removal] = 0:22-2:0 + > +0| public class MyClass { +1| public MyClass() { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public MyClass() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:24 + >--------------------< +1| public MyClass() { } + +[#2 Removal] = 0:22-2:0 + > +0| public class MyClass { +1| public MyClass() { } +2| } + < + +[#2 Domain] = 0:21-2:1 + >- +0| public class MyClass { +1| public MyClass() { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:22-1:23 + >-< +1| public MyClass() { } + +[#3 Domain] = 1:4-1:24 + >--------------------< +1| public MyClass() { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:19-1:19 + >< +1| public MyClass() { } + +[#4 Domain] = 1:18-1:20 + >--< +1| public MyClass() { } + +[#4 Insertion delimiter] = " " + + +[#5 Content] = +[#5 Removal] = 1:22-1:23 + >-< +1| public MyClass() { } + +[#5 Domain] = 1:21-1:24 + >---< +1| public MyClass() { } + +[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.loop3.scope b/data/fixtures/scopes/java/interior.doWhile.scope similarity index 100% rename from data/fixtures/scopes/java/interior.loop3.scope rename to data/fixtures/scopes/java/interior.doWhile.scope diff --git a/data/fixtures/scopes/java/interior.loop.scope b/data/fixtures/scopes/java/interior.for.scope similarity index 100% rename from data/fixtures/scopes/java/interior.loop.scope rename to data/fixtures/scopes/java/interior.for.scope diff --git a/data/fixtures/scopes/java/interior.foreach.scope b/data/fixtures/scopes/java/interior.foreach.scope new file mode 100644 index 0000000000..4d90296637 --- /dev/null +++ b/data/fixtures/scopes/java/interior.foreach.scope @@ -0,0 +1,37 @@ +for (int v : values) { } +--- + +[#1 Content] = +[#1 Removal] = 0:22-0:23 + >-< +0| for (int v : values) { } + +[#1 Domain] = 0:0-0:24 + >------------------------< +0| for (int v : values) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:5-0:19 + >--------------< +0| for (int v : values) { } + +[#2 Domain] = 0:4-0:20 + >----------------< +0| for (int v : values) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:22-0:23 + >-< +0| for (int v : values) { } + +[#3 Domain] = 0:21-0:24 + >---< +0| for (int v : values) { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.lambda.scope b/data/fixtures/scopes/java/interior.lambda.block.scope similarity index 100% rename from data/fixtures/scopes/java/interior.lambda.scope rename to data/fixtures/scopes/java/interior.lambda.block.scope diff --git a/data/fixtures/scopes/java/interior.lambda2.scope b/data/fixtures/scopes/java/interior.lambda.expression.scope similarity index 100% rename from data/fixtures/scopes/java/interior.lambda2.scope rename to data/fixtures/scopes/java/interior.lambda.expression.scope diff --git a/data/fixtures/scopes/java/interior.loop4.scope b/data/fixtures/scopes/java/interior.loop4.scope deleted file mode 100644 index 634c2411cf..0000000000 --- a/data/fixtures/scopes/java/interior.loop4.scope +++ /dev/null @@ -1,37 +0,0 @@ -for (final int v : values) { } ---- - -[#1 Content] = -[#1 Removal] = 0:28-0:29 - >-< -0| for (final int v : values) { } - -[#1 Domain] = 0:0-0:30 - >------------------------------< -0| for (final int v : values) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:25 - >--------------------< -0| for (final int v : values) { } - -[#2 Domain] = 0:4-0:26 - >----------------------< -0| for (final int v : values) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:28-0:29 - >-< -0| for (final int v : values) { } - -[#3 Domain] = 0:27-0:30 - >---< -0| for (final int v : values) { } - -[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.method.scope b/data/fixtures/scopes/java/interior.method.scope new file mode 100644 index 0000000000..dbc363f02e --- /dev/null +++ b/data/fixtures/scopes/java/interior.method.scope @@ -0,0 +1,81 @@ +public class MyClass { + public void foo() { } +} +--- + +[#1 Content] = 1:4-1:25 + >---------------------< +1| public void foo() { } + +[#1 Removal] = 0:22-2:0 + > +0| public class MyClass { +1| public void foo() { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public void foo() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:25 + >---------------------< +1| public void foo() { } + +[#2 Removal] = 0:22-2:0 + > +0| public class MyClass { +1| public void foo() { } +2| } + < + +[#2 Domain] = 0:21-2:1 + >- +0| public class MyClass { +1| public void foo() { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:23-1:24 + >-< +1| public void foo() { } + +[#3 Domain] = 1:4-1:25 + >---------------------< +1| public void foo() { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:20-1:20 + >< +1| public void foo() { } + +[#4 Domain] = 1:19-1:21 + >--< +1| public void foo() { } + +[#4 Insertion delimiter] = " " + + +[#5 Content] = +[#5 Removal] = 1:23-1:24 + >-< +1| public void foo() { } + +[#5 Domain] = 1:22-1:25 + >---< +1| public void foo() { } + +[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.switch.scope b/data/fixtures/scopes/java/interior.switch.scope new file mode 100644 index 0000000000..e2ad168b18 --- /dev/null +++ b/data/fixtures/scopes/java/interior.switch.scope @@ -0,0 +1,37 @@ +switch (value) { } +--- + +[#1 Content] = +[#1 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#1 Domain] = 0:0-0:18 + >------------------< +0| switch (value) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:8-0:13 + >-----< +0| switch (value) { } + +[#2 Domain] = 0:7-0:14 + >-------< +0| switch (value) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#3 Domain] = 0:15-0:18 + >---< +0| switch (value) { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.loop2.scope b/data/fixtures/scopes/java/interior.while.scope similarity index 100% rename from data/fixtures/scopes/java/interior.loop2.scope rename to data/fixtures/scopes/java/interior.while.scope diff --git a/data/fixtures/scopes/javascript.core/interior.loop3.scope b/data/fixtures/scopes/javascript.core/interior.doWhile.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.loop3.scope rename to data/fixtures/scopes/javascript.core/interior.doWhile.scope diff --git a/data/fixtures/scopes/javascript.core/interior.loop.scope b/data/fixtures/scopes/javascript.core/interior.for.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.loop.scope rename to data/fixtures/scopes/javascript.core/interior.for.scope diff --git a/data/fixtures/scopes/javascript.core/interior.loop4.scope b/data/fixtures/scopes/javascript.core/interior.foreach.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.loop4.scope rename to data/fixtures/scopes/javascript.core/interior.foreach.scope diff --git a/data/fixtures/scopes/javascript.core/interior.loop5.scope b/data/fixtures/scopes/javascript.core/interior.foreach2.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.loop5.scope rename to data/fixtures/scopes/javascript.core/interior.foreach2.scope diff --git a/data/fixtures/scopes/javascript.core/interior.lambda.scope b/data/fixtures/scopes/javascript.core/interior.lambda.block.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.lambda.scope rename to data/fixtures/scopes/javascript.core/interior.lambda.block.scope diff --git a/data/fixtures/scopes/javascript.core/interior.lambda2.scope b/data/fixtures/scopes/javascript.core/interior.lambda.expression.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.lambda2.scope rename to data/fixtures/scopes/javascript.core/interior.lambda.expression.scope diff --git a/data/fixtures/scopes/javascript.core/interior.switch.scope b/data/fixtures/scopes/javascript.core/interior.switch.scope new file mode 100644 index 0000000000..8dc971b0c4 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/interior.switch.scope @@ -0,0 +1,2 @@ +switch (value) { } +--- diff --git a/data/fixtures/scopes/javascript.core/interior.loop2.scope b/data/fixtures/scopes/javascript.core/interior.while.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.loop2.scope rename to data/fixtures/scopes/javascript.core/interior.while.scope diff --git a/data/fixtures/scopes/python/interior.loop.scope b/data/fixtures/scopes/python/interior.foreach.scope similarity index 100% rename from data/fixtures/scopes/python/interior.loop.scope rename to data/fixtures/scopes/python/interior.foreach.scope diff --git a/data/fixtures/scopes/python/interior.lambda.scope b/data/fixtures/scopes/python/interior.lambda.expression.scope similarity index 100% rename from data/fixtures/scopes/python/interior.lambda.scope rename to data/fixtures/scopes/python/interior.lambda.expression.scope diff --git a/data/fixtures/scopes/python/interior.lambda2.scope b/data/fixtures/scopes/python/interior.lambda.expression2.scope similarity index 100% rename from data/fixtures/scopes/python/interior.lambda2.scope rename to data/fixtures/scopes/python/interior.lambda.expression2.scope diff --git a/data/fixtures/scopes/python/interior.switch.scope b/data/fixtures/scopes/python/interior.switch.scope new file mode 100644 index 0000000000..9e54a4a1db --- /dev/null +++ b/data/fixtures/scopes/python/interior.switch.scope @@ -0,0 +1,33 @@ +match value: + case 0: pass +--- + +[#1 Content] = 1:4-1:16 + >------------< +1| case 0: pass + +[#1 Removal] = 0:12-1:16 + > +0| match value: +1| case 0: pass + ----------------< + +[#1 Domain] = 0:0-1:16 + >------------ +0| match value: +1| case 0: pass + ----------------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:12-1:16 + >----< +1| case 0: pass + +[#2 Domain] = 1:4-1:16 + >------------< +1| case 0: pass + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.switchCase.scope b/data/fixtures/scopes/python/interior.switchCase.scope index 45502c3ade..c8f89f9a36 100644 --- a/data/fixtures/scopes/python/interior.switchCase.scope +++ b/data/fixtures/scopes/python/interior.switchCase.scope @@ -1,62 +1,69 @@ match value: - case 1: - a + case 0: + foo + pass case _: - b + pass --- -[#1 Content] = 1:4-4:9 +[#1 Content] = 1:4-5:12 >------- -1| case 1: -2| a -3| case _: -4| b - ---------< +1| case 0: +2| foo +3| pass +4| case _: +5| pass + ------------< -[#1 Removal] = 0:12-4:9 +[#1 Removal] = 0:12-5:12 > 0| match value: -1| case 1: -2| a -3| case _: -4| b - ---------< +1| case 0: +2| foo +3| pass +4| case _: +5| pass + ------------< -[#1 Domain] = 0:0-4:9 +[#1 Domain] = 0:0-5:12 >------------ 0| match value: -1| case 1: -2| a -3| case _: -4| b - ---------< +1| case 0: +2| foo +3| pass +4| case _: +5| pass + ------------< [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 2:8-2:9 - >-< -2| a +[#2 Removal] = 2:8-3:12 + >--- +2| foo +3| pass + ------------< -[#2 Domain] = 1:4-2:9 +[#2 Domain] = 1:4-3:12 >------- -1| case 1: -2| a - ---------< +1| case 0: +2| foo +3| pass + ------------< [#2 Insertion delimiter] = " " [#3 Content] = -[#3 Removal] = 4:8-4:9 - >-< -4| b +[#3 Removal] = 5:8-5:12 + >----< +5| pass -[#3 Domain] = 3:4-4:9 +[#3 Domain] = 4:4-5:12 >------- -3| case _: -4| b - ---------< +4| case _: +5| pass + ------------< [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.loop2.scope b/data/fixtures/scopes/python/interior.while.scope similarity index 100% rename from data/fixtures/scopes/python/interior.loop2.scope rename to data/fixtures/scopes/python/interior.while.scope diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 2b9cfc5ff1..1fc7148381 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -96,9 +96,12 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": supported, "interior.function": supported, "interior.if": supported, + "interior.switch": supported, "interior.switchCase": supported, "interior.ternary": supported, - "interior.loop": supported, + "interior.for": supported, + "interior.while": supported, + "interior.doWhile": supported, /* UNSUPPORTED */ @@ -184,6 +187,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { environment: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, + "interior.static": notApplicable, }; export const cScopeSupport: LanguageScopeSupportFacetMap = { @@ -201,7 +205,8 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.lambda.empty": notApplicable, "argumentList.formal.lambda.multiLine": notApplicable, "argumentList.formal.lambda.singleLine": notApplicable, - "interior.lambda": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, "value.return.lambda": notApplicable, anonymousFunction: notApplicable, @@ -227,6 +232,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor": notApplicable, "value.argument.formal.constructor.iteration": notApplicable, "value.argument.formal.constructor": notApplicable, + "interior.constructor": notApplicable, // Method "argument.formal.method.iteration": notApplicable, @@ -245,11 +251,13 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, "value.argument.formal.method": notApplicable, + "interior.method": notApplicable, // Foreach "name.foreach": notApplicable, "type.foreach": notApplicable, "value.foreach": notApplicable, + "interior.foreach": notApplicable, // Default argument value "value.argument.formal": notApplicable, @@ -258,4 +266,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { // Generic type "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, + + // Namespace + "interior.namespace": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 17b5cdc78d..8b9186c484 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -2,7 +2,7 @@ import { cCoreScopeSupport } from "./c"; import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported } = ScopeSupportFacetLevel; +const { supported, notApplicable } = ScopeSupportFacetLevel; export const cppScopeSupport: LanguageScopeSupportFacetMap = { ...cCoreScopeSupport, @@ -72,6 +72,14 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": supported, "type.typeArgument.iteration": supported, - "interior.lambda": supported, + "interior.lambda.block": supported, "interior.try": supported, + "interior.foreach": supported, + "interior.constructor": supported, + "interior.method": supported, + "interior.namespace": supported, + + /* NOT APPLICABLE */ + + "interior.lambda.expression": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 867017c1e9..ecd5786241 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -164,9 +164,16 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": supported, "interior.function": supported, + "interior.constructor": supported, + "interior.method": supported, "interior.if": supported, - "interior.lambda": supported, - "interior.loop": supported, + "interior.lambda.block": supported, + "interior.lambda.expression": supported, + "interior.for": supported, + "interior.foreach": supported, + "interior.while": supported, + "interior.doWhile": supported, + "interior.switch": supported, "interior.switchCase": supported, "interior.ternary": supported, "interior.try": supported, @@ -236,4 +243,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { environment: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 93312a6cd5..0e3f8122b7 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -112,13 +112,22 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.attribute": notApplicable, list: notApplicable, "name.argument.actual.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 010990d29c..ffc5cc201a 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -88,13 +88,22 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": notApplicable, "interior.command": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.mapPair.iteration": notApplicable, "key.mapPair": notApplicable, "name.argument.actual.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 34c9132393..31ddb5128f 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -141,14 +141,21 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.resource": supported, "interior.class": supported, - "interior.function": supported, + "interior.constructor": supported, + "interior.method": supported, "interior.if": supported, - "interior.lambda": supported, - "interior.loop": supported, + "interior.lambda.block": supported, + "interior.lambda.expression": supported, + "interior.for": supported, + "interior.foreach": supported, + "interior.while": supported, + "interior.doWhile": supported, + "interior.switch": supported, "interior.switchCase": supported, "interior.ternary": supported, "interior.try": supported, "interior.resource": supported, + "interior.static": supported, /* UNSUPPORTED */ @@ -173,6 +180,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.function": notApplicable, "type.argument.formal": notApplicable, "type.argument.formal.iteration": notApplicable, + "interior.function": notApplicable, // Element and tags element: notApplicable, @@ -235,6 +243,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { // Miscellaneous "value.yield": notApplicable, + "interior.namespace": notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, environment: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 140122842d..0a5a0fa5de 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -155,12 +155,20 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": supported, "interior.function": supported, + "interior.constructor": supported, + "interior.method": supported, "interior.if": supported, - "interior.lambda": supported, - "interior.loop": supported, + "interior.lambda.block": supported, + "interior.lambda.expression": supported, + "interior.for": supported, + "interior.foreach": supported, + "interior.while": supported, + "interior.doWhile": supported, + "interior.switch": supported, "interior.switchCase": supported, "interior.ternary": supported, "interior.try": supported, + "interior.static": supported, /* NOT APPLICABLE (JS & TS) */ @@ -202,6 +210,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { // Miscellaneous environment: notApplicable, + "interior.namespace": notApplicable, }; export const javascriptJsxScopeSupport: LanguageScopeSupportFacetMap = { diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 2f3bdd55d0..f3f97b43d2 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -105,13 +105,22 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.static": notApplicable, + "interior.namespace": notApplicable, "key.attribute": notApplicable, "name.argument.actual": notApplicable, "name.argument.actual.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index b597435271..51ffff7a7f 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -100,13 +100,22 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.attribute": notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index e99ff5eb3b..f4afafb216 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -131,12 +131,16 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": supported, "interior.function": supported, - "interior.lambda": supported, + "interior.constructor": supported, + "interior.method": supported, + "interior.lambda.expression": supported, "interior.if": supported, "interior.try": supported, + "interior.switch": supported, "interior.switchCase": supported, "interior.ternary": supported, - "interior.loop": supported, + "interior.foreach": supported, + "interior.while": supported, "interior.resource": supported, switchStatementSubject: supported, @@ -189,6 +193,11 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "interior.cell": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, + "interior.lambda.block": notApplicable, + "interior.for": notApplicable, + "interior.doWhile": notApplicable, + "interior.static": notApplicable, + "interior.namespace": notApplicable, "key.attribute": notApplicable, "namedFunction.iteration.block": notApplicable, "section.iteration.document": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index d6b6f64318..efa3037afc 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -51,7 +51,8 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": unsupported, "interior.function": unsupported, "interior.if": unsupported, - "interior.lambda": unsupported, + "interior.lambda.block": unsupported, + "interior.lambda.expression": unsupported, "interior.try": unsupported, "key.attribute": unsupported, "name.class": unsupported, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 3eabe723d0..fe5087497b 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -100,13 +100,22 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.attribute": notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 3cbdcc53eb..0eee5a6548 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -13,23 +13,23 @@ export const scopeSupportFacetInfos: Record< }, element: { - description: "An xml/html element. Also used for LaTeX environments", + description: "A xml/html element. Also used for LaTeX environments", scopeType: "xmlElement", }, startTag: { - description: "The start tag of an xml element", + description: "The start tag of a xml element", scopeType: "xmlStartTag", }, endTag: { - description: "The end tag of an xml element", + description: "The end tag of a xml element", scopeType: "xmlEndTag", }, tags: { - description: "Both tags in an xml element", + description: "Both tags in a xml element", scopeType: "xmlBothTags", }, attribute: { - description: "A attribute, eg of an html element or a C++ attribute", + description: "A attribute, eg of a html element or a C++ attribute", scopeType: "attribute", }, @@ -85,7 +85,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "statement", }, "statement.class": { - description: "An class declaration", + description: "A class declaration", scopeType: "statement", }, "statement.iteration.document": { @@ -101,7 +101,7 @@ export const scopeSupportFacetInfos: Record< }, class: { - description: "A class in an object-oriented language", + description: "A class in a object-oriented language", scopeType: "class", }, "class.iteration.document": { @@ -427,7 +427,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "textFragment", }, "textFragment.element": { - description: "Text fragment consisting of an xml element interior", + description: "Text fragment consisting of a xml element interior", scopeType: "textFragment", }, @@ -628,7 +628,7 @@ export const scopeSupportFacetInfos: Record< isIteration: true, }, "key.attribute": { - description: "Key (LHS) of an attribute eg in an xml element", + description: "Key (LHS) of an attribute eg in a xml element", scopeType: "collectionKey", }, "key.mapPair": { @@ -670,7 +670,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "value", }, "value.attribute": { - description: "Value (RHS) of an attribute eg in an xml element", + description: "Value (RHS) of an attribute eg in a xml element", scopeType: "value", }, "value.return": { @@ -805,7 +805,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "type", }, "type.class": { - description: "An class declaration", + description: "A class declaration", scopeType: "type", }, "type.alias": { @@ -838,7 +838,7 @@ export const scopeSupportFacetInfos: Record< }, "interior.element": { - description: "The interior/children of an XML element", + description: "The interior/children of a XML element", scopeType: { type: "interior" }, }, "interior.command": { @@ -854,37 +854,73 @@ export const scopeSupportFacetInfos: Record< scopeType: { type: "interior" }, }, "interior.function": { - description: "The body of a function", + description: "The body of a function declaration", scopeType: { type: "interior" }, }, - "interior.lambda": { - description: "The body of a lambda/anonymous function", + "interior.constructor": { + description: "The body of a constructor declaration", + scopeType: { type: "interior" }, + }, + "interior.method": { + description: "The body of a method declaration", + scopeType: { type: "interior" }, + }, + "interior.lambda.block": { + description: "The block body of a lambda/anonymous function", + scopeType: { type: "interior" }, + }, + "interior.lambda.expression": { + description: "The expression body of a lambda/anonymous function", scopeType: { type: "interior" }, }, "interior.if": { - description: "The body of an if/elif/else branch", + description: "The body of a if/elif/else branch", scopeType: { type: "interior" }, }, "interior.try": { - description: "The body of an try/catch/finally branch", + description: "The body of a try/catch/finally branch", + scopeType: { type: "interior" }, + }, + "interior.switch": { + description: "The body of a switch statement", scopeType: { type: "interior" }, }, "interior.switchCase": { - description: "The body of an switch case branch", + description: "The body of a switch case branch", scopeType: { type: "interior" }, }, "interior.ternary": { - description: "The body of an ternary condition/branch", + description: "The body of a ternary condition/branch", + scopeType: { type: "interior" }, + }, + "interior.for": { + description: "The body of a for loop", + scopeType: { type: "interior" }, + }, + "interior.foreach": { + description: "The body of a for-each loop", + scopeType: { type: "interior" }, + }, + "interior.while": { + description: "The body of a while loop", scopeType: { type: "interior" }, }, - "interior.loop": { - description: "The body of an for/while loop", + "interior.doWhile": { + description: "The body of a do-while loop", scopeType: { type: "interior" }, }, "interior.resource": { description: "the body of a 'with' / 'use' / 'using' statement", scopeType: { type: "interior" }, }, + "interior.namespace": { + description: "the body of a namespace statement", + scopeType: { type: "interior" }, + }, + "interior.static": { + description: "the body of a static statement", + scopeType: { type: "interior" }, + }, notebookCell: { description: "A cell in a notebook or a markdown code block", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index eaed8cfa75..ffb999d2c0 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -204,16 +204,25 @@ export const scopeSupportFacets = [ "interior.class", "interior.function", - "interior.lambda", + "interior.constructor", + "interior.method", + "interior.lambda.block", + "interior.lambda.expression", "interior.element", "interior.command", "interior.cell", "interior.if", "interior.try", + "interior.switch", "interior.switchCase", "interior.ternary", - "interior.loop", + "interior.for", + "interior.foreach", + "interior.while", + "interior.doWhile", "interior.resource", + "interior.namespace", + "interior.static", "notebookCell", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 08684f491f..d22add81cd 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -115,13 +115,22 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.attribute": notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 7a7f80c565..1c103520a9 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -99,13 +99,22 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "interior.class": notApplicable, "interior.command": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, list: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index c869b9bd71..4b49c3f3ee 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -109,13 +109,22 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, + "interior.constructor": notApplicable, + "interior.method": notApplicable, "interior.if": notApplicable, - "interior.lambda": notApplicable, - "interior.loop": notApplicable, + "interior.lambda.block": notApplicable, + "interior.lambda.expression": notApplicable, + "interior.for": notApplicable, + "interior.foreach": notApplicable, + "interior.while": notApplicable, + "interior.doWhile": notApplicable, "interior.resource": notApplicable, + "interior.switch": notApplicable, "interior.switchCase": notApplicable, "interior.ternary": notApplicable, "interior.try": notApplicable, + "interior.namespace": notApplicable, + "interior.static": notApplicable, "key.attribute": notApplicable, "name.argument.actual": notApplicable, "name.argument.actual.iteration": notApplicable, diff --git a/queries/cpp.scm b/queries/cpp.scm index 34e79d4301..4d3bdad9a2 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -19,7 +19,10 @@ (_ (class_specifier name: (_) @className @name - body: (_) + body: (_ + "{" @interior.start.endOf + "}" @interior.end.startOf + ) ) @_.domain.start @class.start @type.start . ";"? @_.domain.end @class.end @type.end @@ -34,6 +37,15 @@ ";"? @statement.end ) +;;!! namespace NS { } +(namespace_definition + name: (_) @name + body: (_ + "{" @interior.start.endOf + "}" @interior.end.startOf + ) +) @_.domain + (field_declaration_list "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf @@ -135,12 +147,17 @@ ">" @type.iteration.end.startOf ) -;;!! for (int value : values) {} +;;!! for (int value : values) { } ;;! ^^^^^ ;;! ^^^^^^ +;;! ^ (for_range_loop declarator: (_) @name right: (_) @value + body: (_ + "{" @interior.start.endOf + "}" @interior.end.startOf + ) ) @_.domain (trailing_return_type From 53f84dcdc183f290de25e2a48e23fb0553faea80 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Mon, 30 Jun 2025 11:25:07 +0200 Subject: [PATCH 2/6] Updated switch case fixture6 --- .../scopes/c/interior.switchCase.scope | 220 ++++++++---------- 1 file changed, 96 insertions(+), 124 deletions(-) diff --git a/data/fixtures/scopes/c/interior.switchCase.scope b/data/fixtures/scopes/c/interior.switchCase.scope index 6612ad442d..58797959fa 100644 --- a/data/fixtures/scopes/c/interior.switchCase.scope +++ b/data/fixtures/scopes/c/interior.switchCase.scope @@ -1,10 +1,8 @@ switch (value) { case 0: - break; - case 1: foo; break; - case 2: { + case 1: { break; } default: @@ -12,51 +10,45 @@ switch (value) { } --- -[#1 Content] = 1:4-10:14 +[#1 Content] = 1:4-8:14 >------- 1| case 0: -2| break; -3| case 1: -4| foo; +2| foo; +3| break; +4| case 1: { 5| break; -6| case 2: { -7| break; -8| } -9| default: -10| break; - --------------< - -[#1 Removal] = 0:16-11:0 +6| } +7| default: +8| break; + --------------< + +[#1 Removal] = 0:16-9:0 > 0| switch (value) { 1| case 0: -2| break; -3| case 1: -4| foo; +2| foo; +3| break; +4| case 1: { 5| break; -6| case 2: { -7| break; -8| } -9| default: -10| break; -11| } - < - -[#1 Domain] = 0:0-11:1 +6| } +7| default: +8| break; +9| } + < + +[#1 Domain] = 0:0-9:1 >---------------- 0| switch (value) { 1| case 0: -2| break; -3| case 1: -4| foo; +2| foo; +3| break; +4| case 1: { 5| break; -6| case 2: { -7| break; -8| } -9| default: -10| break; -11| } - -< +6| } +7| default: +8| break; +9| } + -< [#1 Insertion delimiter] = " " @@ -73,137 +65,117 @@ switch (value) { [#2 Insertion delimiter] = " " -[#3 Content] = 1:4-10:14 +[#3 Content] = 1:4-8:14 >------- 1| case 0: -2| break; -3| case 1: -4| foo; +2| foo; +3| break; +4| case 1: { 5| break; -6| case 2: { -7| break; -8| } -9| default: -10| break; - --------------< - -[#3 Removal] = 0:16-11:0 +6| } +7| default: +8| break; + --------------< + +[#3 Removal] = 0:16-9:0 > 0| switch (value) { 1| case 0: -2| break; -3| case 1: -4| foo; +2| foo; +3| break; +4| case 1: { 5| break; -6| case 2: { -7| break; -8| } -9| default: -10| break; -11| } - < - -[#3 Domain] = 0:15-11:1 +6| } +7| default: +8| break; +9| } + < + +[#3 Domain] = 0:15-9:1 >- 0| switch (value) { 1| case 0: -2| break; -3| case 1: -4| foo; +2| foo; +3| break; +4| case 1: { 5| break; -6| case 2: { -7| break; -8| } -9| default: -10| break; -11| } - -< +6| } +7| default: +8| break; +9| } + -< [#3 Insertion delimiter] = " " [#4 Content] = -[#4 Removal] = 2:8-2:14 - >------< -2| break; - -[#4 Domain] = 1:4-2:14 - >------- -1| case 0: -2| break; - --------------< - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 4:8-5:14 +[#4 Removal] = 2:8-3:14 >---- -4| foo; -5| break; +2| foo; +3| break; --------------< -[#5 Domain] = 3:4-5:14 +[#4 Domain] = 1:4-3:14 >------- -3| case 1: -4| foo; -5| break; +1| case 0: +2| foo; +3| break; --------------< -[#5 Insertion delimiter] = " " +[#4 Insertion delimiter] = " " -[#6 Content] = 7:8-7:14 +[#5 Content] = 5:8-5:14 >------< -7| break; +5| break; -[#6 Removal] = 6:13-8:4 +[#5 Removal] = 4:13-6:4 > -6| case 2: { -7| break; -8| } +4| case 1: { +5| break; +6| } ----< -[#6 Domain] = 6:4-8:5 +[#5 Domain] = 4:4-6:5 >--------- -6| case 2: { -7| break; -8| } +4| case 1: { +5| break; +6| } -----< -[#6 Insertion delimiter] = " " +[#5 Insertion delimiter] = " " -[#7 Content] = 7:8-7:14 +[#6 Content] = 5:8-5:14 >------< -7| break; +5| break; -[#7 Removal] = 6:13-8:4 +[#6 Removal] = 4:13-6:4 > -6| case 2: { -7| break; -8| } +4| case 1: { +5| break; +6| } ----< -[#7 Domain] = 6:12-8:5 +[#6 Domain] = 4:12-6:5 >- -6| case 2: { -7| break; -8| } +4| case 1: { +5| break; +6| } -----< -[#7 Insertion delimiter] = " " +[#6 Insertion delimiter] = " " -[#8 Content] = -[#8 Removal] = 10:8-10:14 - >------< -10| break; +[#7 Content] = +[#7 Removal] = 8:8-8:14 + >------< +8| break; -[#8 Domain] = 9:4-10:14 +[#7 Domain] = 7:4-8:14 >-------- -9| default: -10| break; - --------------< +7| default: +8| break; + --------------< -[#8 Insertion delimiter] = " " +[#7 Insertion delimiter] = " " From 69dbfea1a1555fa628ea2fda63a9df47ae6c2607 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Mon, 30 Jun 2025 11:28:24 +0200 Subject: [PATCH 3/6] Update packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts --- .../common/src/scopeSupportFacets/scopeSupportFacetInfos.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 0eee5a6548..1887004d99 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -101,7 +101,7 @@ export const scopeSupportFacetInfos: Record< }, class: { - description: "A class in a object-oriented language", + description: "A class in an object-oriented language", scopeType: "class", }, "class.iteration.document": { From 489584aed7d32744cd7ede6217f7a23bcf11083e Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Mon, 30 Jun 2025 11:29:18 +0200 Subject: [PATCH 4/6] Update packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts --- .../common/src/scopeSupportFacets/scopeSupportFacetInfos.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 1887004d99..1c2ca91f38 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -874,7 +874,7 @@ export const scopeSupportFacetInfos: Record< scopeType: { type: "interior" }, }, "interior.if": { - description: "The body of a if/elif/else branch", + description: "The body of an if/elif/else branch", scopeType: { type: "interior" }, }, "interior.try": { From faa76757868b4a0be520f5e0d1434da4dc3b48cf Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Mon, 30 Jun 2025 11:34:09 +0200 Subject: [PATCH 5/6] update fixture --- .../javascript.core/interior.switch.scope | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/data/fixtures/scopes/javascript.core/interior.switch.scope b/data/fixtures/scopes/javascript.core/interior.switch.scope index 8dc971b0c4..e2ad168b18 100644 --- a/data/fixtures/scopes/javascript.core/interior.switch.scope +++ b/data/fixtures/scopes/javascript.core/interior.switch.scope @@ -1,2 +1,37 @@ switch (value) { } --- + +[#1 Content] = +[#1 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#1 Domain] = 0:0-0:18 + >------------------< +0| switch (value) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:8-0:13 + >-----< +0| switch (value) { } + +[#2 Domain] = 0:7-0:14 + >-------< +0| switch (value) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:16-0:17 + >-< +0| switch (value) { } + +[#3 Domain] = 0:15-0:18 + >---< +0| switch (value) { } + +[#3 Insertion delimiter] = " " From 176f505a3262565cab695718f0524edacd99b818 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Mon, 30 Jun 2025 11:59:43 +0200 Subject: [PATCH 6/6] Add missing facets --- .../scopes/java/interior.static.scope | 69 ++++++++++++++++ .../interior.constructor.scope | 81 +++++++++++++++++++ ....function2.scope => interior.method.scope} | 0 .../javascript.core/interior.static.scope | 69 ++++++++++++++++ .../scopes/python/interior.constructor.scope | 46 +++++++++++ .../scopes/python/interior.method.scope | 46 +++++++++++ 6 files changed, 311 insertions(+) create mode 100644 data/fixtures/scopes/java/interior.static.scope create mode 100644 data/fixtures/scopes/javascript.core/interior.constructor.scope rename data/fixtures/scopes/javascript.core/{interior.function2.scope => interior.method.scope} (100%) create mode 100644 data/fixtures/scopes/javascript.core/interior.static.scope create mode 100644 data/fixtures/scopes/python/interior.constructor.scope create mode 100644 data/fixtures/scopes/python/interior.method.scope diff --git a/data/fixtures/scopes/java/interior.static.scope b/data/fixtures/scopes/java/interior.static.scope new file mode 100644 index 0000000000..ec5a85df74 --- /dev/null +++ b/data/fixtures/scopes/java/interior.static.scope @@ -0,0 +1,69 @@ +class MyClass { + static { } +} +--- + +[#1 Content] = 1:4-1:14 + >----------< +1| static { } + +[#1 Removal] = 0:15-2:0 + > +0| class MyClass { +1| static { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| static { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:14 + >----------< +1| static { } + +[#2 Removal] = 0:15-2:0 + > +0| class MyClass { +1| static { } +2| } + < + +[#2 Domain] = 0:14-2:1 + >- +0| class MyClass { +1| static { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:12-1:13 + >-< +1| static { } + +[#3 Domain] = 1:4-1:14 + >----------< +1| static { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:12-1:13 + >-< +1| static { } + +[#4 Domain] = 1:11-1:14 + >---< +1| static { } + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior.constructor.scope b/data/fixtures/scopes/javascript.core/interior.constructor.scope new file mode 100644 index 0000000000..7e12a56c03 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/interior.constructor.scope @@ -0,0 +1,81 @@ +class Foo { + constructor() { } +} +--- + +[#1 Content] = 1:4-1:21 + >-----------------< +1| constructor() { } + +[#1 Removal] = 0:11-2:0 + > +0| class Foo { +1| constructor() { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| constructor() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:21 + >-----------------< +1| constructor() { } + +[#2 Removal] = 0:11-2:0 + > +0| class Foo { +1| constructor() { } +2| } + < + +[#2 Domain] = 0:10-2:1 + >- +0| class Foo { +1| constructor() { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:19-1:20 + >-< +1| constructor() { } + +[#3 Domain] = 1:4-1:21 + >-----------------< +1| constructor() { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:16-1:16 + >< +1| constructor() { } + +[#4 Domain] = 1:15-1:17 + >--< +1| constructor() { } + +[#4 Insertion delimiter] = " " + + +[#5 Content] = +[#5 Removal] = 1:19-1:20 + >-< +1| constructor() { } + +[#5 Domain] = 1:18-1:21 + >---< +1| constructor() { } + +[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior.function2.scope b/data/fixtures/scopes/javascript.core/interior.method.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/interior.function2.scope rename to data/fixtures/scopes/javascript.core/interior.method.scope diff --git a/data/fixtures/scopes/javascript.core/interior.static.scope b/data/fixtures/scopes/javascript.core/interior.static.scope new file mode 100644 index 0000000000..ec08e00aa5 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/interior.static.scope @@ -0,0 +1,69 @@ +class Foo { + static { } +} +--- + +[#1 Content] = 1:4-1:14 + >----------< +1| static { } + +[#1 Removal] = 0:11-2:0 + > +0| class Foo { +1| static { } +2| } + < + +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| static { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:14 + >----------< +1| static { } + +[#2 Removal] = 0:11-2:0 + > +0| class Foo { +1| static { } +2| } + < + +[#2 Domain] = 0:10-2:1 + >- +0| class Foo { +1| static { } +2| } + -< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:12-1:13 + >-< +1| static { } + +[#3 Domain] = 1:4-1:14 + >----------< +1| static { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = 1:12-1:13 + >-< +1| static { } + +[#4 Domain] = 1:11-1:14 + >---< +1| static { } + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.constructor.scope b/data/fixtures/scopes/python/interior.constructor.scope new file mode 100644 index 0000000000..68f9215f3e --- /dev/null +++ b/data/fixtures/scopes/python/interior.constructor.scope @@ -0,0 +1,46 @@ +class Foo: + def __init__(self): + pass +--- + +[#1 Content] = +[#1 Removal] = 1:4-2:12 + >------------------- +1| def __init__(self): +2| pass + ------------< + +[#1 Domain] = 0:0-2:12 + >---------- +0| class Foo: +1| def __init__(self): +2| pass + ------------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:8-2:12 + >----< +2| pass + +[#2 Domain] = 1:4-2:12 + >------------------- +1| def __init__(self): +2| pass + ------------< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:17-1:21 + >----< +1| def __init__(self): + +[#3 Domain] = 1:16-1:22 + >------< +1| def __init__(self): + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior.method.scope b/data/fixtures/scopes/python/interior.method.scope new file mode 100644 index 0000000000..10c21bafbf --- /dev/null +++ b/data/fixtures/scopes/python/interior.method.scope @@ -0,0 +1,46 @@ +class Foo: + def bar(): + pass +--- + +[#1 Content] = +[#1 Removal] = 1:4-2:12 + >---------- +1| def bar(): +2| pass + ------------< + +[#1 Domain] = 0:0-2:12 + >---------- +0| class Foo: +1| def bar(): +2| pass + ------------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:8-2:12 + >----< +2| pass + +[#2 Domain] = 1:4-2:12 + >---------- +1| def bar(): +2| pass + ------------< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 1:12-1:12 + >< +1| def bar(): + +[#3 Domain] = 1:11-1:13 + >--< +1| def bar(): + +[#3 Insertion delimiter] = " "