diff --git a/data/fixtures/scopes/c/functionCall.method.scope b/data/fixtures/scopes/c/functionCall.method.scope new file mode 100644 index 0000000000..87d426d2ed --- /dev/null +++ b/data/fixtures/scopes/c/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/functionCallee.method.scope b/data/fixtures/scopes/c/functionCallee.method.scope new file mode 100644 index 0000000000..f30f0f7536 --- /dev/null +++ b/data/fixtures/scopes/c/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar(); +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar(); + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.function.scope b/data/fixtures/scopes/c/name/name.function.scope index 3f34e8cda7..80cde86ee4 100644 --- a/data/fixtures/scopes/c/name/name.function.scope +++ b/data/fixtures/scopes/c/name/name.function.scope @@ -1,13 +1,17 @@ -void Foo::bar() {} +void foo() {} --- [Content] = -[Removal] = 0:10-0:13 - >---< -0| void Foo::bar() {} +[Removal] = 0:5-0:8 + >---< +0| void foo() {} -[Domain] = 0:0-0:18 - >------------------< -0| void Foo::bar() {} +[Leading delimiter] = 0:4-0:5 + >-< +0| void foo() {} + +[Domain] = 0:0-0:13 + >-------------< +0| void foo() {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.function2.scope b/data/fixtures/scopes/c/name/name.function2.scope index fc025efe55..e65f6f8937 100644 --- a/data/fixtures/scopes/c/name/name.function2.scope +++ b/data/fixtures/scopes/c/name/name.function2.scope @@ -1,13 +1,17 @@ -void Foo::bar(); +void foo(); --- [Content] = -[Removal] = 0:10-0:13 - >---< -0| void Foo::bar(); +[Removal] = 0:5-0:8 + >---< +0| void foo(); -[Domain] = 0:0-0:16 - >----------------< -0| void Foo::bar(); +[Leading delimiter] = 0:4-0:5 + >-< +0| void foo(); + +[Domain] = 0:0-0:11 + >-----------< +0| void foo(); [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.function3.scope b/data/fixtures/scopes/c/name/name.function3.scope index 80cde86ee4..3f34e8cda7 100644 --- a/data/fixtures/scopes/c/name/name.function3.scope +++ b/data/fixtures/scopes/c/name/name.function3.scope @@ -1,17 +1,13 @@ -void foo() {} +void Foo::bar() {} --- [Content] = -[Removal] = 0:5-0:8 - >---< -0| void foo() {} +[Removal] = 0:10-0:13 + >---< +0| void Foo::bar() {} -[Leading delimiter] = 0:4-0:5 - >-< -0| void foo() {} - -[Domain] = 0:0-0:13 - >-------------< -0| void foo() {} +[Domain] = 0:0-0:18 + >------------------< +0| void Foo::bar() {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.function4.scope b/data/fixtures/scopes/c/name/name.function4.scope index e65f6f8937..fc025efe55 100644 --- a/data/fixtures/scopes/c/name/name.function4.scope +++ b/data/fixtures/scopes/c/name/name.function4.scope @@ -1,17 +1,13 @@ -void foo(); +void Foo::bar(); --- [Content] = -[Removal] = 0:5-0:8 - >---< -0| void foo(); +[Removal] = 0:10-0:13 + >---< +0| void Foo::bar(); -[Leading delimiter] = 0:4-0:5 - >-< -0| void foo(); - -[Domain] = 0:0-0:11 - >-----------< -0| void foo(); +[Domain] = 0:0-0:16 + >----------------< +0| void Foo::bar(); [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/namedFunction.iteration.document.scope b/data/fixtures/scopes/c/namedFunction/namedFunction.iteration.document.scope similarity index 100% rename from data/fixtures/scopes/c/namedFunction.iteration.document.scope rename to data/fixtures/scopes/c/namedFunction/namedFunction.iteration.document.scope diff --git a/data/fixtures/scopes/c/namedFunction/namedFunction.scope b/data/fixtures/scopes/c/namedFunction/namedFunction.scope new file mode 100644 index 0000000000..49b1c64940 --- /dev/null +++ b/data/fixtures/scopes/c/namedFunction/namedFunction.scope @@ -0,0 +1,10 @@ +void foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| void foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/namedFunction/namedFunction2.scope b/data/fixtures/scopes/c/namedFunction/namedFunction2.scope new file mode 100644 index 0000000000..7334bfb6e6 --- /dev/null +++ b/data/fixtures/scopes/c/namedFunction/namedFunction2.scope @@ -0,0 +1,10 @@ +void foo(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| void foo(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/namedFunction/namedFunction3.scope b/data/fixtures/scopes/c/namedFunction/namedFunction3.scope new file mode 100644 index 0000000000..334fdde13b --- /dev/null +++ b/data/fixtures/scopes/c/namedFunction/namedFunction3.scope @@ -0,0 +1,10 @@ +void Foo::bar() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| void Foo::bar() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/namedFunction/namedFunction4.scope b/data/fixtures/scopes/c/namedFunction/namedFunction4.scope new file mode 100644 index 0000000000..8ca08e4315 --- /dev/null +++ b/data/fixtures/scopes/c/namedFunction/namedFunction4.scope @@ -0,0 +1,10 @@ +void Foo::bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| void Foo::bar(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/statement/statement.assignment.scope b/data/fixtures/scopes/c/statement/statement.assignment.scope new file mode 100644 index 0000000000..552bf9f507 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.break.scope b/data/fixtures/scopes/c/statement/statement.break.scope new file mode 100644 index 0000000000..c81ea40ae7 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.break.scope @@ -0,0 +1,33 @@ +while (true) { + break; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| break; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:10 + >------< +1| break; + +[#2 Removal] = 1:0-2:0 + >---------- +1| break; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.continue.scope b/data/fixtures/scopes/c/statement/statement.continue.scope new file mode 100644 index 0000000000..8715a90063 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.continue.scope @@ -0,0 +1,33 @@ +while (true) { + continue; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| continue; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| continue; + +[#2 Removal] = 1:0-2:0 + >------------- +1| continue; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.doWhile.scope b/data/fixtures/scopes/c/statement/statement.doWhile.scope new file mode 100644 index 0000000000..e1e74c9153 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.doWhile.scope @@ -0,0 +1,10 @@ +do {} while (true); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| do {} while (true); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.for.scope b/data/fixtures/scopes/c/statement/statement.for.scope new file mode 100644 index 0000000000..0094536004 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.for.scope @@ -0,0 +1,10 @@ +for (int i = 0; i < size; i++) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:33 + >---------------------------------< +0| for (int i = 0; i < size; i++) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.function.scope b/data/fixtures/scopes/c/statement/statement.function.scope new file mode 100644 index 0000000000..1eb8467630 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.function.scope @@ -0,0 +1,10 @@ +void foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| void foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.function2.scope b/data/fixtures/scopes/c/statement/statement.function2.scope new file mode 100644 index 0000000000..205c2db59a --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.function2.scope @@ -0,0 +1,10 @@ +void foo(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| void foo(); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.function3.scope b/data/fixtures/scopes/c/statement/statement.function3.scope new file mode 100644 index 0000000000..641385cc09 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.function3.scope @@ -0,0 +1,10 @@ +void Foo::bar() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| void Foo::bar() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.function4.scope b/data/fixtures/scopes/c/statement/statement.function4.scope new file mode 100644 index 0000000000..b1f39eb2cd --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.function4.scope @@ -0,0 +1,10 @@ +void Foo::bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| void Foo::bar(); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.if.scope b/data/fixtures/scopes/c/statement/statement.if.scope new file mode 100644 index 0000000000..14f2507621 --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.if.scope @@ -0,0 +1,15 @@ +if (true) {} +else if (false) {} +else {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:7 + >------------ +0| if (true) {} +1| else if (false) {} +2| else {} + -------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.return.scope b/data/fixtures/scopes/c/statement/statement.return.scope new file mode 100644 index 0000000000..3fd055f39b --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.return.scope @@ -0,0 +1,33 @@ +int foo() { + return 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| int foo() { +1| return 0; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| return 0; + +[#2 Removal] = 1:0-2:0 + >------------- +1| return 0; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.switch.scope b/data/fixtures/scopes/c/statement/statement.switch.scope new file mode 100644 index 0000000000..bcd2bb4acb --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.switch.scope @@ -0,0 +1,10 @@ +switch (foo) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| switch (foo) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.scope b/data/fixtures/scopes/c/statement/statement.variable.scope similarity index 100% rename from data/fixtures/scopes/c/statement/statement.scope rename to data/fixtures/scopes/c/statement/statement.variable.scope diff --git a/data/fixtures/scopes/c/statement/statement.while.scope b/data/fixtures/scopes/c/statement/statement.while.scope new file mode 100644 index 0000000000..5aaf57be8f --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.while.scope @@ -0,0 +1,10 @@ +while (true) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| while (true) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/value/value.switch.scope b/data/fixtures/scopes/c/value/value.switch.scope index 67688ae8d0..16325fcb1f 100644 --- a/data/fixtures/scopes/c/value/value.switch.scope +++ b/data/fixtures/scopes/c/value/value.switch.scope @@ -1,13 +1,13 @@ -switch (value) {} +switch (foo) {} --- [Content] = -[Removal] = 0:8-0:13 - >-----< -0| switch (value) {} +[Removal] = 0:8-0:11 + >---< +0| switch (foo) {} -[Domain] = 0:0-0:17 - >-----------------< -0| switch (value) {} +[Domain] = 0:0-0:15 + >---------------< +0| switch (foo) {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/argument/argument.catch.scope b/data/fixtures/scopes/cpp/argument/argument.catch.scope new file mode 100644 index 0000000000..170bfb3b38 --- /dev/null +++ b/data/fixtures/scopes/cpp/argument/argument.catch.scope @@ -0,0 +1,11 @@ +try {} +catch (const std::exception e) {} +--- + +[Content] = +[Removal] = +[Domain] = 1:7-1:29 + >----------------------< +1| catch (const std::exception e) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/cpp/branch.try.iteration.scope b/data/fixtures/scopes/cpp/branch.try.iteration.scope index e7b19b17dd..8220f8cb54 100644 --- a/data/fixtures/scopes/cpp/branch.try.iteration.scope +++ b/data/fixtures/scopes/cpp/branch.try.iteration.scope @@ -1,10 +1,10 @@ try {} -catch (const std::exception& e) {} +catch (const std::exception e) {} --- [Content] = -[Domain] = 0:0-1:34 +[Domain] = 0:0-1:33 >------ 0| try {} -1| catch (const std::exception& e) {} - ----------------------------------< +1| catch (const std::exception e) {} + ---------------------------------< diff --git a/data/fixtures/scopes/cpp/branch.try.scope b/data/fixtures/scopes/cpp/branch.try.scope index d34a05b27e..d65e6fd771 100644 --- a/data/fixtures/scopes/cpp/branch.try.scope +++ b/data/fixtures/scopes/cpp/branch.try.scope @@ -1,5 +1,5 @@ try {} -catch (const std::exception& e) {} +catch (const std::exception e) {} --- [#1 Content] = @@ -10,21 +10,21 @@ catch (const std::exception& e) {} [#1 Removal] = 0:0-1:0 >------ 0| try {} -1| catch (const std::exception& e) {} +1| catch (const std::exception e) {} < [#1 Insertion delimiter] = "\n" [#2 Content] = -[#2 Domain] = 1:0-1:34 - >----------------------------------< -1| catch (const std::exception& e) {} +[#2 Domain] = 1:0-1:33 + >---------------------------------< +1| catch (const std::exception e) {} -[#2 Removal] = 0:6-1:34 +[#2 Removal] = 0:6-1:33 > 0| try {} -1| catch (const std::exception& e) {} - ----------------------------------< +1| catch (const std::exception e) {} + ---------------------------------< [#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/namedFunction2.scope b/data/fixtures/scopes/cpp/functionCall.method.scope similarity index 53% rename from data/fixtures/scopes/c/namedFunction2.scope rename to data/fixtures/scopes/cpp/functionCall.method.scope index d611a7619f..4b139b1b79 100644 --- a/data/fixtures/scopes/c/namedFunction2.scope +++ b/data/fixtures/scopes/cpp/functionCall.method.scope @@ -1,10 +1,10 @@ -int foo(); +foo::bar(); --- [Content] = [Removal] = [Domain] = 0:0-0:10 >----------< -0| int foo(); +0| foo::bar(); -[Insertion delimiter] = "\n\n" +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/functionCallee.method.scope b/data/fixtures/scopes/cpp/functionCallee.method.scope new file mode 100644 index 0000000000..d7872b6252 --- /dev/null +++ b/data/fixtures/scopes/cpp/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo::bar(); +--- + +[Content] = +[Removal] = 0:0-0:8 + >--------< +0| foo::bar(); + +[Domain] = 0:0-0:10 + >----------< +0| foo::bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.argument.catch.scope b/data/fixtures/scopes/cpp/name/name.argument.catch.scope new file mode 100644 index 0000000000..48a88a437f --- /dev/null +++ b/data/fixtures/scopes/cpp/name/name.argument.catch.scope @@ -0,0 +1,21 @@ +try {} +catch (const std::exception e) {} +--- + +[Content] = 1:28-1:29 + >-< +1| catch (const std::exception e) {} + +[Removal] = 1:27-1:29 + >--< +1| catch (const std::exception e) {} + +[Leading delimiter] = 1:27-1:28 + >-< +1| catch (const std::exception e) {} + +[Domain] = 1:7-1:29 + >----------------------< +1| catch (const std::exception e) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.namespace.scope b/data/fixtures/scopes/cpp/name/name.namespace.scope index 12f853ed95..b5c970c528 100644 --- a/data/fixtures/scopes/cpp/name/name.namespace.scope +++ b/data/fixtures/scopes/cpp/name/name.namespace.scope @@ -1,24 +1,24 @@ -namespace Foo { } +namespace Foo {} --- [Content] = 0:10-0:13 >---< -0| namespace Foo { } +0| namespace Foo {} [Removal] = 0:10-0:14 >----< -0| namespace Foo { } +0| namespace Foo {} [Leading delimiter] = 0:9-0:10 >-< -0| namespace Foo { } +0| namespace Foo {} [Trailing delimiter] = 0:13-0:14 >-< -0| namespace Foo { } +0| namespace Foo {} -[Domain] = 0:0-0:17 - >-----------------< -0| namespace Foo { } +[Domain] = 0:0-0:16 + >----------------< +0| namespace Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/statement.class.scope b/data/fixtures/scopes/cpp/statement/statement.class.scope similarity index 100% rename from data/fixtures/scopes/cpp/statement.class.scope rename to data/fixtures/scopes/cpp/statement/statement.class.scope diff --git a/data/fixtures/scopes/cpp/statement/statement.constructor.scope b/data/fixtures/scopes/cpp/statement/statement.constructor.scope new file mode 100644 index 0000000000..4a301a6e97 --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.constructor.scope @@ -0,0 +1,33 @@ +class Foo { + Foo() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| Foo() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| Foo() {} + +[#2 Removal] = 1:0-2:0 + >------------ +1| Foo() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| Foo() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement/statement.constructor2.scope b/data/fixtures/scopes/cpp/statement/statement.constructor2.scope new file mode 100644 index 0000000000..cf1c7b4c41 --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.constructor2.scope @@ -0,0 +1,33 @@ +class Foo { + ~Foo() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| ~Foo() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| ~Foo() {} + +[#2 Removal] = 1:0-2:0 + >------------- +1| ~Foo() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| ~Foo() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement.enum.scope b/data/fixtures/scopes/cpp/statement/statement.enum.scope similarity index 100% rename from data/fixtures/scopes/cpp/statement.enum.scope rename to data/fixtures/scopes/cpp/statement/statement.enum.scope diff --git a/data/fixtures/scopes/cpp/statement/statement.foreach.scope b/data/fixtures/scopes/cpp/statement/statement.foreach.scope new file mode 100644 index 0000000000..2a65914bfb --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for (int v : values) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:23 + >-----------------------< +0| for (int v : values) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement.iteration.class.scope b/data/fixtures/scopes/cpp/statement/statement.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/cpp/statement.iteration.class.scope rename to data/fixtures/scopes/cpp/statement/statement.iteration.class.scope diff --git a/data/fixtures/scopes/cpp/statement/statement.method.scope b/data/fixtures/scopes/cpp/statement/statement.method.scope new file mode 100644 index 0000000000..16d0cf1c55 --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.method.scope @@ -0,0 +1,33 @@ +class Foo { + void bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| void bar() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:17 + >-------------< +1| void bar() {} + +[#2 Removal] = 1:0-2:0 + >----------------- +1| void bar() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| void bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement/statement.namespace.scope b/data/fixtures/scopes/cpp/statement/statement.namespace.scope new file mode 100644 index 0000000000..e62dcbdb0a --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.namespace.scope @@ -0,0 +1,10 @@ +namespace Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| namespace Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement/statement.try.scope b/data/fixtures/scopes/cpp/statement/statement.try.scope new file mode 100644 index 0000000000..85aa49ce42 --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.try.scope @@ -0,0 +1,13 @@ +try {} +catch (const std::exception e) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:33 + >------ +0| try {} +1| catch (const std::exception e) {} + ---------------------------------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/type/type.argument.catch.scope b/data/fixtures/scopes/cpp/type/type.argument.catch.scope new file mode 100644 index 0000000000..e0c229145d --- /dev/null +++ b/data/fixtures/scopes/cpp/type/type.argument.catch.scope @@ -0,0 +1,25 @@ +try {} +catch (const std::exception e) {} +--- + +[Content] = 1:13-1:27 + >--------------< +1| catch (const std::exception e) {} + +[Removal] = 1:13-1:28 + >---------------< +1| catch (const std::exception e) {} + +[Leading delimiter] = 1:12-1:13 + >-< +1| catch (const std::exception e) {} + +[Trailing delimiter] = 1:27-1:28 + >-< +1| catch (const std::exception e) {} + +[Domain] = 1:7-1:29 + >----------------------< +1| catch (const std::exception e) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/value/value.switch.scope b/data/fixtures/scopes/cpp/value/value.switch.scope deleted file mode 100644 index 67688ae8d0..0000000000 --- a/data/fixtures/scopes/cpp/value/value.switch.scope +++ /dev/null @@ -1,13 +0,0 @@ -switch (value) {} ---- - -[Content] = -[Removal] = 0:8-0:13 - >-----< -0| switch (value) {} - -[Domain] = 0:0-0:17 - >-----------------< -0| switch (value) {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/functionCall.method.scope b/data/fixtures/scopes/csharp/functionCall.method.scope new file mode 100644 index 0000000000..702879caaf --- /dev/null +++ b/data/fixtures/scopes/csharp/functionCall.method.scope @@ -0,0 +1,10 @@ +Foo.Bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| Foo.Bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/functionCallee/functionCallee.constructor.scope b/data/fixtures/scopes/csharp/functionCallee.constructor.scope similarity index 100% rename from data/fixtures/scopes/csharp/functionCallee/functionCallee.constructor.scope rename to data/fixtures/scopes/csharp/functionCallee.constructor.scope diff --git a/data/fixtures/scopes/csharp/functionCallee.method.scope b/data/fixtures/scopes/csharp/functionCallee.method.scope new file mode 100644 index 0000000000..f30f0f7536 --- /dev/null +++ b/data/fixtures/scopes/csharp/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar(); +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar(); + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/functionCallee/functionCallee.scope b/data/fixtures/scopes/csharp/functionCallee.scope similarity index 100% rename from data/fixtures/scopes/csharp/functionCallee/functionCallee.scope rename to data/fixtures/scopes/csharp/functionCallee.scope diff --git a/data/fixtures/scopes/csharp/statement/statement.assignment.scope b/data/fixtures/scopes/csharp/statement/statement.assignment.scope new file mode 100644 index 0000000000..552bf9f507 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.break.scope b/data/fixtures/scopes/csharp/statement/statement.break.scope new file mode 100644 index 0000000000..c81ea40ae7 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.break.scope @@ -0,0 +1,33 @@ +while (true) { + break; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| break; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:10 + >------< +1| break; + +[#2 Removal] = 1:0-2:0 + >---------- +1| break; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.constructor.scope b/data/fixtures/scopes/csharp/statement/statement.constructor.scope new file mode 100644 index 0000000000..6043e9b751 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.constructor.scope @@ -0,0 +1,33 @@ +class Foo { + public Foo() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| public Foo() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:19 + >---------------< +1| public Foo() {} + +[#2 Removal] = 1:0-2:0 + >------------------- +1| public Foo() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| public Foo() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.continue.scope b/data/fixtures/scopes/csharp/statement/statement.continue.scope new file mode 100644 index 0000000000..8715a90063 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.continue.scope @@ -0,0 +1,33 @@ +while (true) { + continue; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| continue; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| continue; + +[#2 Removal] = 1:0-2:0 + >------------- +1| continue; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.doWhile.scope b/data/fixtures/scopes/csharp/statement/statement.doWhile.scope new file mode 100644 index 0000000000..e1e74c9153 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.doWhile.scope @@ -0,0 +1,10 @@ +do {} while (true); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| do {} while (true); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.for.scope b/data/fixtures/scopes/csharp/statement/statement.for.scope new file mode 100644 index 0000000000..b17e514454 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.for.scope @@ -0,0 +1,10 @@ +for (int i = 0; i < size; ++i) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:33 + >---------------------------------< +0| for (int i = 0; i < size; ++i) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.foreach.scope b/data/fixtures/scopes/csharp/statement/statement.foreach.scope new file mode 100644 index 0000000000..feb1c6ffaf --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +foreach (int v in values) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| foreach (int v in values) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.function.scope b/data/fixtures/scopes/csharp/statement/statement.function.scope new file mode 100644 index 0000000000..928f8f0bf7 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.function.scope @@ -0,0 +1,10 @@ +void Foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| void Foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.if.scope b/data/fixtures/scopes/csharp/statement/statement.if.scope new file mode 100644 index 0000000000..14f2507621 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.if.scope @@ -0,0 +1,15 @@ +if (true) {} +else if (false) {} +else {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:7 + >------------ +0| if (true) {} +1| else if (false) {} +2| else {} + -------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.method.scope b/data/fixtures/scopes/csharp/statement/statement.method.scope new file mode 100644 index 0000000000..07ad8ab5d1 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.method.scope @@ -0,0 +1,33 @@ +class Foo { + public void Bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| public void Bar() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:24 + >--------------------< +1| public void Bar() {} + +[#2 Removal] = 1:0-2:0 + >------------------------ +1| public void Bar() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| public void Bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.return.scope b/data/fixtures/scopes/csharp/statement/statement.return.scope new file mode 100644 index 0000000000..b3d474e489 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.return.scope @@ -0,0 +1,33 @@ +int Foo() { + return 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| int Foo() { +1| return 0; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| return 0; + +[#2 Removal] = 1:0-2:0 + >------------- +1| return 0; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.switch.scope b/data/fixtures/scopes/csharp/statement/statement.switch.scope new file mode 100644 index 0000000000..bcd2bb4acb --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.switch.scope @@ -0,0 +1,10 @@ +switch (foo) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| switch (foo) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.try.scope b/data/fixtures/scopes/csharp/statement/statement.try.scope new file mode 100644 index 0000000000..84dd0fc716 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.try.scope @@ -0,0 +1,15 @@ +try {} +catch(Exception e) {} +finally {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:10 + >------ +0| try {} +1| catch(Exception e) {} +2| finally {} + ----------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.scope b/data/fixtures/scopes/csharp/statement/statement.variable.scope similarity index 100% rename from data/fixtures/scopes/csharp/statement/statement.scope rename to data/fixtures/scopes/csharp/statement/statement.variable.scope diff --git a/data/fixtures/scopes/csharp/statement/statement.while.scope b/data/fixtures/scopes/csharp/statement/statement.while.scope new file mode 100644 index 0000000000..5aaf57be8f --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.while.scope @@ -0,0 +1,10 @@ +while (true) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| while (true) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.yield.scope b/data/fixtures/scopes/csharp/statement/statement.yield.scope new file mode 100644 index 0000000000..c1f249a73a --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.yield.scope @@ -0,0 +1,33 @@ +IEnumerable foo() { + yield return 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------------------------ +0| IEnumerable foo() { +1| yield return 0; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:19 + >---------------< +1| yield return 0; + +[#2 Removal] = 1:0-2:0 + >------------------- +1| yield return 0; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| yield return 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/css/argument/argument.actual.multiLine.scope b/data/fixtures/scopes/css/argument/argument.actual.multiLine.scope new file mode 100644 index 0000000000..f550a04f1c --- /dev/null +++ b/data/fixtures/scopes/css/argument/argument.actual.multiLine.scope @@ -0,0 +1,46 @@ +* { + clip-path: polygon( + 50% 0%, + 60% 40% + ); +} +--- + +[#1 Content] = +[#1 Domain] = 2:8-2:14 + >------< +2| 50% 0%, + +[#1 Removal] = 2:8-3:8 + >------- +2| 50% 0%, +3| 60% 40% + --------< + +[#1 Trailing delimiter] = 2:14-3:8 + >- +2| 50% 0%, +3| 60% 40% + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:8-3:15 + >-------< +3| 60% 40% + +[#2 Removal] = 2:14-3:15 + >- +2| 50% 0%, +3| 60% 40% + ---------------< + +[#2 Leading delimiter] = 2:14-3:8 + >- +2| 50% 0%, +3| 60% 40% + --------< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/css/statement.scope b/data/fixtures/scopes/css/statement.misc.scope similarity index 100% rename from data/fixtures/scopes/css/statement.scope rename to data/fixtures/scopes/css/statement.misc.scope diff --git a/data/fixtures/scopes/java/functionCall.method.scope b/data/fixtures/scopes/java/functionCall.method.scope new file mode 100644 index 0000000000..87d426d2ed --- /dev/null +++ b/data/fixtures/scopes/java/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCallee.constructor.scope b/data/fixtures/scopes/java/functionCallee.constructor.scope index e23818aa3d..81ac744168 100644 --- a/data/fixtures/scopes/java/functionCallee.constructor.scope +++ b/data/fixtures/scopes/java/functionCallee.constructor.scope @@ -6,8 +6,8 @@ new Foo(); >-------< 0| new Foo(); -[Domain] = 0:0-0:10 - >----------< +[Domain] = 0:0-0:9 + >---------< 0| new Foo(); [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCallee.method.scope b/data/fixtures/scopes/java/functionCallee.method.scope new file mode 100644 index 0000000000..f30f0f7536 --- /dev/null +++ b/data/fixtures/scopes/java/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar(); +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar(); + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCallee.scope b/data/fixtures/scopes/java/functionCallee.scope index 0dbddcd146..3071a48ae9 100644 --- a/data/fixtures/scopes/java/functionCallee.scope +++ b/data/fixtures/scopes/java/functionCallee.scope @@ -6,8 +6,8 @@ foo(); >---< 0| foo(); -[Domain] = 0:0-0:6 - >------< +[Domain] = 0:0-0:5 + >-----< 0| foo(); [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/statement/statement.assignment.scope b/data/fixtures/scopes/java/statement/statement.assignment.scope new file mode 100644 index 0000000000..552bf9f507 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.break.scope b/data/fixtures/scopes/java/statement/statement.break.scope new file mode 100644 index 0000000000..c81ea40ae7 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.break.scope @@ -0,0 +1,33 @@ +while (true) { + break; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| break; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:10 + >------< +1| break; + +[#2 Removal] = 1:0-2:0 + >---------- +1| break; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.constructor.scope b/data/fixtures/scopes/java/statement/statement.constructor.scope new file mode 100644 index 0000000000..3a473b0ece --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.constructor.scope @@ -0,0 +1,33 @@ +public class Foo { + public Foo() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------------------ +0| public class Foo { +1| public Foo() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:19 + >---------------< +1| public Foo() {} + +[#2 Removal] = 1:0-2:0 + >------------------- +1| public Foo() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| public Foo() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.constructor2.scope b/data/fixtures/scopes/java/statement/statement.constructor2.scope new file mode 100644 index 0000000000..5b808cb0d0 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.constructor2.scope @@ -0,0 +1,38 @@ +public class Foo { + @bar + public Foo() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >------------------ +0| public class Foo { +1| @bar +2| public Foo() {} +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-2:19 + >---- +1| @bar +2| public Foo() {} + -------------------< + +[#2 Removal] = 1:0-3:0 + >-------- +1| @bar +2| public Foo() {} +3| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| @bar + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.continue.scope b/data/fixtures/scopes/java/statement/statement.continue.scope new file mode 100644 index 0000000000..8715a90063 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.continue.scope @@ -0,0 +1,33 @@ +while (true) { + continue; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| continue; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| continue; + +[#2 Removal] = 1:0-2:0 + >------------- +1| continue; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.doWhile.scope b/data/fixtures/scopes/java/statement/statement.doWhile.scope new file mode 100644 index 0000000000..e1e74c9153 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.doWhile.scope @@ -0,0 +1,10 @@ +do {} while (true); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| do {} while (true); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.for.scope b/data/fixtures/scopes/java/statement/statement.for.scope new file mode 100644 index 0000000000..0094536004 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.for.scope @@ -0,0 +1,10 @@ +for (int i = 0; i < size; i++) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:33 + >---------------------------------< +0| for (int i = 0; i < size; i++) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.foreach.scope b/data/fixtures/scopes/java/statement/statement.foreach.scope new file mode 100644 index 0000000000..c699dc20f9 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for (final int v : values) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:29 + >-----------------------------< +0| for (final int v : values) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.if.scope b/data/fixtures/scopes/java/statement/statement.if.scope new file mode 100644 index 0000000000..14f2507621 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.if.scope @@ -0,0 +1,15 @@ +if (true) {} +else if (false) {} +else {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:7 + >------------ +0| if (true) {} +1| else if (false) {} +2| else {} + -------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.method.scope b/data/fixtures/scopes/java/statement/statement.method.scope new file mode 100644 index 0000000000..d709a30085 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.method.scope @@ -0,0 +1,33 @@ +public class Foo { + public void bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------------------ +0| public class Foo { +1| public void bar() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:24 + >--------------------< +1| public void bar() {} + +[#2 Removal] = 1:0-2:0 + >------------------------ +1| public void bar() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| public void bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.method2.scope b/data/fixtures/scopes/java/statement/statement.method2.scope new file mode 100644 index 0000000000..25b3db5e69 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.method2.scope @@ -0,0 +1,38 @@ +public class Foo { + @baz + public void bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >------------------ +0| public class Foo { +1| @baz +2| public void bar() {} +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-2:24 + >---- +1| @baz +2| public void bar() {} + ------------------------< + +[#2 Removal] = 1:0-3:0 + >-------- +1| @baz +2| public void bar() {} +3| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| @baz + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.resource.scope b/data/fixtures/scopes/java/statement/statement.resource.scope new file mode 100644 index 0000000000..95d2d5bf5a --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.resource.scope @@ -0,0 +1,10 @@ +try (Foo foo = create()) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:27 + >---------------------------< +0| try (Foo foo = create()) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.return.scope b/data/fixtures/scopes/java/statement/statement.return.scope new file mode 100644 index 0000000000..97e0e310e8 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.return.scope @@ -0,0 +1,60 @@ +public class Foo { + public int bar() { + return 0; + } +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-4:1 + >------------------ +0| public class Foo { +1| public int bar() { +2| return 0; +3| } +4| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-3:5 + >------------------ +1| public int bar() { +2| return 0; +3| } + -----< + +[#2 Removal] = 1:0-4:0 + >---------------------- +1| public int bar() { +2| return 0; +3| } +4| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| public int bar() { + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:8-2:17 + >---------< +2| return 0; + +[#3 Removal] = 2:0-3:0 + >----------------- +2| return 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:8 + >--------< +2| return 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.static.scope b/data/fixtures/scopes/java/statement/statement.static.scope new file mode 100644 index 0000000000..65303d72cb --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.static.scope @@ -0,0 +1,33 @@ +class Foo { + static {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| static {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| static {} + +[#2 Removal] = 1:0-2:0 + >------------- +1| static {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| static {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.switch.scope b/data/fixtures/scopes/java/statement/statement.switch.scope new file mode 100644 index 0000000000..bcd2bb4acb --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.switch.scope @@ -0,0 +1,10 @@ +switch (foo) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| switch (foo) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.try.scope b/data/fixtures/scopes/java/statement/statement.try.scope new file mode 100644 index 0000000000..1d036cd471 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.try.scope @@ -0,0 +1,15 @@ +try {} +catch(Exception ex) {} +finally {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:10 + >------ +0| try {} +1| catch(Exception ex) {} +2| finally {} + ----------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.scope b/data/fixtures/scopes/java/statement/statement.variable.scope similarity index 100% rename from data/fixtures/scopes/java/statement/statement.scope rename to data/fixtures/scopes/java/statement/statement.variable.scope diff --git a/data/fixtures/scopes/java/statement/statement.while.scope b/data/fixtures/scopes/java/statement/statement.while.scope new file mode 100644 index 0000000000..5aaf57be8f --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.while.scope @@ -0,0 +1,10 @@ +while (true) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| while (true) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.yield.scope b/data/fixtures/scopes/java/statement/statement.yield.scope new file mode 100644 index 0000000000..595607012d --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.yield.scope @@ -0,0 +1,35 @@ +switch (foo) { + case 0: + yield 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >-------------- +0| switch (foo) { +1| case 0: +2| yield 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:8-2:16 + >--------< +2| yield 0; + +[#2 Removal] = 2:0-3:0 + >---------------- +2| yield 0; +3| } + < + +[#2 Leading delimiter] = 2:0-2:8 + >--------< +2| yield 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/functionCall.method.scope b/data/fixtures/scopes/javascript.core/functionCall.method.scope new file mode 100644 index 0000000000..87d426d2ed --- /dev/null +++ b/data/fixtures/scopes/javascript.core/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/functionCallee.method.scope b/data/fixtures/scopes/javascript.core/functionCallee.method.scope new file mode 100644 index 0000000000..f30f0f7536 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar(); +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar(); + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.foreach2.scope b/data/fixtures/scopes/javascript.core/name/name.foreach2.scope new file mode 100644 index 0000000000..b104339f94 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.foreach2.scope @@ -0,0 +1,24 @@ +for (const k in values) {} +--- + +[Content] = 0:11-0:12 + >-< +0| for (const k in values) {} + +[Removal] = 0:11-0:13 + >--< +0| for (const k in values) {} + +[Leading delimiter] = 0:10-0:11 + >-< +0| for (const k in values) {} + +[Trailing delimiter] = 0:12-0:13 + >-< +0| for (const k in values) {} + +[Domain] = 0:0-0:26 + >--------------------------< +0| for (const k in values) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/statement/statement.assignment.scope b/data/fixtures/scopes/javascript.core/statement/statement.assignment.scope new file mode 100644 index 0000000000..552bf9f507 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.break.scope b/data/fixtures/scopes/javascript.core/statement/statement.break.scope new file mode 100644 index 0000000000..c81ea40ae7 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.break.scope @@ -0,0 +1,33 @@ +while (true) { + break; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| break; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:10 + >------< +1| break; + +[#2 Removal] = 1:0-2:0 + >---------- +1| break; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.constructor.scope b/data/fixtures/scopes/javascript.core/statement/statement.constructor.scope new file mode 100644 index 0000000000..15212a3a3e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.constructor.scope @@ -0,0 +1,33 @@ +class Foo { + constructor() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| constructor() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:20 + >----------------< +1| constructor() {} + +[#2 Removal] = 1:0-2:0 + >-------------------- +1| constructor() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| constructor() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.continue.scope b/data/fixtures/scopes/javascript.core/statement/statement.continue.scope new file mode 100644 index 0000000000..8715a90063 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.continue.scope @@ -0,0 +1,33 @@ +while (true) { + continue; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------- +0| while (true) { +1| continue; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| continue; + +[#2 Removal] = 1:0-2:0 + >------------- +1| continue; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.doWhile.scope b/data/fixtures/scopes/javascript.core/statement/statement.doWhile.scope new file mode 100644 index 0000000000..e1e74c9153 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.doWhile.scope @@ -0,0 +1,10 @@ +do {} while (true); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| do {} while (true); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.for.scope b/data/fixtures/scopes/javascript.core/statement/statement.for.scope new file mode 100644 index 0000000000..97ef289ef6 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.for.scope @@ -0,0 +1,10 @@ +for (let i = 0; i < size; i++) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:33 + >---------------------------------< +0| for (let i = 0; i < size; i++) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.foreach.scope b/data/fixtures/scopes/javascript.core/statement/statement.foreach.scope new file mode 100644 index 0000000000..e3cdec3288 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for (const v of values) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:26 + >--------------------------< +0| for (const v of values) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.foreach2.scope b/data/fixtures/scopes/javascript.core/statement/statement.foreach2.scope new file mode 100644 index 0000000000..13785aa1d6 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.foreach2.scope @@ -0,0 +1,10 @@ +for (const k in values) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:26 + >--------------------------< +0| for (const k in values) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function.scope b/data/fixtures/scopes/javascript.core/statement/statement.function.scope new file mode 100644 index 0000000000..5880898ab1 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function.scope @@ -0,0 +1,10 @@ +function foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| function foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function10.scope b/data/fixtures/scopes/javascript.core/statement/statement.function10.scope new file mode 100644 index 0000000000..83f336b4ac --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function10.scope @@ -0,0 +1,10 @@ +export const foo = () => {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| export const foo = () => {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function11.scope b/data/fixtures/scopes/javascript.core/statement/statement.function11.scope new file mode 100644 index 0000000000..d09d96e13d --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function11.scope @@ -0,0 +1,10 @@ +export default function() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| export default function() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function12.scope b/data/fixtures/scopes/javascript.core/statement/statement.function12.scope new file mode 100644 index 0000000000..6e69a967cd --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function12.scope @@ -0,0 +1,10 @@ +export default function *() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:30 + >------------------------------< +0| export default function *() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function13.scope b/data/fixtures/scopes/javascript.core/statement/statement.function13.scope new file mode 100644 index 0000000000..467a933307 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function13.scope @@ -0,0 +1,10 @@ +export default () => {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:24 + >------------------------< +0| export default () => {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function14.scope b/data/fixtures/scopes/javascript.core/statement/statement.function14.scope new file mode 100644 index 0000000000..2117761e48 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function14.scope @@ -0,0 +1,10 @@ +const foo = function bar() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:30 + >------------------------------< +0| const foo = function bar() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function15.scope b/data/fixtures/scopes/javascript.core/statement/statement.function15.scope new file mode 100644 index 0000000000..49c3fd37a7 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function15.scope @@ -0,0 +1,10 @@ +const foo = function *bar() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:31 + >-------------------------------< +0| const foo = function *bar() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function2.scope b/data/fixtures/scopes/javascript.core/statement/statement.function2.scope new file mode 100644 index 0000000000..036915f420 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function2.scope @@ -0,0 +1,10 @@ +function *foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| function *foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function3.scope b/data/fixtures/scopes/javascript.core/statement/statement.function3.scope new file mode 100644 index 0000000000..c1842d24b0 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function3.scope @@ -0,0 +1,10 @@ +const foo = function() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:26 + >--------------------------< +0| const foo = function() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function4.scope b/data/fixtures/scopes/javascript.core/statement/statement.function4.scope new file mode 100644 index 0000000000..b1f249a191 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function4.scope @@ -0,0 +1,10 @@ +const foo = function *() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| const foo = function *() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function5.scope b/data/fixtures/scopes/javascript.core/statement/statement.function5.scope new file mode 100644 index 0000000000..1a787531b3 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function5.scope @@ -0,0 +1,10 @@ +const foo = () => {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| const foo = () => {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function6.scope b/data/fixtures/scopes/javascript.core/statement/statement.function6.scope new file mode 100644 index 0000000000..0632e42679 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function6.scope @@ -0,0 +1,10 @@ +export function foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:24 + >------------------------< +0| export function foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function7.scope b/data/fixtures/scopes/javascript.core/statement/statement.function7.scope new file mode 100644 index 0000000000..82a5b290f1 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function7.scope @@ -0,0 +1,10 @@ +export function *foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:25 + >-------------------------< +0| export function *foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function8.scope b/data/fixtures/scopes/javascript.core/statement/statement.function8.scope new file mode 100644 index 0000000000..5614243b31 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function8.scope @@ -0,0 +1,10 @@ +export const foo = function() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:33 + >---------------------------------< +0| export const foo = function() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.function9.scope b/data/fixtures/scopes/javascript.core/statement/statement.function9.scope new file mode 100644 index 0000000000..f46b9cc307 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.function9.scope @@ -0,0 +1,10 @@ +export const foo = function *() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:35 + >-----------------------------------< +0| export const foo = function *() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.if.scope b/data/fixtures/scopes/javascript.core/statement/statement.if.scope new file mode 100644 index 0000000000..14f2507621 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.if.scope @@ -0,0 +1,15 @@ +if (true) {} +else if (false) {} +else {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:7 + >------------ +0| if (true) {} +1| else if (false) {} +2| else {} + -------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method.scope b/data/fixtures/scopes/javascript.core/statement/statement.method.scope new file mode 100644 index 0000000000..fd50592e3e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method.scope @@ -0,0 +1,33 @@ +class Foo { + bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| bar() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| bar() {} + +[#2 Removal] = 1:0-2:0 + >------------ +1| bar() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method2.scope b/data/fixtures/scopes/javascript.core/statement/statement.method2.scope new file mode 100644 index 0000000000..e707554b60 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method2.scope @@ -0,0 +1,38 @@ +class Foo { + @baz + bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| @baz +2| bar() {} +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-2:12 + >---- +1| @baz +2| bar() {} + ------------< + +[#2 Removal] = 1:0-3:0 + >-------- +1| @baz +2| bar() {} +3| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| @baz + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method3.scope b/data/fixtures/scopes/javascript.core/statement/statement.method3.scope new file mode 100644 index 0000000000..b09ef41a5d --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method3.scope @@ -0,0 +1,33 @@ +class Foo { + bar = () => {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| bar = () => {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:18 + >--------------< +1| bar = () => {} + +[#2 Removal] = 1:0-2:0 + >------------------ +1| bar = () => {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar = () => {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method4.scope b/data/fixtures/scopes/javascript.core/statement/statement.method4.scope new file mode 100644 index 0000000000..d370211186 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method4.scope @@ -0,0 +1,38 @@ +class Foo { + @baz + bar = () => {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| @baz +2| bar = () => {} +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-2:18 + >---- +1| @baz +2| bar = () => {} + ------------------< + +[#2 Removal] = 1:0-3:0 + >-------- +1| @baz +2| bar = () => {} +3| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| @baz + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method5.scope b/data/fixtures/scopes/javascript.core/statement/statement.method5.scope new file mode 100644 index 0000000000..81fc1c5db3 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method5.scope @@ -0,0 +1,33 @@ +const foo = { + bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| bar() {} + +[#2 Removal] = 1:0-2:0 + >------------ +1| bar() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method6.scope b/data/fixtures/scopes/javascript.core/statement/statement.method6.scope new file mode 100644 index 0000000000..29d61c5df2 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method6.scope @@ -0,0 +1,15 @@ +const foo = { + bar: function() {} +} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar: function() {} +2| } + -< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method7.scope b/data/fixtures/scopes/javascript.core/statement/statement.method7.scope new file mode 100644 index 0000000000..8a826d6de6 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method7.scope @@ -0,0 +1,15 @@ +const foo = { + bar: function *() {} +} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar: function *() {} +2| } + -< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method8.scope b/data/fixtures/scopes/javascript.core/statement/statement.method8.scope new file mode 100644 index 0000000000..e09923487f --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.method8.scope @@ -0,0 +1,15 @@ +const foo = { + bar: () => {} +} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar: () => {} +2| } + -< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.return.scope b/data/fixtures/scopes/javascript.core/statement/statement.return.scope new file mode 100644 index 0000000000..732ae5470f --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.return.scope @@ -0,0 +1,33 @@ +function foo() { + return 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------- +0| function foo() { +1| return 0; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| return 0; + +[#2 Removal] = 1:0-2:0 + >------------- +1| return 0; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.static.scope b/data/fixtures/scopes/javascript.core/statement/statement.static.scope new file mode 100644 index 0000000000..65303d72cb --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.static.scope @@ -0,0 +1,33 @@ +class Foo { + static {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| static {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| static {} + +[#2 Removal] = 1:0-2:0 + >------------- +1| static {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| static {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.switch.scope b/data/fixtures/scopes/javascript.core/statement/statement.switch.scope new file mode 100644 index 0000000000..bcd2bb4acb --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.switch.scope @@ -0,0 +1,10 @@ +switch (foo) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| switch (foo) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.try.scope b/data/fixtures/scopes/javascript.core/statement/statement.try.scope new file mode 100644 index 0000000000..8226fcbede --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.try.scope @@ -0,0 +1,15 @@ +try {} +catch(e) {} +finally {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:10 + >------ +0| try {} +1| catch(e) {} +2| finally {} + ----------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/statement/statement.scope rename to data/fixtures/scopes/javascript.core/statement/statement.variable.scope diff --git a/data/fixtures/scopes/c/namedFunction.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable2.scope similarity index 52% rename from data/fixtures/scopes/c/namedFunction.scope rename to data/fixtures/scopes/javascript.core/statement/statement.variable2.scope index 74e8628bdc..cebc33100e 100644 --- a/data/fixtures/scopes/c/namedFunction.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.variable2.scope @@ -1,10 +1,10 @@ -int foo() {} +let foo = 0; --- [Content] = [Removal] = [Domain] = 0:0-0:12 >------------< -0| int foo() {} +0| let foo = 0; -[Insertion delimiter] = "\n\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.while.scope b/data/fixtures/scopes/javascript.core/statement/statement.while.scope new file mode 100644 index 0000000000..5aaf57be8f --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.while.scope @@ -0,0 +1,10 @@ +while (true) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| while (true) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.yield.scope b/data/fixtures/scopes/javascript.core/statement/statement.yield.scope new file mode 100644 index 0000000000..d90a74d3bf --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.yield.scope @@ -0,0 +1,10 @@ +yield 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| yield 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/value/value.foreach2.scope b/data/fixtures/scopes/javascript.core/value/value.foreach2.scope new file mode 100644 index 0000000000..15d3df9cef --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value/value.foreach2.scope @@ -0,0 +1,20 @@ +for (const k in values) {} +--- + +[Content] = 0:16-0:22 + >------< +0| for (const k in values) {} + +[Removal] = 0:15-0:22 + >-------< +0| for (const k in values) {} + +[Leading delimiter] = 0:15-0:16 + >-< +0| for (const k in values) {} + +[Domain] = 0:0-0:26 + >--------------------------< +0| for (const k in values) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/functionCall.method.scope b/data/fixtures/scopes/lua/functionCall.method.scope new file mode 100644 index 0000000000..6ab0ba4c3a --- /dev/null +++ b/data/fixtures/scopes/lua/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar() +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/functionCall.method2.scope b/data/fixtures/scopes/lua/functionCall.method2.scope new file mode 100644 index 0000000000..07aa870f48 --- /dev/null +++ b/data/fixtures/scopes/lua/functionCall.method2.scope @@ -0,0 +1,10 @@ +foo:bar() +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo:bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/functionCallee.method.scope b/data/fixtures/scopes/lua/functionCallee.method.scope new file mode 100644 index 0000000000..e77bc361ec --- /dev/null +++ b/data/fixtures/scopes/lua/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar() +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar() + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/functionCallee.method2.scope b/data/fixtures/scopes/lua/functionCallee.method2.scope new file mode 100644 index 0000000000..50a2a586b0 --- /dev/null +++ b/data/fixtures/scopes/lua/functionCallee.method2.scope @@ -0,0 +1,13 @@ +foo:bar() +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo:bar() + +[Domain] = 0:0-0:9 + >---------< +0| foo:bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/ifStatement.scope b/data/fixtures/scopes/lua/ifStatement.scope index f92c2b599b..6b4ce6eac9 100644 --- a/data/fixtures/scopes/lua/ifStatement.scope +++ b/data/fixtures/scopes/lua/ifStatement.scope @@ -1,23 +1,17 @@ if true then - a = 1 elseif false then - a = 2 else - a = 3 end --- [Content] = [Removal] = -[Domain] = 0:0-6:3 +[Domain] = 0:0-3:3 >------------ 0| if true then -1| a = 1 -2| elseif false then -3| a = 2 -4| else -5| a = 3 -6| end +1| elseif false then +2| else +3| end ---< [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement.if.scope b/data/fixtures/scopes/lua/statement.if.scope new file mode 100644 index 0000000000..6b4ce6eac9 --- /dev/null +++ b/data/fixtures/scopes/lua/statement.if.scope @@ -0,0 +1,17 @@ +if true then +elseif false then +else +end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:3 + >------------ +0| if true then +1| elseif false then +2| else +3| end + ---< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/markdown/collectionItem.unenclosed.iteration.scope b/data/fixtures/scopes/markdown/collectionItem.unenclosed.iteration.scope new file mode 100644 index 0000000000..1ad353d354 --- /dev/null +++ b/data/fixtures/scopes/markdown/collectionItem.unenclosed.iteration.scope @@ -0,0 +1,20 @@ +- This is the first level of a list. + - This is the second level of a list. +- This is the first level of a list again. +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:42 + >------------------------------------ +0| - This is the first level of a list. +1| - This is the second level of a list. +2| - This is the first level of a list again. + ------------------------------------------< + + +[#2 Content] = +[#2 Domain] = 1:2-2:0 + >------------------------------------- +1| - This is the second level of a list. +2| - This is the first level of a list again. + < diff --git a/data/fixtures/scopes/python/branch/branch.try.iteration.scope b/data/fixtures/scopes/python/branch/branch.try.iteration.scope index 9a0ca11b98..4ba294aac3 100644 --- a/data/fixtures/scopes/python/branch/branch.try.iteration.scope +++ b/data/fixtures/scopes/python/branch/branch.try.iteration.scope @@ -1,18 +1,12 @@ -try: - pass -except: - pass -finally: - pass +try: pass +except: pass +finally: pass --- [Content] = -[Domain] = 0:0-5:8 - >---- -0| try: -1| pass -2| except: -3| pass -4| finally: -5| pass - --------< +[Domain] = 0:0-2:13 + >--------- +0| try: pass +1| except: pass +2| finally: pass + -------------< diff --git a/data/fixtures/scopes/python/branch/branch.try.scope b/data/fixtures/scopes/python/branch/branch.try.scope index a17648dcf7..931f93f2b0 100644 --- a/data/fixtures/scopes/python/branch/branch.try.scope +++ b/data/fixtures/scopes/python/branch/branch.try.scope @@ -1,57 +1,45 @@ -try: - pass -except: - pass -finally: - pass +try: pass +except: pass +finally: pass --- [#1 Content] = -[#1 Domain] = 0:0-1:8 - >---- -0| try: -1| pass - --------< - -[#1 Removal] = 0:0-2:0 - >---- -0| try: -1| pass -2| except: +[#1 Domain] = 0:0-0:9 + >---------< +0| try: pass + +[#1 Removal] = 0:0-1:0 + >--------- +0| try: pass +1| except: pass < [#1 Insertion delimiter] = "\n" [#2 Content] = -[#2 Domain] = 2:0-3:8 - >------- -2| except: -3| pass - --------< - -[#2 Removal] = 2:0-4:0 - >------- -2| except: -3| pass -4| finally: +[#2 Domain] = 1:0-1:12 + >------------< +1| except: pass + +[#2 Removal] = 1:0-2:0 + >------------ +1| except: pass +2| finally: pass < [#2 Insertion delimiter] = "\n" [#3 Content] = -[#3 Domain] = 4:0-5:8 - >-------- -4| finally: -5| pass - --------< - -[#3 Removal] = 3:8-5:8 - > -3| pass -4| finally: -5| pass - --------< +[#3 Domain] = 2:0-2:13 + >-------------< +2| finally: pass + +[#3 Removal] = 1:12-2:13 + > +1| except: pass +2| finally: pass + -------------< [#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/branch/branch.try2.scope b/data/fixtures/scopes/python/branch/branch.try2.scope index b1832ed988..0a903a4568 100644 --- a/data/fixtures/scopes/python/branch/branch.try2.scope +++ b/data/fixtures/scopes/python/branch/branch.try2.scope @@ -1,57 +1,45 @@ -try: - pass -except Exception as e: - pass -else: - pass +try: pass +except Exception as e: pass +else: pass --- [#1 Content] = -[#1 Domain] = 0:0-1:8 - >---- -0| try: -1| pass - --------< - -[#1 Removal] = 0:0-2:0 - >---- -0| try: -1| pass -2| except Exception as e: +[#1 Domain] = 0:0-0:9 + >---------< +0| try: pass + +[#1 Removal] = 0:0-1:0 + >--------- +0| try: pass +1| except Exception as e: pass < [#1 Insertion delimiter] = "\n" [#2 Content] = -[#2 Domain] = 2:0-3:8 - >---------------------- -2| except Exception as e: -3| pass - --------< - -[#2 Removal] = 2:0-4:0 - >---------------------- -2| except Exception as e: -3| pass -4| else: +[#2 Domain] = 1:0-1:27 + >---------------------------< +1| except Exception as e: pass + +[#2 Removal] = 1:0-2:0 + >--------------------------- +1| except Exception as e: pass +2| else: pass < [#2 Insertion delimiter] = "\n" [#3 Content] = -[#3 Domain] = 4:0-5:8 - >----- -4| else: -5| pass - --------< - -[#3 Removal] = 3:8-5:8 - > -3| pass -4| else: -5| pass - --------< +[#3 Domain] = 2:0-2:10 + >----------< +2| else: pass + +[#3 Removal] = 1:27-2:10 + > +1| except Exception as e: pass +2| else: pass + ----------< [#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/class.scope b/data/fixtures/scopes/python/class.scope index 450a9fd782..94c99f9f8f 100644 --- a/data/fixtures/scopes/python/class.scope +++ b/data/fixtures/scopes/python/class.scope @@ -1,13 +1,10 @@ -class Foo: - pass +class Foo: pass --- [Content] = [Removal] = -[Domain] = 0:0-1:8 - >---------- -0| class Foo: -1| pass - --------< +[Domain] = 0:0-0:15 + >---------------< +0| class Foo: pass [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/python/class2.scope b/data/fixtures/scopes/python/class2.scope index eca5dfb37d..50963bf184 100644 --- a/data/fixtures/scopes/python/class2.scope +++ b/data/fixtures/scopes/python/class2.scope @@ -1,15 +1,13 @@ @bar -class Foo: - pass +class Foo: pass --- [Content] = [Removal] = -[Domain] = 0:0-2:8 +[Domain] = 0:0-1:15 >---- 0| @bar -1| class Foo: -2| pass - --------< +1| class Foo: pass + ---------------< [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/python/condition/condition.while.scope b/data/fixtures/scopes/python/condition/condition.while.scope index 14b9585e9f..80bf2c0990 100644 --- a/data/fixtures/scopes/python/condition/condition.while.scope +++ b/data/fixtures/scopes/python/condition/condition.while.scope @@ -1,23 +1,20 @@ -while True: - pass +while True: pass --- [Content] = 0:6-0:10 >----< -0| while True: +0| while True: pass [Removal] = 0:5-0:10 >-----< -0| while True: +0| while True: pass [Leading delimiter] = 0:5-0:6 >-< -0| while True: +0| while True: pass -[Domain] = 0:0-1:8 - >----------- -0| while True: -1| pass - --------< +[Domain] = 0:0-0:16 + >----------------< +0| while True: pass [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/functionCall.method.scope b/data/fixtures/scopes/python/functionCall.method.scope new file mode 100644 index 0000000000..6ab0ba4c3a --- /dev/null +++ b/data/fixtures/scopes/python/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar() +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/functionCallee.method.scope b/data/fixtures/scopes/python/functionCallee.method.scope new file mode 100644 index 0000000000..e77bc361ec --- /dev/null +++ b/data/fixtures/scopes/python/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar() +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar() + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/namedFunction/namedFunction.constructor.scope b/data/fixtures/scopes/python/namedFunction/namedFunction.constructor.scope index c0b44dccef..1422f8036a 100644 --- a/data/fixtures/scopes/python/namedFunction/namedFunction.constructor.scope +++ b/data/fixtures/scopes/python/namedFunction/namedFunction.constructor.scope @@ -1,20 +1,20 @@ class Foo: - def __init__(self, aaa: str, bbb: int): pass + def __init__(self): pass --- [Content] = -[Domain] = 1:4-1:48 - >--------------------------------------------< -1| def __init__(self, aaa: str, bbb: int): pass +[Domain] = 1:4-1:28 + >------------------------< +1| def __init__(self): pass -[Removal] = 0:10-1:48 +[Removal] = 0:10-1:28 > 0| class Foo: -1| def __init__(self, aaa: str, bbb: int): pass - ------------------------------------------------< +1| def __init__(self): pass + ----------------------------< [Leading delimiter] = 1:0-1:4 >----< -1| def __init__(self, aaa: str, bbb: int): pass +1| def __init__(self): pass [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/python/namedFunction/namedFunction.iteration.class.scope b/data/fixtures/scopes/python/namedFunction/namedFunction.iteration.class.scope index 7ec5e468a5..c91c1c425a 100644 --- a/data/fixtures/scopes/python/namedFunction/namedFunction.iteration.class.scope +++ b/data/fixtures/scopes/python/namedFunction/namedFunction.iteration.class.scope @@ -1,16 +1,13 @@ -class Foo: - def bar(): pass +class Foo: pass --- [#1 Content] = -[#1 Domain] = 0:0-1:19 - >---------- -0| class Foo: -1| def bar(): pass - -------------------< +[#1 Domain] = 0:0-0:15 + >---------------< +0| class Foo: pass [#2 Content] = -[#2 Domain] = 1:4-1:19 - >---------------< -1| def bar(): pass +[#2 Domain] = 0:11-0:15 + >----< +0| class Foo: pass diff --git a/data/fixtures/scopes/python/namedFunction/namedFunction2.scope b/data/fixtures/scopes/python/namedFunction/namedFunction2.scope index 19d1f7b240..c63d73d862 100644 --- a/data/fixtures/scopes/python/namedFunction/namedFunction2.scope +++ b/data/fixtures/scopes/python/namedFunction/namedFunction2.scope @@ -1,13 +1,13 @@ @bar -def foo() -> str: pass +def foo(): pass --- [Content] = [Removal] = -[Domain] = 0:0-1:22 +[Domain] = 0:0-1:15 >---- 0| @bar -1| def foo() -> str: pass - ----------------------< +1| def foo(): pass + ---------------< [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/python/statement/statement.scope b/data/fixtures/scopes/python/statement/statement.assignment.scope similarity index 100% rename from data/fixtures/scopes/python/statement/statement.scope rename to data/fixtures/scopes/python/statement/statement.assignment.scope diff --git a/data/fixtures/scopes/python/statement/statement.break.scope b/data/fixtures/scopes/python/statement/statement.break.scope new file mode 100644 index 0000000000..1b7021e36a --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.break.scope @@ -0,0 +1,31 @@ +while True: + break +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:9 + >----------- +0| while True: +1| break + ---------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| break + +[#2 Removal] = 0:11-1:9 + > +0| while True: +1| break + ---------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.class.scope b/data/fixtures/scopes/python/statement/statement.class.scope index 6e714329a2..d9d94dbe6b 100644 --- a/data/fixtures/scopes/python/statement/statement.class.scope +++ b/data/fixtures/scopes/python/statement/statement.class.scope @@ -1,26 +1,10 @@ class Foo: pass --- -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-0:15 +[Content] = +[Removal] = +[Domain] = 0:0-0:15 >---------------< 0| class Foo: pass -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 0:11-0:15 - >----< -0| class Foo: pass - -[#2 Removal] = 0:10-0:15 - >-----< -0| class Foo: pass - -[#2 Leading delimiter] = 0:10-0:11 - >-< -0| class Foo: pass - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.class2.scope b/data/fixtures/scopes/python/statement/statement.class2.scope new file mode 100644 index 0000000000..8c1d393c2e --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.class2.scope @@ -0,0 +1,13 @@ +@bar +class Foo: pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:15 + >---- +0| @bar +1| class Foo: pass + ---------------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.constructor.scope b/data/fixtures/scopes/python/statement/statement.constructor.scope new file mode 100644 index 0000000000..e07371db71 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.constructor.scope @@ -0,0 +1,31 @@ +class Foo: + def __init__(self): pass +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:28 + >---------- +0| class Foo: +1| def __init__(self): pass + ----------------------------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:28 + >------------------------< +1| def __init__(self): pass + +[#2 Removal] = 0:10-1:28 + > +0| class Foo: +1| def __init__(self): pass + ----------------------------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| def __init__(self): pass + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.continue.scope b/data/fixtures/scopes/python/statement/statement.continue.scope new file mode 100644 index 0000000000..61c679b416 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.continue.scope @@ -0,0 +1,31 @@ +while True: + continue +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:12 + >----------- +0| while True: +1| continue + ------------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| continue + +[#2 Removal] = 0:11-1:12 + > +0| while True: +1| continue + ------------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.foreach.scope b/data/fixtures/scopes/python/statement/statement.foreach.scope new file mode 100644 index 0000000000..a37c516a89 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for v in values: pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| for v in values: pass + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.function.scope b/data/fixtures/scopes/python/statement/statement.function.scope new file mode 100644 index 0000000000..3b29fb8bb6 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.function.scope @@ -0,0 +1,10 @@ +def foo(): pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| def foo(): pass + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.function2.scope b/data/fixtures/scopes/python/statement/statement.function2.scope new file mode 100644 index 0000000000..7fd1a0645e --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.function2.scope @@ -0,0 +1,13 @@ +@bar +def foo(): pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:15 + >---- +0| @bar +1| def foo(): pass + ---------------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.if.scope b/data/fixtures/scopes/python/statement/statement.if.scope new file mode 100644 index 0000000000..16b00e99dc --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.if.scope @@ -0,0 +1,15 @@ +if True: pass +elif False: pass +else: pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:10 + >------------- +0| if True: pass +1| elif False: pass +2| else: pass + ----------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.method.scope b/data/fixtures/scopes/python/statement/statement.method.scope new file mode 100644 index 0000000000..c2c7e6ff5a --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.method.scope @@ -0,0 +1,31 @@ +class Foo: + def bar(): pass +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:19 + >---------- +0| class Foo: +1| def bar(): pass + -------------------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:19 + >---------------< +1| def bar(): pass + +[#2 Removal] = 0:10-1:19 + > +0| class Foo: +1| def bar(): pass + -------------------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| def bar(): pass + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.resource.scope b/data/fixtures/scopes/python/statement/statement.resource.scope new file mode 100644 index 0000000000..a2280cc5e3 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.resource.scope @@ -0,0 +1,10 @@ +with foo as bar: pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| with foo as bar: pass + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.return.scope b/data/fixtures/scopes/python/statement/statement.return.scope new file mode 100644 index 0000000000..41d04f874e --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.return.scope @@ -0,0 +1,31 @@ +def bar(): + return 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:12 + >---------- +0| def bar(): +1| return 0 + ------------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| return 0 + +[#2 Removal] = 0:10-1:12 + > +0| def bar(): +1| return 0 + ------------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0 + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.switch.scope b/data/fixtures/scopes/python/statement/statement.switch.scope new file mode 100644 index 0000000000..0bbeb17605 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.switch.scope @@ -0,0 +1,13 @@ +match foo: + pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:8 + >---------- +0| match foo: +1| pass + --------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.try.scope b/data/fixtures/scopes/python/statement/statement.try.scope new file mode 100644 index 0000000000..fb84ec8b94 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.try.scope @@ -0,0 +1,15 @@ +try: pass +except: pass +finally: pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:13 + >--------- +0| try: pass +1| except: pass +2| finally: pass + -------------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.variable.scope b/data/fixtures/scopes/python/statement/statement.variable.scope new file mode 100644 index 0000000000..acdb2b1498 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.variable.scope @@ -0,0 +1,10 @@ +foo = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.while.scope b/data/fixtures/scopes/python/statement/statement.while.scope new file mode 100644 index 0000000000..8e1548fe9d --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.while.scope @@ -0,0 +1,10 @@ +while True: pass +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| while True: pass + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.yield.scope b/data/fixtures/scopes/python/statement/statement.yield.scope new file mode 100644 index 0000000000..1e1c6e105e --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.yield.scope @@ -0,0 +1,31 @@ +def foo(): + yield 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:11 + >---------- +0| def foo(): +1| yield 0 + -----------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:11 + >-------< +1| yield 0 + +[#2 Removal] = 0:10-1:11 + > +0| def foo(): +1| yield 0 + -----------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| yield 0 + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/r/functionCall.method.scope b/data/fixtures/scopes/r/functionCall.method.scope new file mode 100644 index 0000000000..6ab0ba4c3a --- /dev/null +++ b/data/fixtures/scopes/r/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar() +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/functionCallee.method.scope b/data/fixtures/scopes/r/functionCallee.method.scope new file mode 100644 index 0000000000..e77bc361ec --- /dev/null +++ b/data/fixtures/scopes/r/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar() +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar() + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/functionCallee.scope b/data/fixtures/scopes/r/functionCallee.scope index 1db3ea550d..2b075b5c33 100644 --- a/data/fixtures/scopes/r/functionCallee.scope +++ b/data/fixtures/scopes/r/functionCallee.scope @@ -2,9 +2,12 @@ foo() --- [Content] = -[Removal] = -[Domain] = 0:0-0:3 +[Removal] = 0:0-0:3 >---< 0| foo() +[Domain] = 0:0-0:5 + >-----< +0| foo() + [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scm/statement.scope b/data/fixtures/scopes/scm/statement.misc.scope similarity index 100% rename from data/fixtures/scopes/scm/statement.scope rename to data/fixtures/scopes/scm/statement.misc.scope diff --git a/data/fixtures/scopes/talon/functionCall.method.scope b/data/fixtures/scopes/talon/functionCall.method.scope new file mode 100644 index 0000000000..2fa559053b --- /dev/null +++ b/data/fixtures/scopes/talon/functionCall.method.scope @@ -0,0 +1,17 @@ +foo: bar.baz() +--- + +[Content] = +[Domain] = 0:5-0:14 + >---------< +0| foo: bar.baz() + +[Removal] = 0:4-0:14 + >----------< +0| foo: bar.baz() + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: bar.baz() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/functionCall.scope b/data/fixtures/scopes/talon/functionCall.scope new file mode 100644 index 0000000000..2de61468a7 --- /dev/null +++ b/data/fixtures/scopes/talon/functionCall.scope @@ -0,0 +1,17 @@ +foo: bar() +--- + +[Content] = +[Domain] = 0:5-0:10 + >-----< +0| foo: bar() + +[Removal] = 0:4-0:10 + >------< +0| foo: bar() + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/functionCallee.method.scope b/data/fixtures/scopes/talon/functionCallee.method.scope new file mode 100644 index 0000000000..f9e5c17dce --- /dev/null +++ b/data/fixtures/scopes/talon/functionCallee.method.scope @@ -0,0 +1,17 @@ +foo: bar.baz() +--- + +[Content] = +[Removal] = 0:5-0:12 + >-------< +0| foo: bar.baz() + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: bar.baz() + +[Domain] = 0:5-0:14 + >---------< +0| foo: bar.baz() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/functionCallee.scope b/data/fixtures/scopes/talon/functionCallee.scope new file mode 100644 index 0000000000..565cc7c259 --- /dev/null +++ b/data/fixtures/scopes/talon/functionCallee.scope @@ -0,0 +1,17 @@ +foo: bar() +--- + +[Content] = +[Removal] = 0:5-0:8 + >---< +0| foo: bar() + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: bar() + +[Domain] = 0:5-0:10 + >-----< +0| foo: bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/interior.command.scope b/data/fixtures/scopes/talon/interior.command.scope index 415e113c23..1f3a9d4c54 100644 --- a/data/fixtures/scopes/talon/interior.command.scope +++ b/data/fixtures/scopes/talon/interior.command.scope @@ -1,16 +1,16 @@ -command: - foo = 0 +foo: + bar = 0 --- [Content] = [Removal] = 1:4-1:11 >-------< -1| foo = 0 +1| bar = 0 [Domain] = 0:0-1:11 - >-------- -0| command: -1| foo = 0 + >---- +0| foo: +1| bar = 0 -----------< [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/statement.scope b/data/fixtures/scopes/talon/statement.assignment.scope similarity index 62% rename from data/fixtures/scopes/talon/statement.scope rename to data/fixtures/scopes/talon/statement.assignment.scope index 6a5a9a2ff7..222847c401 100644 --- a/data/fixtures/scopes/talon/statement.scope +++ b/data/fixtures/scopes/talon/statement.assignment.scope @@ -1,13 +1,13 @@ -command: - foo = 0 +foo: + bar = 0 --- [#1 Content] = [#1 Removal] = [#1 Domain] = 0:0-1:11 - >-------- -0| command: -1| foo = 0 + >---- +0| foo: +1| bar = 0 -----------< [#1 Insertion delimiter] = "\n" @@ -16,16 +16,16 @@ command: [#2 Content] = [#2 Domain] = 1:4-1:11 >-------< -1| foo = 0 +1| bar = 0 -[#2 Removal] = 0:8-1:11 - > -0| command: -1| foo = 0 +[#2 Removal] = 0:4-1:11 + > +0| foo: +1| bar = 0 -----------< [#2 Leading delimiter] = 1:0-1:4 >----< -1| foo = 0 +1| bar = 0 [#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/talon/statement.command.scope b/data/fixtures/scopes/talon/statement.command.scope new file mode 100644 index 0000000000..95d8e05b2d --- /dev/null +++ b/data/fixtures/scopes/talon/statement.command.scope @@ -0,0 +1,26 @@ +foo: "bar" +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:10 + >----------< +0| foo: "bar" + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:5-0:10 + >-----< +0| foo: "bar" + +[#2 Removal] = 0:4-0:10 + >------< +0| foo: "bar" + +[#2 Leading delimiter] = 0:4-0:5 + >-< +0| foo: "bar" + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/talon/statement.iteration.block.scope b/data/fixtures/scopes/talon/statement.iteration.block.scope index 02bd0ff62b..a3fcadf03d 100644 --- a/data/fixtures/scopes/talon/statement.iteration.block.scope +++ b/data/fixtures/scopes/talon/statement.iteration.block.scope @@ -1,16 +1,16 @@ -command: - foo = 0 +foo: + bar = 0 --- [#1 Content] = [#1 Domain] = 0:0-1:11 - >-------- -0| command: -1| foo = 0 + >---- +0| foo: +1| bar = 0 -----------< [#2 Content] = [#2 Domain] = 1:4-1:11 >-------< -1| foo = 0 +1| bar = 0 diff --git a/data/fixtures/scopes/talon/statement.variable.scope b/data/fixtures/scopes/talon/statement.variable.scope new file mode 100644 index 0000000000..222847c401 --- /dev/null +++ b/data/fixtures/scopes/talon/statement.variable.scope @@ -0,0 +1,31 @@ +foo: + bar = 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:11 + >---- +0| foo: +1| bar = 0 + -----------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:11 + >-------< +1| bar = 0 + +[#2 Removal] = 0:4-1:11 + > +0| foo: +1| bar = 0 + -----------< + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar = 0 + +[#2 Insertion delimiter] = "\n" diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 6ac53724b6..3e78e4b016 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -1,14 +1,14 @@ ### anonymousFunction -- `anonymousFunction` An anonymous function, eg a lambda function, an arrow function, etc +- `anonymousFunction` An anonymous function, eg a lambda function, an arrow function, etc. ### argumentOrParameter -- `argument.actual.constructor.iteration` Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call. +- `argument.actual.constructor.iteration` Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. - `argument.actual.constructor.multiLine` A multi line argument in a constructor call. Insertion delimiter should include new line. - `argument.actual.constructor.singleLine` A single line argument in a constructor call - `argument.actual.iteration` Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. -- `argument.actual.method.iteration` Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. +- `argument.actual.method.iteration` Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call.. - `argument.actual.method.multiLine` A multi line argument in a method call. Insertion delimiter should include new line. - `argument.actual.method.singleLine` A single line argument in a method call - `argument.actual.multiLine` A multiline argument in a function call. Insertion delimiter should include new line. @@ -144,11 +144,13 @@ - `functionCall` A function call - `functionCall.constructor` A constructor call +- `functionCall.method` A method call ### functionCallee - `functionCallee` The function being called in a function call -- `functionCallee.constructor` The class being constructed in a class instantiation, including the `new` keyword +- `functionCallee.constructor` The class being constructed in a class instantiation, including the `new` keyword. +- `functionCallee.method` The function being called in a method call, including parent objects. ### identifier @@ -285,16 +287,36 @@ ### statement -- `statement` A statement, eg assignment, for loop, etc +- `statement.assignment` An assignment statement +- `statement.break` A break statement - `statement.class` A class declaration +- `statement.command` A command statement, eg Talon spoken command or bash +- `statement.constructor` A constructor declaration +- `statement.continue` A continue statement +- `statement.doWhile` A do-while loop statement - `statement.enum` An enum declaration - `statement.field.class` A field declaration in a class - `statement.field.interface` A field declaration in a interface +- `statement.for` A for loop statement +- `statement.foreach` A for-each loop statement +- `statement.function` A named function declaration +- `statement.if` A if/elif/else statement - `statement.interface` An interface declaration - `statement.iteration.block` Iteration scope for statements: statement blocks (body of functions/if-statements/for-loops/etc). - `statement.iteration.class` Iteration scope for statements: class bodies. - `statement.iteration.document` Iteration scope for statements: the entire document including leading and trailing empty lines. - `statement.iteration.interface` Iteration scope for statements: interface bodies. +- `statement.method` A method declaration +- `statement.misc` A miscellaneous statement +- `statement.namespace` A namespace declaration +- `statement.resource` A 'with' / 'use' / 'using' statement +- `statement.return` A return statement +- `statement.static` A static statement +- `statement.switch` A switch statement +- `statement.try` A try/catch/finally statement +- `statement.variable` A variable declaration +- `statement.while` A while loop statement +- `statement.yield` A yield statement ### string diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 5e7cd84952..944f13664b 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -8,10 +8,22 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { disqualifyDelimiter: supported, ifStatement: supported, - statement: supported, + "statement.class": supported, "statement.enum": supported, "statement.field.class": supported, + "statement.function": supported, + "statement.if": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.while": supported, + "statement.doWhile": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.namespace": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.block": supported, @@ -26,7 +38,9 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.document": supported, functionCall: supported, + "functionCall.method": supported, functionCallee: supported, + "functionCallee.method": supported, "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, @@ -134,6 +148,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.element": notApplicable, // Resource syntax + "statement.resource": notApplicable, "interior.resource": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, @@ -171,6 +186,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, @@ -186,14 +202,6 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Nested class "class.iteration.block": notApplicable, - // Try catch - "branch.try": notApplicable, - "branch.try.iteration": notApplicable, - "interior.try": notApplicable, - "argument.catch": notApplicable, - "name.argument.catch": notApplicable, - "type.argument.catch": notApplicable, - // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, @@ -206,14 +214,21 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.interface": notApplicable, "interior.interface": notApplicable, + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Yield + "statement.yield": notApplicable, + "value.yield": notApplicable, + // Miscellaneous "key.attribute": notApplicable, "value.attribute": notApplicable, - "value.yield": notApplicable, "value.field.class": notApplicable, - "interior.static": notApplicable, "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, + "statement.misc": notApplicable, environment: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -260,6 +275,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.constructor": notApplicable, "name.constructor": notApplicable, "namedFunction.constructor": notApplicable, + "statement.constructor": notApplicable, "type.argument.formal.constructor.iteration": notApplicable, "type.argument.formal.constructor": notApplicable, "value.argument.formal.constructor.iteration": notApplicable, @@ -267,6 +283,9 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "interior.constructor": notApplicable, // Method + "namedFunction.method": notApplicable, + "namedFunction.iteration.class": notApplicable, + "statement.method": notApplicable, "argument.formal.method.iteration": notApplicable, "argument.formal.method.singleLine": notApplicable, "argument.formal.method.multiLine": notApplicable, @@ -276,15 +295,23 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.argument.formal.method": notApplicable, "name.method": notApplicable, - "namedFunction.iteration.class": notApplicable, - "namedFunction.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, "value.argument.formal.method": notApplicable, "interior.method": notApplicable, + // Try catch + "statement.try": notApplicable, + "branch.try": notApplicable, + "branch.try.iteration": notApplicable, + "interior.try": notApplicable, + "argument.catch": notApplicable, + "name.argument.catch": notApplicable, + "type.argument.catch": notApplicable, + // Foreach + "statement.foreach": notApplicable, "name.foreach": notApplicable, "type.foreach": notApplicable, "value.foreach": notApplicable, @@ -299,6 +326,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": notApplicable, // Namespace + "statement.namespace": notApplicable, "name.namespace": notApplicable, "interior.namespace": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index a1855015f8..25feebc0c0 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -10,6 +10,11 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { attribute: supported, anonymousFunction: supported, + "statement.try": supported, + "statement.foreach": supported, + "statement.constructor": supported, + "statement.method": supported, + "branch.try": supported, "branch.try.iteration": supported, @@ -25,6 +30,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, + "argument.catch": supported, "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, @@ -50,6 +56,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": supported, "name.argument.formal.constructor": supported, "name.argument.formal.constructor.iteration": supported, + "name.argument.catch": supported, "name.constructor": supported, "name.foreach": supported, "name.method": supported, @@ -69,6 +76,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": supported, "type.argument.formal.constructor": supported, "type.argument.formal.constructor.iteration": supported, + "type.argument.catch": supported, "type.foreach": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 22fac31308..0d3d64074b 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -19,8 +19,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { functionCall: supported, "functionCall.constructor": supported, + "functionCall.method": supported, functionCallee: supported, "functionCallee.constructor": supported, + "functionCallee.method": supported, namedFunction: supported, "namedFunction.iteration.document": supported, @@ -167,16 +169,32 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "argument.catch": supported, ifStatement: supported, - statement: supported, + "statement.class": supported, "statement.interface": supported, "statement.enum": supported, "statement.field.class": supported, "statement.field.interface": supported, - "statement.iteration.block": supported, + "statement.function": supported, + "statement.constructor": supported, + "statement.method": supported, + "statement.if": supported, + "statement.try": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.doWhile": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.yield": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.interface": supported, - "statement.iteration.document": supported, + "statement.iteration.block": supported, "string.singleLine": supported, "string.multiLine": supported, @@ -226,6 +244,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual.iteration": notApplicable, // Resource syntax + "statement.resource": notApplicable, "interior.resource": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, @@ -250,6 +269,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, @@ -263,6 +283,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed": notApplicable, // Namespace + "statement.namespace": notApplicable, "name.namespace": notApplicable, "interior.namespace": notApplicable, @@ -270,11 +291,15 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + // Miscellaneous + "statement.misc": notApplicable, environment: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, selector: notApplicable, unit: notApplicable, - "interior.static": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index f2be42cfbf..e58f96723d 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -13,6 +13,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { functionCallee: supported, "argument.actual.singleLine": supported, + "argument.actual.multiLine": supported, "argument.actual.iteration": supported, "argumentList.actual.empty": supported, @@ -34,7 +35,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed": supported, "collectionItem.unenclosed.iteration": supported, - statement: supported, + "statement.misc": supported, "statement.iteration.document": supported, selector: supported, @@ -42,6 +43,18 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -58,19 +71,116 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Keyword argument + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, // Enum "statement.enum": notApplicable, @@ -84,11 +194,13 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -96,162 +208,127 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - attribute: notApplicable, - "branch.if.iteration": notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, + "branch.if.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, + "branch.switchCase": notApplicable, + "branch.switchCase.iteration": notApplicable, + "condition.switchCase": notApplicable, + "condition.switchCase.iteration": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, - "branch.switchCase.iteration": notApplicable, - "branch.switchCase": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "comment.line": notApplicable, - "condition.doWhile": notApplicable, + + // For loop + "statement.for": notApplicable, "condition.for": notApplicable, - "condition.if": notApplicable, - "condition.switchCase.iteration": notApplicable, - "condition.switchCase": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - element: notApplicable, - endTag: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - "functionCall.constructor": notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.cell": notApplicable, - "interior.element": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Multi-line string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Line comment + "comment.line": notApplicable, + "textFragment.comment.line": notApplicable, + + // Static + "statement.static": notApplicable, "interior.static": notApplicable, - "key.attribute": notApplicable, - list: notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.actual": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal": notApplicable, - "name.assignment.pattern": notApplicable, - "name.assignment": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.method": notApplicable, - "name.resource.iteration": notApplicable, - "name.resource": notApplicable, - "name.variable.pattern": notApplicable, - "name.variable": notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, - namedFunction: notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section + section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - section: notApplicable, - startTag: notApplicable, - "statement.iteration.block": notApplicable, - "string.multiLine": notApplicable, - tags: notApplicable, - "textFragment.comment.line": notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, "textFragment.element": notApplicable, - "textFragment.string.multiLine": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal": notApplicable, + "value.typeAlias": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, - "type.return": notApplicable, - "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, - "type.variable": notApplicable, + "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal": notApplicable, - "value.assignment": notApplicable, - "value.attribute": notApplicable, - "value.foreach": notApplicable, - "value.resource.iteration": notApplicable, - "value.resource": notApplicable, - "value.return.lambda": notApplicable, - "value.return": notApplicable, - "value.typeAlias": notApplicable, - "value.variable.pattern": notApplicable, - "value.variable": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, + list: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 284c0e1903..dcf81e3748 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -20,6 +20,18 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -36,7 +48,112 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Function call + functionCall: notApplicable, + functionCallee: notApplicable, + "argumentList.actual.empty": notApplicable, + "argumentList.actual.singleLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + "argument.actual.singleLine": notApplicable, + "argument.actual.multiLine": notApplicable, + "argument.actual.iteration": notApplicable, + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -62,11 +179,13 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -74,174 +193,132 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.iteration": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.singleLine": notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.empty": notApplicable, - "argumentList.actual.singleLine": notApplicable, - "argumentList.actual.multiLine": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - "branch.if.iteration": notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, + "branch.if.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, + "branch.switchCase": notApplicable, + "branch.switchCase.iteration": notApplicable, + "condition.switchCase": notApplicable, + "condition.switchCase.iteration": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, - "branch.switchCase.iteration": notApplicable, - "branch.switchCase": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "collectionItem.unenclosed.iteration": notApplicable, - "collectionItem.unenclosed": notApplicable, - "comment.line": notApplicable, - "condition.doWhile": notApplicable, + + // For loop + "statement.for": notApplicable, "condition.for": notApplicable, - "condition.if": notApplicable, - "condition.switchCase.iteration": notApplicable, - "condition.switchCase": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - "functionCall.constructor": notApplicable, - "functionCallee.constructor": notApplicable, - "interior.cell": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, - "interior.static": notApplicable, - "key.mapPair.iteration": notApplicable, - "key.mapPair": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.actual": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal": notApplicable, - "name.assignment.pattern": notApplicable, - "name.assignment": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.iteration.block": notApplicable, - "name.iteration.document": notApplicable, - "name.method": notApplicable, - "name.resource.iteration": notApplicable, "name.resource": notApplicable, - "name.variable.pattern": notApplicable, - "name.variable": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Map + map: notApplicable, + "key.mapPair": notApplicable, + "key.mapPair.iteration": notApplicable, + "value.mapPair": notApplicable, + "value.mapPair.iteration": notApplicable, + + // Multiline string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Line comment + "comment.line": notApplicable, + "textFragment.comment.line": notApplicable, + + // Collection item + "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, "name.namespace": notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section + section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - "statement.iteration.block": notApplicable, - "statement.iteration.document": notApplicable, - "string.multiLine": notApplicable, - "textFragment.comment.line": notApplicable, - "textFragment.string.multiLine": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal": notApplicable, + "value.typeAlias": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.misc": notApplicable, + "statement.iteration.document": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, + "name.iteration.block": notApplicable, + "name.iteration.document": notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, - "type.return": notApplicable, - "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, - "type.variable": notApplicable, + "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal": notApplicable, - "value.assignment": notApplicable, - "value.foreach": notApplicable, - "value.mapPair.iteration": notApplicable, - "value.mapPair": notApplicable, - "value.resource.iteration": notApplicable, - "value.resource": notApplicable, - "value.return.lambda": notApplicable, - "value.return": notApplicable, - "value.typeAlias": notApplicable, - "value.variable.pattern": notApplicable, - "value.variable": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, - anonymousFunction: notApplicable, - disqualifyDelimiter: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - functionCall: notApplicable, - functionCallee: notApplicable, - ifStatement: notApplicable, - list: notApplicable, - map: notApplicable, - namedFunction: notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, - section: notApplicable, - statement: notApplicable, selector: notApplicable, unit: notApplicable, + list: notApplicable, + disqualifyDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index d2e6e53cf4..601bd52c74 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -78,24 +78,43 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { functionCall: supported, "functionCall.constructor": supported, + "functionCall.method": supported, functionCallee: supported, "functionCallee.constructor": supported, + "functionCallee.method": supported, "namedFunction.constructor": supported, "namedFunction.method": supported, "namedFunction.iteration.class": supported, ifStatement: supported, - statement: supported, + "statement.class": supported, "statement.interface": supported, "statement.enum": supported, "statement.field.class": supported, "statement.field.interface": supported, - "statement.iteration.block": supported, + "statement.constructor": supported, + "statement.method": supported, + "statement.if": supported, + "statement.try": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.doWhile": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.yield": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.resource": supported, + "statement.static": supported, + "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.interface": supported, - "statement.iteration.document": supported, + "statement.iteration.block": supported, "string.singleLine": supported, "string.multiLine": supported, @@ -190,6 +209,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { // Functions (not methods) namedFunction: notApplicable, "namedFunction.iteration.document": notApplicable, + "statement.function": notApplicable, "argument.formal.singleLine": notApplicable, "argument.formal.multiLine": notApplicable, "argument.formal.iteration": notApplicable, @@ -251,6 +271,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, @@ -265,6 +286,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.resource.iteration": notApplicable, // Namespace + "statement.namespace": notApplicable, "name.namespace": notApplicable, "interior.namespace": notApplicable, @@ -277,6 +299,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.enum": notApplicable, // Miscellaneous + "statement.misc": notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, environment: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index e1cd225675..f7647f4ce6 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -21,9 +21,25 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, - statement: supported, "statement.class": supported, "statement.field.class": supported, + "statement.function": supported, + "statement.constructor": supported, + "statement.method": supported, + "statement.if": supported, + "statement.try": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.doWhile": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.yield": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.static": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.block": supported, @@ -41,8 +57,10 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { functionCall: supported, "functionCall.constructor": supported, + "functionCall.method": supported, functionCallee: supported, "functionCallee.constructor": supported, + "functionCallee.method": supported, "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, @@ -187,6 +205,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, @@ -196,6 +215,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "interior.cell": notApplicable, // Resource + "statement.resource": notApplicable, "interior.resource": notApplicable, "name.resource.iteration": notApplicable, "name.resource": notApplicable, @@ -211,6 +231,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual": notApplicable, // Namespace + "statement.namespace": notApplicable, "name.namespace": notApplicable, "interior.namespace": notApplicable, @@ -219,6 +240,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "branch.loop.iteration": notApplicable, // Miscellaneous + "statement.misc": notApplicable, environment: notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 89c9aa4410..637f851562 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -23,6 +23,18 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -39,7 +51,112 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Function call + functionCall: notApplicable, + functionCallee: notApplicable, + "argumentList.actual.empty": notApplicable, + "argumentList.actual.singleLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + "argument.actual.singleLine": notApplicable, + "argument.actual.multiLine": notApplicable, + "argument.actual.iteration": notApplicable, + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -65,11 +182,13 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -77,175 +196,133 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.singleLine": notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.empty": notApplicable, - "argumentList.actual.singleLine": notApplicable, - "argumentList.actual.multiLine": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - attribute: notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, "branch.if.iteration": notApplicable, - "branch.loop": notApplicable, - "branch.loop.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, "branch.switchCase": notApplicable, "branch.switchCase.iteration": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "collectionItem.unenclosed": notApplicable, - "collectionItem.unenclosed.iteration": notApplicable, - "condition.doWhile": notApplicable, - "condition.for": notApplicable, - "condition.if": notApplicable, "condition.switchCase": notApplicable, "condition.switchCase.iteration": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - disqualifyDelimiter: notApplicable, - element: notApplicable, - endTag: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - functionCall: notApplicable, - "functionCall.constructor": notApplicable, - functionCallee: notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.cell": notApplicable, - "interior.element": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Multiline string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Static + "statement.static": notApplicable, "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, "interior.namespace": notApplicable, - "key.attribute": notApplicable, - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.formal": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.iteration.block": notApplicable, - "name.iteration.document": notApplicable, - "name.method": notApplicable, - "name.resource": notApplicable, - "name.resource.iteration": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - namedFunction: notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - startTag: notApplicable, - statement: notApplicable, - "statement.iteration.block": notApplicable, - "statement.iteration.document": notApplicable, - "string.multiLine": notApplicable, - tags: notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, "textFragment.element": notApplicable, - "textFragment.string.multiLine": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal.method.iteration": notApplicable, + "value.typeAlias": notApplicable, + + // Collection item + "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.misc": notApplicable, + "statement.iteration.document": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, + "name.iteration.block": notApplicable, + "name.iteration.document": notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.variable": notApplicable, - "type.return": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.formal": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.assignment": notApplicable, - "value.attribute": notApplicable, - "value.foreach": notApplicable, - "value.resource": notApplicable, - "value.resource.iteration": notApplicable, - "value.return": notApplicable, - "value.return.lambda": notApplicable, - "value.typeAlias": notApplicable, - "value.variable": notApplicable, - "value.variable.pattern": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, + disqualifyDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index 47ca17c0f2..8410b459cc 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -5,13 +5,19 @@ const { supported, notApplicable } = ScopeSupportFacetLevel; export const luaScopeSupport: LanguageScopeSupportFacetMap = { tags: notApplicable, - functionCall: supported, - functionCallee: supported, map: supported, - ifStatement: supported, namedFunction: supported, disqualifyDelimiter: supported, + ifStatement: supported, + + "statement.if": supported, + + functionCall: supported, + "functionCall.method": supported, + functionCallee: supported, + "functionCallee.method": supported, + "key.attribute": notApplicable, "name.assignment": supported, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 8a93ba90d4..5d083c1d28 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -15,10 +15,24 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "interior.cell": supported, "collectionItem.unenclosed": supported, + "collectionItem.unenclosed.iteration": supported, + list: supported, /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -35,7 +49,112 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Function call + functionCall: notApplicable, + functionCallee: notApplicable, + "argumentList.actual.empty": notApplicable, + "argumentList.actual.singleLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + "argument.actual.singleLine": notApplicable, + "argument.actual.multiLine": notApplicable, + "argument.actual.iteration": notApplicable, + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -61,11 +180,13 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -73,178 +194,135 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.singleLine": notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.empty": notApplicable, - "argumentList.actual.singleLine": notApplicable, - "argumentList.actual.multiLine": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - attribute: notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, "branch.if.iteration": notApplicable, - "branch.loop": notApplicable, - "branch.loop.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, "branch.switchCase": notApplicable, "branch.switchCase.iteration": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "collectionItem.unenclosed.iteration": notApplicable, - "comment.line": notApplicable, - "condition.doWhile": notApplicable, - "condition.for": notApplicable, - "condition.if": notApplicable, "condition.switchCase": notApplicable, "condition.switchCase.iteration": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - disqualifyDelimiter: notApplicable, - element: notApplicable, - endTag: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - functionCall: notApplicable, - "functionCall.constructor": notApplicable, - functionCallee: notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.element": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, - "interior.static": notApplicable, - "key.attribute": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Single-line string + "string.singleLine": notApplicable, + "textFragment.string.singleLine": notApplicable, + + // Map + map: notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, - map: notApplicable, - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.formal": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, + "value.mapPair": notApplicable, + "value.mapPair.iteration": notApplicable, + + // Multiline string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Line comment + "comment.line": notApplicable, + "textFragment.comment.line": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, + "textFragment.element": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Type alias + "type.alias": notApplicable, + "value.typeAlias": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.misc": notApplicable, + "statement.iteration.document": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, "name.iteration.block": notApplicable, "name.iteration.document": notApplicable, - "name.method": notApplicable, - "name.resource": notApplicable, - "name.resource.iteration": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - namedFunction: notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, - startTag: notApplicable, - statement: notApplicable, - "statement.iteration.block": notApplicable, - "statement.iteration.document": notApplicable, - "string.multiLine": notApplicable, - "string.singleLine": notApplicable, - tags: notApplicable, - "textFragment.element": notApplicable, - "textFragment.string.multiLine": notApplicable, - "textFragment.string.singleLine": notApplicable, - "textFragment.comment.line": notApplicable, - "type.alias": notApplicable, - "type.argument.formal": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.variable": notApplicable, - "type.return": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.formal": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.assignment": notApplicable, - "value.attribute": notApplicable, - "value.foreach": notApplicable, - "value.mapPair": notApplicable, - "value.mapPair.iteration": notApplicable, - "value.resource": notApplicable, - "value.resource.iteration": notApplicable, - "value.return": notApplicable, - "value.return.lambda": notApplicable, - "value.typeAlias": notApplicable, - "value.variable": notApplicable, - "value.variable.pattern": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, + disqualifyDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index c72614305c..c28fb6a87d 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -175,17 +175,34 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.string.singleLine": supported, ifStatement: supported, - statement: supported, + "statement.class": supported, "statement.field.class": supported, - "statement.iteration.block": supported, - "statement.iteration.class": supported, + "statement.function": supported, + "statement.constructor": supported, + "statement.method": supported, + "statement.if": supported, + "statement.try": supported, + "statement.switch": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.yield": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.resource": supported, "statement.iteration.document": supported, + "statement.iteration.class": supported, + "statement.iteration.block": supported, functionCall: supported, "functionCall.constructor": supported, + "functionCall.method": supported, functionCallee: supported, "functionCallee.constructor": supported, + "functionCallee.method": supported, disqualifyDelimiter: supported, pairDelimiter: supported, @@ -211,18 +228,24 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Namespace + "statement.namespace": notApplicable, "name.namespace": notApplicable, "interior.namespace": notApplicable, - // for and do-while loops - "condition.doWhile": notApplicable, + // For loop + "statement.for": notApplicable, "condition.for": notApplicable, "interior.for": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, // Nested classes @@ -271,7 +294,12 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, + // Static "interior.static": notApplicable, + "statement.static": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, environment: notApplicable, regularExpression: notApplicable, selector: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index a810b6c9d7..75833a1983 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -25,9 +25,12 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.lambda.singleLine": supported, "argumentList.formal.lambda.multiLine": supported, - "comment.line": supported, functionCall: supported, + "functionCall.method": supported, functionCallee: supported, + "functionCallee.method": supported, + + "comment.line": supported, ifStatement: supported, "name.assignment": supported, "name.function": supported, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 42a7ac3492..a627cd6bb4 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -4,7 +4,7 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; export const scmScopeSupport: LanguageScopeSupportFacetMap = { - statement: supported, + "statement.misc": supported, list: supported, "argument.actual.singleLine": supported, @@ -25,6 +25,18 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -41,7 +53,104 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Keyword argument + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -67,11 +176,13 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -79,173 +190,143 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - attribute: notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, "branch.if.iteration": notApplicable, - "branch.loop": notApplicable, - "branch.loop.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, "branch.switchCase": notApplicable, "branch.switchCase.iteration": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "comment.block": notApplicable, - "condition.doWhile": notApplicable, - "condition.for": notApplicable, - "condition.if": notApplicable, "condition.switchCase": notApplicable, "condition.switchCase.iteration": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - "collectionItem.unenclosed": notApplicable, - "collectionItem.unenclosed.iteration": notApplicable, - disqualifyDelimiter: notApplicable, - element: notApplicable, - endTag: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - "functionCall.constructor": notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.cell": notApplicable, - "interior.element": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, - "interior.static": notApplicable, - "key.attribute": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Map + map: notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, - map: notApplicable, - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.formal": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, + "value.mapPair": notApplicable, + "value.mapPair.iteration": notApplicable, + + // Multiline string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Block comment + "comment.block": notApplicable, + "textFragment.comment.block": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.iteration.block": notApplicable, - "name.iteration.document": notApplicable, - "name.method": notApplicable, - "name.resource": notApplicable, - "name.resource.iteration": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - namedFunction: notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - startTag: notApplicable, - "statement.iteration.block": notApplicable, - "statement.iteration.document": notApplicable, - "string.multiLine": notApplicable, - tags: notApplicable, - "textFragment.comment.block": notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, "textFragment.element": notApplicable, - "textFragment.string.multiLine": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal.method.iteration": notApplicable, + "value.typeAlias": notApplicable, + + // Collection item + "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.iteration.document": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, + "name.iteration.block": notApplicable, + "name.iteration.document": notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.variable": notApplicable, - "type.return": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.formal": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.assignment": notApplicable, - "value.attribute": notApplicable, - "value.foreach": notApplicable, - "value.mapPair": notApplicable, - "value.mapPair.iteration": notApplicable, - "value.resource": notApplicable, - "value.resource.iteration": notApplicable, - "value.return": notApplicable, - "value.return.lambda": notApplicable, - "value.typeAlias": notApplicable, - "value.variable": notApplicable, - "value.variable.pattern": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, + disqualifyDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index f1504fdd65..55fb92433b 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -70,10 +70,6 @@ export const scopeSupportFacetInfos: Record< scopeType: "ifStatement", }, - statement: { - description: "A statement, eg assignment, for loop, etc", - scopeType: "statement", - }, "statement.class": { description: "A class declaration", scopeType: "statement", @@ -94,6 +90,91 @@ export const scopeSupportFacetInfos: Record< description: "A field declaration in a interface", scopeType: "statement", }, + "statement.function": { + description: "A named function declaration", + scopeType: "statement", + }, + "statement.constructor": { + description: "A constructor declaration", + scopeType: "statement", + }, + "statement.method": { + description: "A method declaration", + scopeType: "statement", + }, + "statement.if": { + description: "A if/elif/else statement", + scopeType: "statement", + }, + "statement.try": { + description: "A try/catch/finally statement", + scopeType: "statement", + }, + "statement.switch": { + description: "A switch statement", + scopeType: "statement", + }, + "statement.for": { + description: "A for loop statement", + scopeType: "statement", + }, + "statement.foreach": { + description: "A for-each loop statement", + scopeType: "statement", + }, + "statement.while": { + description: "A while loop statement", + scopeType: "statement", + }, + "statement.doWhile": { + description: "A do-while loop statement", + scopeType: "statement", + }, + "statement.variable": { + description: "A variable declaration", + scopeType: "statement", + }, + "statement.assignment": { + description: "An assignment statement", + scopeType: "statement", + }, + "statement.return": { + description: "A return statement", + scopeType: "statement", + }, + "statement.yield": { + description: "A yield statement", + scopeType: "statement", + }, + "statement.break": { + description: "A break statement", + scopeType: "statement", + }, + "statement.continue": { + description: "A continue statement", + scopeType: "statement", + }, + "statement.resource": { + description: "A 'with' / 'use' / 'using' statement", + scopeType: "statement", + }, + "statement.command": { + description: "A command statement, eg Talon spoken command or bash", + scopeType: "statement", + }, + "statement.namespace": { + description: "A namespace declaration", + scopeType: "statement", + }, + "statement.static": { + description: "A static statement", + scopeType: "statement", + }, + "statement.misc": { + description: "A miscellaneous statement", + scopeType: "statement", + }, + "statement.iteration.document": documentIter("statement", "statements"), "statement.iteration.class": classIter("statement", "statements"), "statement.iteration.interface": interfaceIter("statement", "statements"), @@ -128,7 +209,7 @@ export const scopeSupportFacetInfos: Record< ), anonymousFunction: { description: - "An anonymous function, eg a lambda function, an arrow function, etc", + "An anonymous function, eg a lambda function, an arrow function, etc.", scopeType: "anonymousFunction", }, @@ -140,13 +221,22 @@ export const scopeSupportFacetInfos: Record< description: "A constructor call", scopeType: "functionCall", }, + "functionCall.method": { + description: "A method call", + scopeType: "functionCall", + }, functionCallee: { description: "The function being called in a function call", scopeType: "functionCallee", }, "functionCallee.constructor": { description: - "The class being constructed in a class instantiation, including the `new` keyword", + "The class being constructed in a class instantiation, including the `new` keyword.", + scopeType: "functionCallee", + }, + "functionCallee.method": { + description: + "The function being called in a method call, including parent objects.", scopeType: "functionCallee", }, @@ -176,7 +266,7 @@ export const scopeSupportFacetInfos: Record< "argument.actual.method.iteration": iteration( "argumentOrParameter", "arguments in a method call", - "the argument list. The domain should be the entire method call", + "the argument list. The domain should be the entire method call.", ), "argument.actual.constructor.singleLine": { description: "A single line argument in a constructor call", @@ -190,7 +280,7 @@ export const scopeSupportFacetInfos: Record< "argument.actual.constructor.iteration": iteration( "argumentOrParameter", "arguments in a constructor call", - "the argument list. The domain should be the entire constructor call", + "the argument list. The domain should be the entire constructor call.", ), "argument.formal.singleLine": { diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 5677a8aa86..8513746cb4 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -26,12 +26,32 @@ export const scopeSupportFacets = [ "ifStatement", - "statement", "statement.class", "statement.interface", "statement.enum", "statement.field.class", "statement.field.interface", + "statement.function", + "statement.constructor", + "statement.method", + "statement.if", + "statement.try", + "statement.switch", + "statement.for", + "statement.foreach", + "statement.while", + "statement.doWhile", + "statement.variable", + "statement.assignment", + "statement.return", + "statement.yield", + "statement.break", + "statement.continue", + "statement.resource", + "statement.command", + "statement.namespace", + "statement.static", + "statement.misc", "statement.iteration.document", "statement.iteration.class", "statement.iteration.interface", @@ -51,8 +71,10 @@ export const scopeSupportFacets = [ "functionCall", "functionCall.constructor", + "functionCall.method", "functionCallee", "functionCallee.constructor", + "functionCallee.method", "argument.actual.singleLine", "argument.actual.multiLine", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index c3e2247715..e7e524e56d 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -22,6 +22,9 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.block": supported, "name.iteration.document": supported, + "statement.command": supported, + "statement.variable": supported, + "statement.assignment": supported, "statement.iteration.block": supported, "statement.iteration.document": supported, @@ -32,7 +35,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.document": supported, command: supported, - statement: supported, "string.singleLine": supported, @@ -44,6 +46,11 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.mapPair": supported, "value.mapPair.iteration": supported, + functionCall: supported, + functionCallee: supported, + "functionCall.method": supported, + "functionCallee.method": supported, + /* UNSUPPORTED */ fieldAccess: unsupported, @@ -66,7 +73,104 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Multiline function calls + "argument.actual.multiLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Keyword argument + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -91,6 +195,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -98,161 +203,138 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.actual.multiLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - attribute: notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, "branch.if.iteration": notApplicable, - "branch.loop": notApplicable, - "branch.loop.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, "branch.switchCase": notApplicable, "branch.switchCase.iteration": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "collectionItem.unenclosed": notApplicable, - "collectionItem.unenclosed.iteration": notApplicable, - "comment.block": notApplicable, - "condition.doWhile": notApplicable, - "condition.for": notApplicable, - "condition.if": notApplicable, "condition.switchCase": notApplicable, "condition.switchCase.iteration": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - disqualifyDelimiter: notApplicable, - element: notApplicable, - endTag: notApplicable, - environment: notApplicable, - functionCall: notApplicable, - "functionCall.constructor": notApplicable, - functionCallee: notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.cell": notApplicable, - "interior.element": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, - "interior.static": notApplicable, - "key.attribute": notApplicable, - list: notApplicable, - map: notApplicable, - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.formal": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.assignment.pattern": notApplicable, - "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.method": notApplicable, "name.resource": notApplicable, "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Pattern destruction + "name.assignment.pattern": notApplicable, "name.variable.pattern": notApplicable, - namedFunction: notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, + "value.variable.pattern": notApplicable, + + // Multiline string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Block comment + "comment.block": notApplicable, + "textFragment.comment.block": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, + "name.namespace": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - startTag: notApplicable, - tags: notApplicable, - "textFragment.comment.block": notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, "textFragment.element": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal.method.iteration": notApplicable, - "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.return": notApplicable, + "value.typeAlias": notApplicable, + + // Collection item + "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + + // Miscellaneous + list: notApplicable, + map: notApplicable, + environment: notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, + "statement.misc": notApplicable, "type.variable": notApplicable, + "type.cast": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.formal": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.attribute": notApplicable, - "value.foreach": notApplicable, - "value.resource": notApplicable, - "value.resource.iteration": notApplicable, - "value.return": notApplicable, - "value.return.lambda": notApplicable, - "value.typeAlias": notApplicable, - "value.variable.pattern": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, - "string.multiLine": notApplicable, - "textFragment.string.multiLine": notApplicable, selector: notApplicable, unit: notApplicable, + disqualifyDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 243ff64733..1b7b88c1c9 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -20,6 +20,18 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -36,7 +48,112 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Function call + functionCall: notApplicable, + functionCallee: notApplicable, + "argumentList.actual.empty": notApplicable, + "argumentList.actual.singleLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + "argument.actual.singleLine": notApplicable, + "argument.actual.multiLine": notApplicable, + "argument.actual.iteration": notApplicable, + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -62,11 +179,13 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -74,174 +193,132 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.singleLine": notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.empty": notApplicable, - "argumentList.actual.singleLine": notApplicable, - "argumentList.actual.multiLine": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, "branch.if.iteration": notApplicable, - "branch.loop": notApplicable, - "branch.loop.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, "branch.switchCase": notApplicable, "branch.switchCase.iteration": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "collectionItem.unenclosed": notApplicable, - "collectionItem.unenclosed.iteration": notApplicable, - "comment.line": notApplicable, - "condition.doWhile": notApplicable, - "condition.for": notApplicable, - "condition.if": notApplicable, "condition.switchCase": notApplicable, "condition.switchCase.iteration": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - disqualifyDelimiter: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - functionCall: notApplicable, - "functionCall.constructor": notApplicable, - functionCallee: notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.cell": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, - "interior.static": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Map + map: notApplicable, "key.mapPair": notApplicable, "key.mapPair.iteration": notApplicable, - list: notApplicable, - map: notApplicable, - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.formal": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, + "value.mapPair": notApplicable, + "value.mapPair.iteration": notApplicable, + + // Multiline string + "string.multiLine": notApplicable, + "textFragment.string.multiLine": notApplicable, + + // Line comment + "comment.line": notApplicable, + "textFragment.comment.line": notApplicable, + + // Collection item + "collectionItem.unenclosed": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.iteration.block": notApplicable, - "name.iteration.document": notApplicable, - "name.method": notApplicable, - "name.resource": notApplicable, - "name.resource.iteration": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - namedFunction: notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - statement: notApplicable, - "statement.iteration.block": notApplicable, - "statement.iteration.document": notApplicable, - "string.multiLine": notApplicable, - "textFragment.comment.line": notApplicable, - "textFragment.string.multiLine": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal.method.iteration": notApplicable, + "value.typeAlias": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.misc": notApplicable, + "statement.iteration.document": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, + "name.iteration.block": notApplicable, + "name.iteration.document": notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.return": notApplicable, - "type.variable": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.formal": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.assignment": notApplicable, - "value.foreach": notApplicable, - "value.mapPair": notApplicable, - "value.mapPair.iteration": notApplicable, - "value.resource": notApplicable, - "value.resource.iteration": notApplicable, - "value.return": notApplicable, - "value.return.lambda": notApplicable, - "value.typeAlias": notApplicable, - "value.variable": notApplicable, - "value.variable.pattern": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, + list: notApplicable, + disqualifyDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index e24208433e..5ab4c73fb4 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -29,6 +29,18 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Variable + "statement.variable": notApplicable, + "statement.assignment": notApplicable, + "name.assignment": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable": notApplicable, + "name.variable.pattern": notApplicable, + "type.variable": notApplicable, + "value.assignment": notApplicable, + "value.variable": notApplicable, + "value.variable.pattern": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -45,7 +57,112 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, + + // Constructor + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "interior.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + + // Method + "statement.method": notApplicable, + "namedFunction.method": notApplicable, + "argument.actual.method.singleLine": notApplicable, + "argument.actual.method.multiLine": notApplicable, + "argument.actual.method.iteration": notApplicable, + "argument.formal.method.singleLine": notApplicable, + "argument.formal.method.multiLine": notApplicable, + "argument.formal.method.iteration": notApplicable, + "argumentList.actual.method.empty": notApplicable, + "argumentList.actual.method.singleLine": notApplicable, + "argumentList.actual.method.multiLine": notApplicable, + "argumentList.formal.method.empty": notApplicable, + "argumentList.formal.method.singleLine": notApplicable, + "argumentList.formal.method.multiLine": notApplicable, + "interior.method": notApplicable, + "name.argument.formal.method": notApplicable, + "name.argument.formal.method.iteration": notApplicable, + "name.method": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "functionCall.method": notApplicable, + "functionCallee.method": notApplicable, + + // Function + namedFunction: notApplicable, + "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.class": notApplicable, + "statement.function": notApplicable, + "name.function": notApplicable, + "interior.function": notApplicable, + "argumentList.formal.empty": notApplicable, + "argumentList.formal.singleLine": notApplicable, + "argumentList.formal.multiLine": notApplicable, + "argument.formal.singleLine": notApplicable, + "argument.formal.multiLine": notApplicable, + "argument.formal.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + + // Anonymous function / lambda + anonymousFunction: notApplicable, + "argumentList.formal.lambda.empty": notApplicable, + "argumentList.formal.lambda.singleLine": notApplicable, + "argumentList.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.singleLine": notApplicable, + "argument.formal.lambda.multiLine": notApplicable, + "argument.formal.lambda.iteration": notApplicable, + "value.return.lambda": notApplicable, + "interior.lambda": notApplicable, + + // Function call + functionCall: notApplicable, + functionCallee: notApplicable, + "argumentList.actual.empty": notApplicable, + "argumentList.actual.singleLine": notApplicable, + "argumentList.actual.multiLine": notApplicable, + "argument.actual.singleLine": notApplicable, + "argument.actual.multiLine": notApplicable, + "argument.actual.iteration": notApplicable, + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Return statement + "statement.return": notApplicable, + "type.return": notApplicable, + "value.return": notApplicable, + + // Yield statement + "statement.yield": notApplicable, + "value.yield": notApplicable, // Interface "statement.interface": notApplicable, @@ -71,11 +188,13 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "statement.command": notApplicable, "name.command": notApplicable, "value.command": notApplicable, "interior.command": notApplicable, // Try catch + "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, @@ -83,170 +202,126 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, - anonymousFunction: notApplicable, - "argument.actual.singleLine": notApplicable, - "argument.actual.multiLine": notApplicable, - "argument.actual.constructor.singleLine": notApplicable, - "argument.actual.constructor.multiLine": notApplicable, - "argument.actual.constructor.iteration": notApplicable, - "argument.actual.iteration": notApplicable, - "argument.actual.method.singleLine": notApplicable, - "argument.actual.method.multiLine": notApplicable, - "argument.actual.method.iteration": notApplicable, - "argument.formal.singleLine": notApplicable, - "argument.formal.multiLine": notApplicable, - "argument.formal.constructor.singleLine": notApplicable, - "argument.formal.constructor.multiLine": notApplicable, - "argument.formal.constructor.iteration": notApplicable, - "argument.formal.iteration": notApplicable, - "argument.formal.method.singleLine": notApplicable, - "argument.formal.method.multiLine": notApplicable, - "argument.formal.method.iteration": notApplicable, - "argument.formal.lambda.singleLine": notApplicable, - "argument.formal.lambda.multiLine": notApplicable, - "argument.formal.lambda.iteration": notApplicable, - "argumentList.actual.empty": notApplicable, - "argumentList.actual.singleLine": notApplicable, - "argumentList.actual.multiLine": notApplicable, - "argumentList.actual.method.empty": notApplicable, - "argumentList.actual.method.singleLine": notApplicable, - "argumentList.actual.method.multiLine": notApplicable, - "argumentList.actual.constructor.empty": notApplicable, - "argumentList.actual.constructor.singleLine": notApplicable, - "argumentList.actual.constructor.multiLine": notApplicable, - "argumentList.formal.empty": notApplicable, - "argumentList.formal.singleLine": notApplicable, - "argumentList.formal.multiLine": notApplicable, - "argumentList.formal.lambda.empty": notApplicable, - "argumentList.formal.lambda.singleLine": notApplicable, - "argumentList.formal.lambda.multiLine": notApplicable, - "argumentList.formal.method.empty": notApplicable, - "argumentList.formal.method.singleLine": notApplicable, - "argumentList.formal.method.multiLine": notApplicable, - "argumentList.formal.constructor.empty": notApplicable, - "argumentList.formal.constructor.singleLine": notApplicable, - "argumentList.formal.constructor.multiLine": notApplicable, - attribute: notApplicable, + // If statement + ifStatement: notApplicable, + "statement.if": notApplicable, "branch.if": notApplicable, "branch.if.elif.else": notApplicable, "branch.if.else": notApplicable, "branch.if.iteration": notApplicable, - "branch.loop": notApplicable, - "branch.loop.iteration": notApplicable, + "condition.if": notApplicable, + "interior.if": notApplicable, + + // Switch statement + "statement.switch": notApplicable, "branch.switchCase": notApplicable, "branch.switchCase.iteration": notApplicable, - "branch.ternary": notApplicable, - "branch.ternary.iteration": notApplicable, - "comment.block": notApplicable, - "condition.doWhile": notApplicable, - "condition.for": notApplicable, - "condition.if": notApplicable, "condition.switchCase": notApplicable, "condition.switchCase.iteration": notApplicable, - "condition.ternary": notApplicable, - "condition.while": notApplicable, - element: notApplicable, - endTag: notApplicable, - environment: notApplicable, - fieldAccess: notApplicable, - functionCall: notApplicable, - "functionCall.constructor": notApplicable, - functionCallee: notApplicable, - "functionCallee.constructor": notApplicable, - ifStatement: notApplicable, - "interior.cell": notApplicable, - "interior.element": notApplicable, - "interior.function": notApplicable, - "interior.constructor": notApplicable, - "interior.method": notApplicable, - "interior.if": notApplicable, - "interior.lambda": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + "value.switch": notApplicable, + + // Loop + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, "interior.for": notApplicable, + + // For-each loop + "statement.foreach": notApplicable, "interior.foreach": notApplicable, + "name.foreach": notApplicable, + "type.foreach": notApplicable, + "value.foreach": notApplicable, + + // While loop + "statement.while": notApplicable, + "condition.while": notApplicable, "interior.while": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, "interior.doWhile": notApplicable, + + // Resource statement + "statement.resource": notApplicable, "interior.resource": notApplicable, - "interior.switch": notApplicable, - "interior.switchCase": notApplicable, - "interior.ternary": notApplicable, - "interior.namespace": notApplicable, - "interior.static": notApplicable, - "key.attribute": notApplicable, - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "name.argument.formal": notApplicable, - "name.argument.formal.constructor": notApplicable, - "name.argument.formal.constructor.iteration": notApplicable, - "name.argument.formal.iteration": notApplicable, - "name.argument.formal.method": notApplicable, - "name.argument.formal.method.iteration": notApplicable, - "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.namespace": notApplicable, - "name.constructor": notApplicable, - "name.foreach": notApplicable, - "name.function": notApplicable, - "name.iteration.block": notApplicable, - "name.iteration.document": notApplicable, - "name.method": notApplicable, "name.resource": notApplicable, "name.resource.iteration": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - namedFunction: notApplicable, - "namedFunction.constructor": notApplicable, - "namedFunction.iteration.document": notApplicable, - "namedFunction.method": notApplicable, - notebookCell: notApplicable, - pairDelimiter: notApplicable, - regularExpression: notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + + // Block comment + "comment.block": notApplicable, + "textFragment.comment.block": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "interior.namespace": notApplicable, + "name.namespace": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + "interior.ternary": notApplicable, + + // Section section: notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - startTag: notApplicable, - statement: notApplicable, - "statement.iteration.block": notApplicable, - "statement.iteration.document": notApplicable, - tags: notApplicable, - "textFragment.comment.block": notApplicable, + + // Element + element: notApplicable, + "interior.element": notApplicable, "textFragment.element": notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + + // Attribute + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Type alias "type.alias": notApplicable, - "type.argument.formal": notApplicable, - "type.argument.formal.constructor": notApplicable, - "type.argument.formal.constructor.iteration": notApplicable, - "type.argument.formal.iteration": notApplicable, - "type.argument.formal.method": notApplicable, - "type.argument.formal.method.iteration": notApplicable, + "value.typeAlias": notApplicable, + + // Miscellaneous statements + "statement.break": notApplicable, + "statement.continue": notApplicable, + "statement.misc": notApplicable, + "statement.iteration.document": notApplicable, + "statement.iteration.block": notApplicable, + + // Miscellaneous + environment: notApplicable, + fieldAccess: notApplicable, + "name.iteration.block": notApplicable, + "name.iteration.document": notApplicable, + pairDelimiter: notApplicable, + regularExpression: notApplicable, "type.cast": notApplicable, - "type.foreach": notApplicable, - "type.variable": notApplicable, - "type.return": notApplicable, - "type.resource": notApplicable, - "type.resource.iteration": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - "value.argument.formal": notApplicable, - "value.argument.formal.constructor": notApplicable, - "value.argument.formal.constructor.iteration": notApplicable, - "value.argument.formal.iteration": notApplicable, - "value.argument.formal.method": notApplicable, - "value.argument.formal.method.iteration": notApplicable, - "value.assignment": notApplicable, - "value.attribute": notApplicable, - "value.foreach": notApplicable, - "value.resource": notApplicable, - "value.resource.iteration": notApplicable, - "value.return": notApplicable, - "value.return.lambda": notApplicable, - "value.typeAlias": notApplicable, - "value.variable": notApplicable, - "value.variable.pattern": notApplicable, - "value.yield": notApplicable, - "value.switch": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, diff --git a/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx b/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx index 9a658a2661..1d8653af02 100644 --- a/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx +++ b/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx @@ -292,7 +292,7 @@ function getScopeFixtures( Object.values(scopeMap) .sort(nameComparator) .forEach((scope) => { - scope.facets.sort(nameComparator); + scope.facets.sort(facetComparator); scope.facets.forEach((f) => f.fixtures.sort(nameComparator)); if (scopeTypeType == null && isScopeInternal(scope.scopeTypeType)) { result.internal.push(scope); @@ -303,3 +303,13 @@ function getScopeFixtures( return result; } + +export function facetComparator(a: Facet, b: Facet): number { + if (a.info.isIteration && !b.info.isIteration) { + return 1; + } + if (!a.info.isIteration && b.info.isIteration) { + return -1; + } + return nameComparator(a, b); +} diff --git a/queries/c.scm b/queries/c.scm index 2cc6b2524e..ef8b688fcd 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -3,7 +3,6 @@ ;; Generated by the following command: ;; > curl https://raw.githubusercontent.com/tree-sitter/tree-sitter-cpp/master/src/node-types.json | jq '[.[] | select(.type == "compound_statement") | .children.types[].type] + [.[] | select(.type == "_statement") | .subtypes[].type]' [ - (declaration) (function_definition) (linkage_specification) (preproc_call) @@ -14,7 +13,6 @@ (preproc_include) (type_definition) (break_statement) - (case_statement) (continue_statement) (do_statement) (expression_statement) @@ -24,12 +22,20 @@ (return_statement) (switch_statement) (while_statement) + ;; Disabled on purpose + ;; (case_statement) ;; Disabled on purpose. This is the entire body of statements. ;; (compound_statement) - ;; Disabled on purpose. We have a better definition of this below. + ;; Disabled on purpose. We have a better definition of these below. ;; (if_statement) + ;; (declaration) ] @statement +( + (declaration) @statement + (#not-parent-type? @statement for_statement) +) + ( (translation_unit) @statement.iteration @class.iteration @namedFunction.iteration (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) diff --git a/queries/cpp.scm b/queries/cpp.scm index 8e0f8a9fee..2b1bf3f7c1 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -103,7 +103,7 @@ ) @branch.end @interior.domain.end ) @branch.iteration -;;!! catch (const std::exception& e) {} +;;!! catch (const std::exception e) {} (catch_clause body: (_ "{" @interior.start.endOf diff --git a/queries/csharp.scm b/queries/csharp.scm index 9a8b983a3c..340f6a84d3 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -22,7 +22,6 @@ (record_declaration) (struct_declaration) (using_directive) - (block) (break_statement) (checked_statement) (continue_statement) @@ -45,6 +44,8 @@ (using_statement) (while_statement) (yield_statement) + ;; Disabled on purpose. This is the entire body of statements. + ;; (block) ;; Disabled on purpose. We have a better definition of this below. ;; (if_statement) ] @statement diff --git a/queries/css.scm b/queries/css.scm index c30344a585..fe19c7b302 100644 --- a/queries/css.scm +++ b/queries/css.scm @@ -83,9 +83,9 @@ . (_) @_.trailing.startOf )? - ) + ) @_dummyList (#grow-to-named-siblings! @argumentOrParameter "at") - (#insertion-delimiter! @argumentOrParameter ", ") + (#single-or-multi-line-delimiter! @argumentOrParameter @_dummyList ", " ",\n") ) ;;!! translate(-50%, -50%) diff --git a/queries/java.scm b/queries/java.scm index 440591269d..7fe3ba595b 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -19,7 +19,6 @@ (expression_statement) (for_statement) (labeled_statement) - (local_variable_declaration) (return_statement) (switch_expression) (synchronized_statement) @@ -32,7 +31,9 @@ (constructor_declaration) (field_declaration) (constant_declaration) + (static_initializer) + ;; Disabled on purpose. We don't consider these to be statements. ;; exceptions ;; ";", ;; "block", @@ -41,6 +42,11 @@ ;; (if_statement) ] @statement +( + (local_variable_declaration) @statement + (#not-parent-type? @statement for_statement) +) + ;;!! enum Foo {} ;;! ^^^^^^^^^^^ ;;! ^^^ @@ -391,22 +397,20 @@ ;;!! new test(); ;;! ^^^^^^^^ -;;! ----------- +;;! ---------- (_ (object_creation_expression (argument_list) @functionCallee.end.startOf - ) @functionCallee.start.startOf @_.domain.start - ";"? @_.domain.end + ) @functionCallee.start.startOf @_.domain ) ;;!! new test().bar(); ;;! ^^^^^^^^^^^^^^ -;;! ----------------- +;;! ---------------- (_ (method_invocation (argument_list) @functionCallee.end.startOf - ) @functionCallee.start.startOf @_.domain.start - ";"? @_.domain.end + ) @functionCallee.start.startOf @_.domain ) ;;!! super(); diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index b2d267a913..77dfd7bdf7 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -17,13 +17,11 @@ (do_statement) (empty_statement) (export_statement) - (expression_statement) (for_in_statement) (for_statement) (generator_function_declaration) (import_statement) (labeled_statement) - (lexical_declaration) (return_statement) (switch_statement) (throw_statement) @@ -31,18 +29,24 @@ (variable_declaration) (while_statement) (with_statement) + (class_static_block) ;; Disabled on purpose. We have a better definition of this below. ;; (if_statement) ;; This is disabled since we want the whole statement and not just the block ;; (statement_block) - - ;; Manually added - (method_definition) ] @statement (#not-parent-type? @statement export_statement) ) +( + [ + (expression_statement) + (lexical_declaration) + ] @statement + (#not-parent-type? @statement export_statement for_statement) +) + ( (program) @statement.iteration @class.iteration (#document-range! @statement.iteration @class.iteration) diff --git a/queries/javascript.function.scm b/queries/javascript.function.scm index 617f8c1ffd..c65a56475f 100644 --- a/queries/javascript.function.scm +++ b/queries/javascript.function.scm @@ -159,11 +159,11 @@ ;;!! class Foo { @bar foo() {} } ;;! ^^^^^^^^^^^^^ ( - (decorator)? @namedFunction.start @name.domain.start + (decorator)? @namedFunction.start @statement.start @name.domain.start . (method_definition name: (_) @name - ) @namedFunction.end @name.domain.end + ) @namedFunction.end @statement.end @name.domain.end ) ( diff --git a/queries/lua.scm b/queries/lua.scm index 934614788d..ed6c682f60 100644 --- a/queries/lua.scm +++ b/queries/lua.scm @@ -51,7 +51,7 @@ (if_statement "if" @interior.domain.start condition: (_) @condition - consequence: (_) @interior @interior.domain.end + consequence: (_)? @interior @interior.domain.end ) @ifStatement @condition.domain @branch.iteration ;;!! if true then end diff --git a/queries/python.scm b/queries/python.scm index c15c40e1b4..896f05f81c 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -8,28 +8,29 @@ [ (assert_statement) (break_statement) - (class_definition) (continue_statement) (decorated_definition) (delete_statement) (exec_statement) (expression_statement) (for_statement) - (function_definition) (future_import_statement) (global_statement) (import_from_statement) (import_statement) (match_statement) (nonlocal_statement) - (pass_statement) (print_statement) (raise_statement) (return_statement) (try_statement) (while_statement) (with_statement) - ;; Disabled on purpose. We have a better definition of this below. + ;; Disabled on purpose. We don't think this is a statement. + ;; (pass_statement) + ;; Disabled on purpose. We have a better definition for these below. + ;; (class_definition) + ;; (function_definition) ;; (if_statement) ] @statement @@ -292,14 +293,18 @@ (set) ] @list +;;!! def foo(): pass +;;! ^^^^^^^^^^^^^^^ ( (function_definition name: (_) @name body: (_) @interior - ) @namedFunction @_.domain + ) @namedFunction @statement @_.domain (#not-parent-type? @namedFunction decorated_definition) ) +;;!! @value def foo(): pass +;;! ^^^^^^^^^^^^^^^^^^^^^^ (decorated_definition (function_definition name: (_) @name @@ -321,30 +326,30 @@ ;;!! class MyClass: ( - (class_definition - name: (_) @name - body: (_) @interior - ) @class @_.domain + (class_definition) @class @type @statement (#not-parent-type? @class decorated_definition) ) ( - (class_definition) @type - (#not-parent-type? @type decorated_definition) + (class_definition + name: (_) @name + body: (_) @interior + ) @_.domain + (#not-parent-type? @_.domain decorated_definition) ) ;;!! @value ;;!! class MyClass: +(decorated_definition + (class_definition) +) @class @type @statement + (decorated_definition (class_definition name: (_) @name body: (_) @interior ) -) @class @_.domain - -(decorated_definition - (class_definition) -) @type +) @_.domain ( (module) @statement.iteration @class.iteration @namedFunction.iteration diff --git a/queries/r.scm b/queries/r.scm index c5ea2c3109..0de9ecff10 100644 --- a/queries/r.scm +++ b/queries/r.scm @@ -142,7 +142,7 @@ ;;! ----- (call (identifier) @functionCallee -) +) @_.domain ;; Technically lists and arrays are just calls to the function `list` or `c` ;;!! list(1, 2, 3)