diff --git a/data/fixtures/scopes/java/anonymousFunction.scope b/data/fixtures/scopes/java/anonymousFunction.scope new file mode 100644 index 0000000000..7e34880d05 --- /dev/null +++ b/data/fixtures/scopes/java/anonymousFunction.scope @@ -0,0 +1,10 @@ +() -> 2; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:7 + >-------< +0| () -> 2; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/anonymousFunction2.scope b/data/fixtures/scopes/java/anonymousFunction2.scope new file mode 100644 index 0000000000..62fcb08eff --- /dev/null +++ b/data/fixtures/scopes/java/anonymousFunction2.scope @@ -0,0 +1,15 @@ +(value) -> { + return value; +}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:1 + >------------ +0| (value) -> { +1| return value; +2| }; + -< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/argument.actual.constructor.iteration.scope b/data/fixtures/scopes/java/argument.actual.constructor.iteration.scope new file mode 100644 index 0000000000..eeeef4b2ce --- /dev/null +++ b/data/fixtures/scopes/java/argument.actual.constructor.iteration.scope @@ -0,0 +1,10 @@ +new Foo(123, 456); +--- + +[Range] = 0:8-0:16 + >--------< +0| new Foo(123, 456); + +[Domain] = 0:7-0:17 + >----------< +0| new Foo(123, 456); diff --git a/data/fixtures/scopes/java/argument.actual.constructor.scope b/data/fixtures/scopes/java/argument.actual.constructor.scope new file mode 100644 index 0000000000..7f54786c3b --- /dev/null +++ b/data/fixtures/scopes/java/argument.actual.constructor.scope @@ -0,0 +1,33 @@ +new Foo(123, 456); +--- + +[#1 Content] = +[#1 Domain] = 0:8-0:11 + >---< +0| new Foo(123, 456); + +[#1 Removal] = 0:8-0:13 + >-----< +0| new Foo(123, 456); + +[#1 Trailing delimiter] = 0:11-0:13 + >--< +0| new Foo(123, 456); + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:13-0:16 + >---< +0| new Foo(123, 456); + +[#2 Removal] = 0:11-0:16 + >-----< +0| new Foo(123, 456); + +[#2 Leading delimiter] = 0:11-0:13 + >--< +0| new Foo(123, 456); + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/argument.actual.method.iteration.scope b/data/fixtures/scopes/java/argument.actual.method.iteration.scope new file mode 100644 index 0000000000..bfc40570a6 --- /dev/null +++ b/data/fixtures/scopes/java/argument.actual.method.iteration.scope @@ -0,0 +1,10 @@ +foo.bar(123, 456); +--- + +[Range] = 0:8-0:16 + >--------< +0| foo.bar(123, 456); + +[Domain] = 0:7-0:17 + >----------< +0| foo.bar(123, 456); diff --git a/data/fixtures/scopes/java/argument.actual.method.scope b/data/fixtures/scopes/java/argument.actual.method.scope new file mode 100644 index 0000000000..6501846622 --- /dev/null +++ b/data/fixtures/scopes/java/argument.actual.method.scope @@ -0,0 +1,33 @@ +foo.bar(123, 456); +--- + +[#1 Content] = +[#1 Domain] = 0:8-0:11 + >---< +0| foo.bar(123, 456); + +[#1 Removal] = 0:8-0:13 + >-----< +0| foo.bar(123, 456); + +[#1 Trailing delimiter] = 0:11-0:13 + >--< +0| foo.bar(123, 456); + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:13-0:16 + >---< +0| foo.bar(123, 456); + +[#2 Removal] = 0:11-0:16 + >-----< +0| foo.bar(123, 456); + +[#2 Leading delimiter] = 0:11-0:13 + >--< +0| foo.bar(123, 456); + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/argument.formal.constructor.iteration.scope b/data/fixtures/scopes/java/argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..d060457e02 --- /dev/null +++ b/data/fixtures/scopes/java/argument.formal.constructor.iteration.scope @@ -0,0 +1,12 @@ +public class MyClass { + public MyClass(String name, int age) {} +} +--- + +[Range] = 1:19-1:39 + >--------------------< +1| public MyClass(String name, int age) {} + +[Domain] = 1:4-1:43 + >---------------------------------------< +1| public MyClass(String name, int age) {} diff --git a/data/fixtures/scopes/java/argument.formal.constructor.scope b/data/fixtures/scopes/java/argument.formal.constructor.scope new file mode 100644 index 0000000000..7f0b1de10b --- /dev/null +++ b/data/fixtures/scopes/java/argument.formal.constructor.scope @@ -0,0 +1,35 @@ +public class MyClass { + public MyClass(String name, int age) {} +} +--- + +[#1 Content] = +[#1 Domain] = 1:19-1:30 + >-----------< +1| public MyClass(String name, int age) {} + +[#1 Removal] = 1:19-1:32 + >-------------< +1| public MyClass(String name, int age) {} + +[#1 Trailing delimiter] = 1:30-1:32 + >--< +1| public MyClass(String name, int age) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:32-1:39 + >-------< +1| public MyClass(String name, int age) {} + +[#2 Removal] = 1:30-1:39 + >---------< +1| public MyClass(String name, int age) {} + +[#2 Leading delimiter] = 1:30-1:32 + >--< +1| public MyClass(String name, int age) {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/argument.formal.method.iteration.scope b/data/fixtures/scopes/java/argument.formal.method.iteration.scope new file mode 100644 index 0000000000..5f3e142d2a --- /dev/null +++ b/data/fixtures/scopes/java/argument.formal.method.iteration.scope @@ -0,0 +1,12 @@ +public class MyClass { + public void foo(String name, int age) {} +} +--- + +[Range] = 1:20-1:40 + >--------------------< +1| public void foo(String name, int age) {} + +[Domain] = 1:4-1:44 + >----------------------------------------< +1| public void foo(String name, int age) {} diff --git a/data/fixtures/scopes/java/argument.formal.method.scope b/data/fixtures/scopes/java/argument.formal.method.scope new file mode 100644 index 0000000000..a67504d3d3 --- /dev/null +++ b/data/fixtures/scopes/java/argument.formal.method.scope @@ -0,0 +1,35 @@ +public class MyClass { + public void foo(String name, int age) {} +} +--- + +[#1 Content] = +[#1 Domain] = 1:20-1:31 + >-----------< +1| public void foo(String name, int age) {} + +[#1 Removal] = 1:20-1:33 + >-------------< +1| public void foo(String name, int age) {} + +[#1 Trailing delimiter] = 1:31-1:33 + >--< +1| public void foo(String name, int age) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:33-1:40 + >-------< +1| public void foo(String name, int age) {} + +[#2 Removal] = 1:31-1:40 + >---------< +1| public void foo(String name, int age) {} + +[#2 Leading delimiter] = 1:31-1:33 + >--< +1| public void foo(String name, int age) {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/branch.switchCase.iteration.scope b/data/fixtures/scopes/java/branch.switchCase.iteration.scope new file mode 100644 index 0000000000..737728229c --- /dev/null +++ b/data/fixtures/scopes/java/branch.switchCase.iteration.scope @@ -0,0 +1,33 @@ +switch (value) { + case 1: + break; + case 2: + break; + default: + break; +} +--- + +[Range] = 0:16-7:0 + > +0| switch (value) { +1| case 1: +2| break; +3| case 2: +4| break; +5| default: +6| break; +7| } + < + +[Domain] = 0:0-7:1 + >---------------- +0| switch (value) { +1| case 1: +2| break; +3| case 2: +4| break; +5| default: +6| break; +7| } + -< diff --git a/data/fixtures/scopes/java/branch.switchCase.scope b/data/fixtures/scopes/java/branch.switchCase.scope new file mode 100644 index 0000000000..66ac2695d4 --- /dev/null +++ b/data/fixtures/scopes/java/branch.switchCase.scope @@ -0,0 +1,71 @@ +switch (value) { + case 1: + break; + case 2: + break; + default: + break; +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-2:14 + >------- +1| case 1: +2| break; + --------------< + +[#1 Removal] = 1:0-3:0 + >----------- +1| case 1: +2| break; +3| case 2: + < + +[#1 Leading delimiter] = 1:0-1:4 + >----< +1| case 1: + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 3:4-4:14 + >------- +3| case 2: +4| break; + --------------< + +[#2 Removal] = 3:0-5:0 + >----------- +3| case 2: +4| break; +5| default: + < + +[#2 Leading delimiter] = 3:0-3:4 + >----< +3| case 2: + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 5:4-6:14 + >-------- +5| default: +6| break; + --------------< + +[#3 Removal] = 5:0-7:0 + >------------ +5| default: +6| break; +7| } + < + +[#3 Leading delimiter] = 5:0-5:4 + >----< +5| default: + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/branch.ternary.scope b/data/fixtures/scopes/java/branch.ternary.scope new file mode 100644 index 0000000000..75fa5f5e2b --- /dev/null +++ b/data/fixtures/scopes/java/branch.ternary.scope @@ -0,0 +1,37 @@ +value != null ? value : -1; +--- + +[#1 Content] = +[#1 Domain] = 0:16-0:21 + >-----< +0| value != null ? value : -1; + +[#1 Removal] = 0:16-0:22 + >------< +0| value != null ? value : -1; + +[#1 Leading delimiter] = 0:15-0:16 + >-< +0| value != null ? value : -1; + +[#1 Trailing delimiter] = 0:21-0:22 + >-< +0| value != null ? value : -1; + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 0:24-0:26 + >--< +0| value != null ? value : -1; + +[#2 Removal] = 0:23-0:26 + >---< +0| value != null ? value : -1; + +[#2 Leading delimiter] = 0:23-0:24 + >-< +0| value != null ? value : -1; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/class.scope b/data/fixtures/scopes/java/class.scope new file mode 100644 index 0000000000..eab5a96bbd --- /dev/null +++ b/data/fixtures/scopes/java/class.scope @@ -0,0 +1,10 @@ +public class MyClass { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:24 + >------------------------< +0| public class MyClass { } + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/java/className.scope b/data/fixtures/scopes/java/className.scope new file mode 100644 index 0000000000..dfc56cf188 --- /dev/null +++ b/data/fixtures/scopes/java/className.scope @@ -0,0 +1,24 @@ +public class MyClass { } +--- + +[Content] = 0:13-0:20 + >-------< +0| public class MyClass { } + +[Removal] = 0:13-0:21 + >--------< +0| public class MyClass { } + +[Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { } + +[Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { } + +[Domain] = 0:0-0:24 + >------------------------< +0| public class MyClass { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/comment.block.scope b/data/fixtures/scopes/java/comment.block.scope new file mode 100644 index 0000000000..7c4611e225 --- /dev/null +++ b/data/fixtures/scopes/java/comment.block.scope @@ -0,0 +1,10 @@ +/* Hello */ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| /* Hello */ + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/comment.line.scope b/data/fixtures/scopes/java/comment.line.scope new file mode 100644 index 0000000000..576f62c186 --- /dev/null +++ b/data/fixtures/scopes/java/comment.line.scope @@ -0,0 +1,10 @@ +// Hello +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| // Hello + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/condition.doWhile.scope b/data/fixtures/scopes/java/condition.doWhile.scope new file mode 100644 index 0000000000..a08fbe233d --- /dev/null +++ b/data/fixtures/scopes/java/condition.doWhile.scope @@ -0,0 +1,13 @@ +do { } while(value != null); +--- + +[Content] = +[Removal] = 0:13-0:26 + >-------------< +0| do { } while(value != null); + +[Domain] = 0:0-0:28 + >----------------------------< +0| do { } while(value != null); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/condition.for.scope b/data/fixtures/scopes/java/condition.for.scope new file mode 100644 index 0000000000..12ebd6c6c0 --- /dev/null +++ b/data/fixtures/scopes/java/condition.for.scope @@ -0,0 +1,20 @@ +for (int i = 0; i < value.length; ++i) { } +--- + +[Content] = 0:16-0:32 + >----------------< +0| for (int i = 0; i < value.length; ++i) { } + +[Removal] = 0:15-0:32 + >-----------------< +0| for (int i = 0; i < value.length; ++i) { } + +[Leading delimiter] = 0:15-0:16 + >-< +0| for (int i = 0; i < value.length; ++i) { } + +[Domain] = 0:0-0:42 + >------------------------------------------< +0| for (int i = 0; i < value.length; ++i) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/condition.if.scope b/data/fixtures/scopes/java/condition.if.scope new file mode 100644 index 0000000000..b1ee077a52 --- /dev/null +++ b/data/fixtures/scopes/java/condition.if.scope @@ -0,0 +1,13 @@ +if (value != null) { } +--- + +[Content] = +[Removal] = 0:4-0:17 + >-------------< +0| if (value != null) { } + +[Domain] = 0:0-0:22 + >----------------------< +0| if (value != null) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/condition.switchCase.iteration.scope b/data/fixtures/scopes/java/condition.switchCase.iteration.scope new file mode 100644 index 0000000000..737728229c --- /dev/null +++ b/data/fixtures/scopes/java/condition.switchCase.iteration.scope @@ -0,0 +1,33 @@ +switch (value) { + case 1: + break; + case 2: + break; + default: + break; +} +--- + +[Range] = 0:16-7:0 + > +0| switch (value) { +1| case 1: +2| break; +3| case 2: +4| break; +5| default: +6| break; +7| } + < + +[Domain] = 0:0-7:1 + >---------------- +0| switch (value) { +1| case 1: +2| break; +3| case 2: +4| break; +5| default: +6| break; +7| } + -< diff --git a/data/fixtures/scopes/java/condition.switchCase.scope b/data/fixtures/scopes/java/condition.switchCase.scope new file mode 100644 index 0000000000..cc709a517b --- /dev/null +++ b/data/fixtures/scopes/java/condition.switchCase.scope @@ -0,0 +1,50 @@ +switch (value) { + case 1: + break; + case 2: + break; + default: + break; +} +--- + +[#1 Content] = 1:9-1:10 + >-< +1| case 1: + +[#1 Removal] = 1:8-1:10 + >--< +1| case 1: + +[#1 Leading delimiter] = 1:8-1:9 + >-< +1| case 1: + +[#1 Domain] = 1:4-2:14 + >------- +1| case 1: +2| break; + --------------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 3:9-3:10 + >-< +3| case 2: + +[#2 Removal] = 3:8-3:10 + >--< +3| case 2: + +[#2 Leading delimiter] = 3:8-3:9 + >-< +3| case 2: + +[#2 Domain] = 3:4-4:14 + >------- +3| case 2: +4| break; + --------------< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/condition.ternary.scope b/data/fixtures/scopes/java/condition.ternary.scope new file mode 100644 index 0000000000..2d7ade10ae --- /dev/null +++ b/data/fixtures/scopes/java/condition.ternary.scope @@ -0,0 +1,20 @@ +value != null ? value : -1; +--- + +[Content] = 0:0-0:13 + >-------------< +0| value != null ? value : -1; + +[Removal] = 0:0-0:14 + >--------------< +0| value != null ? value : -1; + +[Trailing delimiter] = 0:13-0:14 + >-< +0| value != null ? value : -1; + +[Domain] = 0:0-0:26 + >--------------------------< +0| value != null ? value : -1; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/condition.while.scope b/data/fixtures/scopes/java/condition.while.scope new file mode 100644 index 0000000000..baedea2418 --- /dev/null +++ b/data/fixtures/scopes/java/condition.while.scope @@ -0,0 +1,13 @@ +while(value != null) { } +--- + +[Content] = +[Removal] = 0:6-0:19 + >-------------< +0| while(value != null) { } + +[Domain] = 0:0-0:24 + >------------------------< +0| while(value != null) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCall.constructor.scope b/data/fixtures/scopes/java/functionCall.constructor.scope new file mode 100644 index 0000000000..1792bc1720 --- /dev/null +++ b/data/fixtures/scopes/java/functionCall.constructor.scope @@ -0,0 +1,10 @@ +new Foo(123, 456); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| new Foo(123, 456); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCall.scope b/data/fixtures/scopes/java/functionCall.scope new file mode 100644 index 0000000000..0d549d2308 --- /dev/null +++ b/data/fixtures/scopes/java/functionCall.scope @@ -0,0 +1,10 @@ +foo(123, 456); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| foo(123, 456); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCallee.constructor.scope b/data/fixtures/scopes/java/functionCallee.constructor.scope new file mode 100644 index 0000000000..e23818aa3d --- /dev/null +++ b/data/fixtures/scopes/java/functionCallee.constructor.scope @@ -0,0 +1,13 @@ +new Foo(); +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| new Foo(); + +[Domain] = 0:0-0:10 + >----------< +0| new Foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionCallee.scope b/data/fixtures/scopes/java/functionCallee.scope new file mode 100644 index 0000000000..0dbddcd146 --- /dev/null +++ b/data/fixtures/scopes/java/functionCallee.scope @@ -0,0 +1,13 @@ +foo(); +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo(); + +[Domain] = 0:0-0:6 + >------< +0| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionName.constructor.scope b/data/fixtures/scopes/java/functionName.constructor.scope new file mode 100644 index 0000000000..160e54fd14 --- /dev/null +++ b/data/fixtures/scopes/java/functionName.constructor.scope @@ -0,0 +1,19 @@ +public class MyClass { + public MyClass() { } +} +--- + +[Content] = +[Removal] = 1:11-1:18 + >-------< +1| public MyClass() { } + +[Leading delimiter] = 1:10-1:11 + >-< +1| public MyClass() { } + +[Domain] = 1:4-1:24 + >--------------------< +1| public MyClass() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionName.method.scope b/data/fixtures/scopes/java/functionName.method.scope new file mode 100644 index 0000000000..c2687ad6c3 --- /dev/null +++ b/data/fixtures/scopes/java/functionName.method.scope @@ -0,0 +1,19 @@ +public class MyClass { + public void foo() { } +} +--- + +[Content] = +[Removal] = 1:16-1:19 + >---< +1| public void foo() { } + +[Leading delimiter] = 1:15-1:16 + >-< +1| public void foo() { } + +[Domain] = 1:4-1:25 + >---------------------< +1| public void foo() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/ifStatement.scope b/data/fixtures/scopes/java/ifStatement.scope new file mode 100644 index 0000000000..386e130326 --- /dev/null +++ b/data/fixtures/scopes/java/ifStatement.scope @@ -0,0 +1,10 @@ +if (value != null) { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:22 + >----------------------< +0| if (value != null) { } + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/list.scope b/data/fixtures/scopes/java/list.scope new file mode 100644 index 0000000000..b69f66f00c --- /dev/null +++ b/data/fixtures/scopes/java/list.scope @@ -0,0 +1,10 @@ +new int[]{1, 2, 3}; +--- + +[Content] = +[Removal] = +[Domain] = 0:9-0:18 + >---------< +0| new int[]{1, 2, 3}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..15f2dc4312 --- /dev/null +++ b/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope @@ -0,0 +1,12 @@ +public class MyClass { + public MyClass(String name, int value) { } +} +--- + +[Range] = 1:19-1:41 + >----------------------< +1| public MyClass(String name, int value) { } + +[Domain] = 1:18-1:42 + >------------------------< +1| public MyClass(String name, int value) { } diff --git a/data/fixtures/scopes/java/name.argument.formal.constructor.scope b/data/fixtures/scopes/java/name.argument.formal.constructor.scope new file mode 100644 index 0000000000..50c40d9133 --- /dev/null +++ b/data/fixtures/scopes/java/name.argument.formal.constructor.scope @@ -0,0 +1,83 @@ +public class MyClass { + public MyClass(String name, int value) { } +} +--- + +[#1 Content] = 0:13-0:20 + >-------< +0| public class MyClass { + +[#1 Removal] = 0:13-0:21 + >--------< +0| public class MyClass { + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public MyClass(String name, int value) { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:11-1:18 + >-------< +1| public MyClass(String name, int value) { } + +[#2 Leading delimiter] = 1:10-1:11 + >-< +1| public MyClass(String name, int value) { } + +[#2 Domain] = 1:4-1:46 + >------------------------------------------< +1| public MyClass(String name, int value) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:26-1:30 + >----< +1| public MyClass(String name, int value) { } + +[#3 Removal] = 1:25-1:30 + >-----< +1| public MyClass(String name, int value) { } + +[#3 Leading delimiter] = 1:25-1:26 + >-< +1| public MyClass(String name, int value) { } + +[#3 Domain] = 1:19-1:30 + >-----------< +1| public MyClass(String name, int value) { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 1:36-1:41 + >-----< +1| public MyClass(String name, int value) { } + +[#4 Removal] = 1:35-1:41 + >------< +1| public MyClass(String name, int value) { } + +[#4 Leading delimiter] = 1:35-1:36 + >-< +1| public MyClass(String name, int value) { } + +[#4 Domain] = 1:32-1:41 + >---------< +1| public MyClass(String name, int value) { } + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..073b8b3ae0 --- /dev/null +++ b/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope @@ -0,0 +1,12 @@ +public class MyClass { + public void foo(String name, int value) { } +} +--- + +[Range] = 1:20-1:42 + >----------------------< +1| public void foo(String name, int value) { } + +[Domain] = 1:19-1:43 + >------------------------< +1| public void foo(String name, int value) { } diff --git a/data/fixtures/scopes/java/name.argument.formal.method.scope b/data/fixtures/scopes/java/name.argument.formal.method.scope new file mode 100644 index 0000000000..512229ce6e --- /dev/null +++ b/data/fixtures/scopes/java/name.argument.formal.method.scope @@ -0,0 +1,83 @@ +public class MyClass { + public void foo(String name, int value) { } +} +--- + +[#1 Content] = 0:13-0:20 + >-------< +0| public class MyClass { + +[#1 Removal] = 0:13-0:21 + >--------< +0| public class MyClass { + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public void foo(String name, int value) { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:16-1:19 + >---< +1| public void foo(String name, int value) { } + +[#2 Leading delimiter] = 1:15-1:16 + >-< +1| public void foo(String name, int value) { } + +[#2 Domain] = 1:4-1:47 + >-------------------------------------------< +1| public void foo(String name, int value) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:27-1:31 + >----< +1| public void foo(String name, int value) { } + +[#3 Removal] = 1:26-1:31 + >-----< +1| public void foo(String name, int value) { } + +[#3 Leading delimiter] = 1:26-1:27 + >-< +1| public void foo(String name, int value) { } + +[#3 Domain] = 1:20-1:31 + >-----------< +1| public void foo(String name, int value) { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 1:37-1:42 + >-----< +1| public void foo(String name, int value) { } + +[#4 Removal] = 1:36-1:42 + >------< +1| public void foo(String name, int value) { } + +[#4 Leading delimiter] = 1:36-1:37 + >-< +1| public void foo(String name, int value) { } + +[#4 Domain] = 1:33-1:42 + >---------< +1| public void foo(String name, int value) { } + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.assignment.scope b/data/fixtures/scopes/java/name.assignment.scope new file mode 100644 index 0000000000..f18bb86183 --- /dev/null +++ b/data/fixtures/scopes/java/name.assignment.scope @@ -0,0 +1,20 @@ +value = 123; +--- + +[Content] = 0:0-0:5 + >-----< +0| value = 123; + +[Removal] = 0:0-0:8 + >--------< +0| value = 123; + +[Trailing delimiter] = 0:5-0:8 + >---< +0| value = 123; + +[Domain] = 0:0-0:12 + >------------< +0| value = 123; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.class.scope b/data/fixtures/scopes/java/name.class.scope new file mode 100644 index 0000000000..dfc56cf188 --- /dev/null +++ b/data/fixtures/scopes/java/name.class.scope @@ -0,0 +1,24 @@ +public class MyClass { } +--- + +[Content] = 0:13-0:20 + >-------< +0| public class MyClass { } + +[Removal] = 0:13-0:21 + >--------< +0| public class MyClass { } + +[Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { } + +[Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { } + +[Domain] = 0:0-0:24 + >------------------------< +0| public class MyClass { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.constructor.scope b/data/fixtures/scopes/java/name.constructor.scope new file mode 100644 index 0000000000..9b6a51c2f9 --- /dev/null +++ b/data/fixtures/scopes/java/name.constructor.scope @@ -0,0 +1,45 @@ +public class MyClass { + public MyClass() { } +} +--- + +[#1 Content] = 0:13-0:20 + >-------< +0| public class MyClass { + +[#1 Removal] = 0:13-0:21 + >--------< +0| public class MyClass { + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public MyClass() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:11-1:18 + >-------< +1| public MyClass() { } + +[#2 Leading delimiter] = 1:10-1:11 + >-< +1| public MyClass() { } + +[#2 Domain] = 1:4-1:24 + >--------------------< +1| public MyClass() { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.field.scope b/data/fixtures/scopes/java/name.field.scope new file mode 100644 index 0000000000..bd3fdd13ad --- /dev/null +++ b/data/fixtures/scopes/java/name.field.scope @@ -0,0 +1,48 @@ +public class MyClass { + private int value; +} +--- + +[#1 Content] = 0:13-0:20 + >-------< +0| public class MyClass { + +[#1 Removal] = 0:13-0:21 + >--------< +0| public class MyClass { + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| private int value; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:16-1:21 + >-----< +1| private int value; + +[#2 Removal] = 1:15-1:21 + >------< +1| private int value; + +[#2 Leading delimiter] = 1:15-1:16 + >-< +1| private int value; + +[#2 Domain] = 1:4-1:22 + >------------------< +1| private int value; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.method.scope b/data/fixtures/scopes/java/name.method.scope new file mode 100644 index 0000000000..e31d1facd0 --- /dev/null +++ b/data/fixtures/scopes/java/name.method.scope @@ -0,0 +1,45 @@ +public class MyClass { + public void foo() { } +} +--- + +[#1 Content] = 0:13-0:20 + >-------< +0| public class MyClass { + +[#1 Removal] = 0:13-0:21 + >--------< +0| public class MyClass { + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| public class MyClass { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public class MyClass { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public void foo() { } +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:16-1:19 + >---< +1| public void foo() { } + +[#2 Leading delimiter] = 1:15-1:16 + >-< +1| public void foo() { } + +[#2 Domain] = 1:4-1:25 + >---------------------< +1| public void foo() { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.variable.scope b/data/fixtures/scopes/java/name.variable.scope new file mode 100644 index 0000000000..6c908fcf08 --- /dev/null +++ b/data/fixtures/scopes/java/name.variable.scope @@ -0,0 +1,20 @@ +int value = 123; +--- + +[Content] = 0:4-0:9 + >-----< +0| int value = 123; + +[Removal] = 0:4-0:12 + >--------< +0| int value = 123; + +[Trailing delimiter] = 0:9-0:12 + >---< +0| int value = 123; + +[Domain] = 0:0-0:16 + >----------------< +0| int value = 123; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/namedFunction.constructor.scope b/data/fixtures/scopes/java/namedFunction.constructor.scope new file mode 100644 index 0000000000..e683eae9c7 --- /dev/null +++ b/data/fixtures/scopes/java/namedFunction.constructor.scope @@ -0,0 +1,21 @@ +public class MyClass { + public MyClass() { } +} +--- + +[Content] = +[Domain] = 1:4-1:24 + >--------------------< +1| public MyClass() { } + +[Removal] = 1:0-2:0 + >------------------------ +1| public MyClass() { } +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| public MyClass() { } + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/java/namedFunction.method.scope b/data/fixtures/scopes/java/namedFunction.method.scope new file mode 100644 index 0000000000..cd7412a16f --- /dev/null +++ b/data/fixtures/scopes/java/namedFunction.method.scope @@ -0,0 +1,21 @@ +public class MyClass { + public void foo() { } +} +--- + +[Content] = +[Domain] = 1:4-1:25 + >---------------------< +1| public void foo() { } + +[Removal] = 1:0-2:0 + >------------------------- +1| public void foo() { } +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| public void foo() { } + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/java/statement.class.scope b/data/fixtures/scopes/java/statement.class.scope new file mode 100644 index 0000000000..5153070300 --- /dev/null +++ b/data/fixtures/scopes/java/statement.class.scope @@ -0,0 +1,10 @@ +public class MyClass { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:24 + >------------------------< +0| public class MyClass { } + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.scope b/data/fixtures/scopes/java/statement.scope new file mode 100644 index 0000000000..f64174b953 --- /dev/null +++ b/data/fixtures/scopes/java/statement.scope @@ -0,0 +1,10 @@ +if (true) { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| if (true) { } + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/string.singleLine.scope b/data/fixtures/scopes/java/string.singleLine.scope new file mode 100644 index 0000000000..4b26cf31b3 --- /dev/null +++ b/data/fixtures/scopes/java/string.singleLine.scope @@ -0,0 +1,10 @@ +"Hello world" +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| "Hello world" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/switchStatementSubject.scope b/data/fixtures/scopes/java/switchStatementSubject.scope new file mode 100644 index 0000000000..d8df9f3d58 --- /dev/null +++ b/data/fixtures/scopes/java/switchStatementSubject.scope @@ -0,0 +1,13 @@ +switch (value) { } +--- + +[Content] = +[Removal] = 0:8-0:13 + >-----< +0| switch (value) { } + +[Domain] = 0:0-0:18 + >------------------< +0| switch (value) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/textFragment.comment.block.scope b/data/fixtures/scopes/java/textFragment.comment.block.scope new file mode 100644 index 0000000000..af33f95d00 --- /dev/null +++ b/data/fixtures/scopes/java/textFragment.comment.block.scope @@ -0,0 +1,10 @@ +/* Hello world */ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| /* Hello world */ + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/textFragment.comment.line.scope b/data/fixtures/scopes/java/textFragment.comment.line.scope new file mode 100644 index 0000000000..6758f81490 --- /dev/null +++ b/data/fixtures/scopes/java/textFragment.comment.line.scope @@ -0,0 +1,10 @@ +// Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| // Hello world + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/textFragment.string.singleLine.scope b/data/fixtures/scopes/java/textFragment.string.singleLine.scope new file mode 100644 index 0000000000..85dcf5fa7f --- /dev/null +++ b/data/fixtures/scopes/java/textFragment.string.singleLine.scope @@ -0,0 +1,10 @@ +"Hello world" +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:12 + >-----------< +0| "Hello world" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.argument.formal.constructor.scope b/data/fixtures/scopes/java/type.argument.formal.constructor.scope new file mode 100644 index 0000000000..8377e0d303 --- /dev/null +++ b/data/fixtures/scopes/java/type.argument.formal.constructor.scope @@ -0,0 +1,26 @@ +public class MyClass { + public MyClass(final int value) { } +} +--- + +[Content] = 1:25-1:28 + >---< +1| public MyClass(final int value) { } + +[Removal] = 1:25-1:29 + >----< +1| public MyClass(final int value) { } + +[Leading delimiter] = 1:24-1:25 + >-< +1| public MyClass(final int value) { } + +[Trailing delimiter] = 1:28-1:29 + >-< +1| public MyClass(final int value) { } + +[Domain] = 1:19-1:34 + >---------------< +1| public MyClass(final int value) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.argument.formal.method.scope b/data/fixtures/scopes/java/type.argument.formal.method.scope new file mode 100644 index 0000000000..c4bfe46cc6 --- /dev/null +++ b/data/fixtures/scopes/java/type.argument.formal.method.scope @@ -0,0 +1,49 @@ +public class MyClass { + public void foo(final int value) { } +} +--- + +[#1 Content] = 1:11-1:15 + >----< +1| public void foo(final int value) { } + +[#1 Removal] = 1:11-1:16 + >-----< +1| public void foo(final int value) { } + +[#1 Leading delimiter] = 1:10-1:11 + >-< +1| public void foo(final int value) { } + +[#1 Trailing delimiter] = 1:15-1:16 + >-< +1| public void foo(final int value) { } + +[#1 Domain] = 1:4-1:40 + >------------------------------------< +1| public void foo(final int value) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:26-1:29 + >---< +1| public void foo(final int value) { } + +[#2 Removal] = 1:26-1:30 + >----< +1| public void foo(final int value) { } + +[#2 Leading delimiter] = 1:25-1:26 + >-< +1| public void foo(final int value) { } + +[#2 Trailing delimiter] = 1:29-1:30 + >-< +1| public void foo(final int value) { } + +[#2 Domain] = 1:20-1:35 + >---------------< +1| public void foo(final int value) { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.return.scope b/data/fixtures/scopes/java/type.return.scope new file mode 100644 index 0000000000..a3df4adec0 --- /dev/null +++ b/data/fixtures/scopes/java/type.return.scope @@ -0,0 +1,31 @@ +public class MyClass { + public int myFunk() { + return 123; + } +} +--- + +[Content] = 1:11-1:14 + >---< +1| public int myFunk() { + +[Removal] = 1:11-1:15 + >----< +1| public int myFunk() { + +[Leading delimiter] = 1:10-1:11 + >-< +1| public int myFunk() { + +[Trailing delimiter] = 1:14-1:15 + >-< +1| public int myFunk() { + +[Domain] = 1:4-3:5 + >--------------------- +1| public int myFunk() { +2| return 123; +3| } + -----< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.variable.scope b/data/fixtures/scopes/java/type.variable.scope new file mode 100644 index 0000000000..7d37d372b7 --- /dev/null +++ b/data/fixtures/scopes/java/type.variable.scope @@ -0,0 +1,20 @@ +int value; +--- + +[Content] = 0:0-0:3 + >---< +0| int value; + +[Removal] = 0:0-0:4 + >----< +0| int value; + +[Trailing delimiter] = 0:3-0:4 + >-< +0| int value; + +[Domain] = 0:0-0:10 + >----------< +0| int value; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.variable2.scope b/data/fixtures/scopes/java/type.variable2.scope new file mode 100644 index 0000000000..a2c664ab43 --- /dev/null +++ b/data/fixtures/scopes/java/type.variable2.scope @@ -0,0 +1,20 @@ +int value = 123; +--- + +[Content] = 0:0-0:3 + >---< +0| int value = 123; + +[Removal] = 0:0-0:4 + >----< +0| int value = 123; + +[Trailing delimiter] = 0:3-0:4 + >-< +0| int value = 123; + +[Domain] = 0:0-0:16 + >----------------< +0| int value = 123; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value.assignment.scope b/data/fixtures/scopes/java/value.assignment.scope new file mode 100644 index 0000000000..98eac669f7 --- /dev/null +++ b/data/fixtures/scopes/java/value.assignment.scope @@ -0,0 +1,20 @@ +value = 123; +--- + +[Content] = 0:8-0:11 + >---< +0| value = 123; + +[Removal] = 0:5-0:11 + >------< +0| value = 123; + +[Leading delimiter] = 0:5-0:8 + >---< +0| value = 123; + +[Domain] = 0:0-0:12 + >------------< +0| value = 123; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value.field.scope b/data/fixtures/scopes/java/value.field.scope new file mode 100644 index 0000000000..d6449ef022 --- /dev/null +++ b/data/fixtures/scopes/java/value.field.scope @@ -0,0 +1,22 @@ +public class MyClass { + private int value = 123; +} +--- + +[Content] = 1:24-1:27 + >---< +1| private int value = 123; + +[Removal] = 1:21-1:27 + >------< +1| private int value = 123; + +[Leading delimiter] = 1:21-1:24 + >---< +1| private int value = 123; + +[Domain] = 1:4-1:28 + >------------------------< +1| private int value = 123; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value.return.lambda.scope b/data/fixtures/scopes/java/value.return.lambda.scope new file mode 100644 index 0000000000..92aec8abee --- /dev/null +++ b/data/fixtures/scopes/java/value.return.lambda.scope @@ -0,0 +1,20 @@ +() -> 123 +--- + +[Content] = 0:6-0:9 + >---< +0| () -> 123 + +[Removal] = 0:5-0:9 + >----< +0| () -> 123 + +[Leading delimiter] = 0:5-0:6 + >-< +0| () -> 123 + +[Domain] = 0:0-0:9 + >---------< +0| () -> 123 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value.return.scope b/data/fixtures/scopes/java/value.return.scope new file mode 100644 index 0000000000..e30150b26d --- /dev/null +++ b/data/fixtures/scopes/java/value.return.scope @@ -0,0 +1,24 @@ +public class MyClass { + public int foo() { + return 123; + } +} +--- + +[Content] = 2:15-2:18 + >---< +2| return 123; + +[Removal] = 2:14-2:18 + >----< +2| return 123; + +[Leading delimiter] = 2:14-2:15 + >-< +2| return 123; + +[Domain] = 2:8-2:19 + >-----------< +2| return 123; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value.variable.scope b/data/fixtures/scopes/java/value.variable.scope new file mode 100644 index 0000000000..98eac669f7 --- /dev/null +++ b/data/fixtures/scopes/java/value.variable.scope @@ -0,0 +1,20 @@ +value = 123; +--- + +[Content] = 0:8-0:11 + >---< +0| value = 123; + +[Removal] = 0:5-0:11 + >------< +0| value = 123; + +[Leading delimiter] = 0:5-0:8 + >---< +0| value = 123; + +[Domain] = 0:0-0:12 + >------------< +0| value = 123; + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 6f9bda944a..67a8604bd1 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -1,25 +1,26 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported, notApplicable } = ScopeSupportFacetLevel; +const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const javaScopeSupport: LanguageScopeSupportFacetMap = { disqualifyDelimiter: supported, + anonymousFunction: supported, + list: supported, + switchStatementSubject: supported, - "name.foreach": supported, - - "value.foreach": supported, - - "type.foreach": supported, - "type.field": supported, - "type.field.iteration": supported, - "type.typeArgument": supported, - "type.typeArgument.iteration": supported, - - "argument.formal": supported, - "argument.formal.iteration": supported, "argument.actual": supported, "argument.actual.iteration": supported, + "argument.actual.constructor": supported, + "argument.actual.constructor.iteration": supported, + "argument.actual.method": supported, + "argument.actual.method.iteration": supported, + "argument.formal": supported, + "argument.formal.iteration": supported, + "argument.formal.constructor": supported, + "argument.formal.constructor.iteration": supported, + "argument.formal.method": supported, + "argument.formal.method.iteration": supported, "collectionItem.unenclosed": supported, "collectionItem.unenclosed.iteration": supported, @@ -29,9 +30,176 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": supported, "branch.try.iteration": supported, + "branch.switchCase": supported, + "branch.switchCase.iteration": supported, + "branch.ternary": supported, + + class: supported, + className: supported, + + "comment.block": supported, + "comment.line": supported, + + "condition.doWhile": supported, + "condition.for": supported, + "condition.if": supported, + "condition.switchCase": supported, + "condition.switchCase.iteration": supported, + "condition.ternary": supported, + "condition.while": supported, + + functionCall: supported, + "functionCall.constructor": supported, + functionCallee: supported, + "functionCallee.constructor": supported, + + "functionName.constructor": supported, + "functionName.method": supported, + + "name.argument.formal.constructor": supported, + "name.argument.formal.constructor.iteration": supported, + "name.argument.formal.method": supported, + "name.argument.formal.method.iteration": supported, + "name.assignment": supported, + "name.class": supported, + "name.constructor": supported, + "name.field": supported, + "name.foreach": supported, + "name.method": supported, + "name.variable": supported, + "namedFunction.constructor": supported, + "namedFunction.method": supported, + + ifStatement: supported, + statement: supported, + "statement.class": supported, + + "string.singleLine": supported, + + "textFragment.comment.block": supported, + "textFragment.comment.line": supported, + "textFragment.string.singleLine": supported, + + "type.typeArgument": supported, + "type.typeArgument.iteration": supported, + + "type.argument.formal.constructor": supported, + "type.argument.formal.method": supported, + "type.foreach": supported, + "type.field": supported, + "type.field.iteration": supported, + "type.return": supported, + "type.variable": supported, + + "value.assignment": supported, + "value.foreach": supported, + "value.field": supported, + "value.return": supported, + "value.return.lambda": supported, + "value.variable": supported, + + // Unsupported + + "class.iteration.block": unsupported, + "class.iteration.document": unsupported, + "className.iteration.block": unsupported, + "className.iteration.document": unsupported, + + "name.iteration.document": unsupported, + "name.iteration.block": unsupported, + "name.resource": unsupported, + "name.resource.iteration": unsupported, + + "type.argument.formal.constructor.iteration": unsupported, + "type.argument.formal.method.iteration": unsupported, + "type.cast": unsupported, + "type.class": unsupported, + "type.enum": unsupported, + "type.interface": unsupported, + + "value.resource": unsupported, + "value.resource.iteration": unsupported, + + "namedFunction.iteration.document": unsupported, + "namedFunction.method.iteration.class": unsupported, + + "functionName.iteration.block": unsupported, + "functionName.iteration.document": unsupported, + "functionName.method.iteration.class": unsupported, + + "interior.class": unsupported, + "interior.element": unsupported, + "interior.function": unsupported, + "interior.if": unsupported, + "interior.lambda": unsupported, + "interior.loop": unsupported, + "interior.resource": unsupported, + "interior.switchCase": unsupported, + "interior.ternary": unsupported, + "interior.try": unsupported, + + "statement.iteration.block": unsupported, + "statement.iteration.document": unsupported, + + "string.multiLine": unsupported, + "textFragment.string.multiLine": unsupported, + "branch.loop": unsupported, + fieldAccess: unsupported, + + // Not Applicable + + "name.assignment.pattern": notApplicable, + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "name.argument.formal": notApplicable, + "name.argument.formal.iteration": notApplicable, + "name.function": notApplicable, + "name.variable.pattern": notApplicable, + + "key.mapPair": notApplicable, + "key.mapPair.iteration": notApplicable, + + "value.attribute": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "value.mapPair": notApplicable, + "value.mapPair.iteration": notApplicable, + "value.variable.pattern": notApplicable, + "value.typeAlias": notApplicable, + "value.yield": notApplicable, + + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "type.alias": notApplicable, + + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + element: notApplicable, tags: notApplicable, - attribute: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + "textFragment.element": notApplicable, + + namedFunction: notApplicable, + "namedFunction.iteration.block": notApplicable, + + pairDelimiter: notApplicable, + functionName: notApplicable, + map: notApplicable, + regularExpression: notApplicable, + environment: notApplicable, + "interior.cell": notApplicable, + "interior.command": notApplicable, "key.attribute": notApplicable, - "value.attribute": notApplicable, + notebookCell: notApplicable, + attribute: notApplicable, + command: notApplicable, }; diff --git a/queries/java.scm b/queries/java.scm index 10e1e28f50..3f22a3c6c7 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -64,7 +64,10 @@ ;;!! "string" ;;! ^^^^^^^^ -(string_literal) @string @textFragment +( + (string_literal) @string @textFragment + (#character-range! @textFragment 1 -1) +) ;;!! // comment ;;! ^^^^^^^^^^ @@ -124,7 +127,14 @@ ) ) @condition.domain -(switch_expression) @branch.iteration @condition.iteration +(switch_expression + body: (_ + . + "{" @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @condition.iteration.end.startOf @branch.iteration.end.startOf + . + ) +) @condition.iteration.domain @branch.iteration.domain ;;!! if () {} ;;! ^^^^^^^^ @@ -223,11 +233,18 @@ ;;!! void myFunk(int value) {} ;;! ^^^^^ ;;! ------------------------- +(formal_parameter + (identifier) @name +) @_.domain + +;;!! void myFunk(int value) {} +;;! ^^^^^^^^^ (formal_parameters - (formal_parameter - (identifier) @name - ) @_.domain -) @_.iteration + . + "(" @name.iteration.start.endOf + ")" @name.iteration.end.startOf + . +) @name.iteration.domain ;;!! Map ;;! ^^^^^^^ ^^^^^^