diff --git a/data/fixtures/scopes/csharp/argument.formal.lambda.iteration.scope b/data/fixtures/scopes/csharp/argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..2eedb09354 --- /dev/null +++ b/data/fixtures/scopes/csharp/argument.formal.lambda.iteration.scope @@ -0,0 +1,10 @@ +(a, b) => {} +--- + +[Range] = 0:1-0:5 + >----< +0| (a, b) => {} + +[Domain] = 0:0-0:12 + >------------< +0| (a, b) => {} diff --git a/data/fixtures/scopes/csharp/argument.formal.lambda.scope b/data/fixtures/scopes/csharp/argument.formal.lambda.scope new file mode 100644 index 0000000000..02a715e97c --- /dev/null +++ b/data/fixtures/scopes/csharp/argument.formal.lambda.scope @@ -0,0 +1,33 @@ +(a, b) => {} +--- + +[#1 Content] = +[#1 Domain] = 0:1-0:2 + >-< +0| (a, b) => {} + +[#1 Removal] = 0:1-0:4 + >---< +0| (a, b) => {} + +[#1 Trailing delimiter] = 0:2-0:4 + >--< +0| (a, b) => {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:4-0:5 + >-< +0| (a, b) => {} + +[#2 Removal] = 0:2-0:5 + >---< +0| (a, b) => {} + +[#2 Leading delimiter] = 0:2-0:4 + >--< +0| (a, b) => {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/csharp/comment.block.scope b/data/fixtures/scopes/csharp/comment.block.scope new file mode 100644 index 0000000000..90f30164f9 --- /dev/null +++ b/data/fixtures/scopes/csharp/comment.block.scope @@ -0,0 +1,17 @@ +/* + Hello + world +*/ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:2 + >--- +0| /* +1| Hello +2| world +3| */ + --< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/comment.line.scope b/data/fixtures/scopes/csharp/comment.line.scope new file mode 100644 index 0000000000..7d1477b8a1 --- /dev/null +++ b/data/fixtures/scopes/csharp/comment.line.scope @@ -0,0 +1,10 @@ +// Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| // Hello world + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/csharp/name.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..9c96bc5807 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.argument.formal.constructor.iteration.scope @@ -0,0 +1,33 @@ +class MyClass { + MyClass(int foo, int bar) {} +} +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass(int foo, int bar) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 + > +0| class MyClass { +1| MyClass(int foo, int bar) {} +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:12-1:28 + >----------------< +1| MyClass(int foo, int bar) {} + + +[#4 Range] = +[#4 Domain] = 1:31-1:31 + >< +1| MyClass(int foo, int bar) {} diff --git a/data/fixtures/scopes/csharp/name.argument.formal.constructor.scope b/data/fixtures/scopes/csharp/name.argument.formal.constructor.scope new file mode 100644 index 0000000000..264d3d503a --- /dev/null +++ b/data/fixtures/scopes/csharp/name.argument.formal.constructor.scope @@ -0,0 +1,64 @@ +class MyClass { + MyClass(int foo) {} +} +--- + +[#1 Content] = 0:6-0:13 + >-------< +0| class MyClass { + +[#1 Removal] = 0:6-0:14 + >--------< +0| class MyClass { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class MyClass { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| class MyClass { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass(int foo) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:11 + >-------< +1| MyClass(int foo) {} + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| MyClass(int foo) {} + +[#2 Domain] = 1:4-1:23 + >-------------------< +1| MyClass(int foo) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:16-1:19 + >---< +1| MyClass(int foo) {} + +[#3 Removal] = 1:15-1:19 + >----< +1| MyClass(int foo) {} + +[#3 Leading delimiter] = 1:15-1:16 + >-< +1| MyClass(int foo) {} + +[#3 Domain] = 1:12-1:19 + >-------< +1| MyClass(int foo) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.argument.formal.iteration.scope b/data/fixtures/scopes/csharp/name.argument.formal.iteration.scope index 772228f4b6..cf46c08764 100644 --- a/data/fixtures/scopes/csharp/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/csharp/name.argument.formal.iteration.scope @@ -2,12 +2,18 @@ void myFunk(String name, int value) {} --- [#1 Range] = -[#1 Domain] = 0:12-0:34 - >----------------------< +[#1 Domain] = 0:0-0:38 + >--------------------------------------< 0| void myFunk(String name, int value) {} [#2 Range] = -[#2 Domain] = 0:37-0:37 +[#2 Domain] = 0:12-0:34 + >----------------------< +0| void myFunk(String name, int value) {} + + +[#3 Range] = +[#3 Domain] = 0:37-0:37 >< 0| void myFunk(String name, int value) {} diff --git a/data/fixtures/scopes/csharp/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/csharp/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..e621de9367 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.argument.formal.method.iteration.scope @@ -0,0 +1,33 @@ +class MyClass { + void funk(int foo, int bar) {} +} +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| void funk(int foo, int bar) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 + > +0| class MyClass { +1| void funk(int foo, int bar) {} +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:14-1:30 + >----------------< +1| void funk(int foo, int bar) {} + + +[#4 Range] = +[#4 Domain] = 1:33-1:33 + >< +1| void funk(int foo, int bar) {} diff --git a/data/fixtures/scopes/csharp/name.argument.formal.method.scope b/data/fixtures/scopes/csharp/name.argument.formal.method.scope new file mode 100644 index 0000000000..a4e449bcc6 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.argument.formal.method.scope @@ -0,0 +1,64 @@ +class MyClass { + void funk(int foo) {} +} +--- + +[#1 Content] = 0:6-0:13 + >-------< +0| class MyClass { + +[#1 Removal] = 0:6-0:14 + >--------< +0| class MyClass { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class MyClass { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| class MyClass { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| void funk(int foo) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:9-1:13 + >----< +1| void funk(int foo) {} + +[#2 Leading delimiter] = 1:8-1:9 + >-< +1| void funk(int foo) {} + +[#2 Domain] = 1:4-1:25 + >---------------------< +1| void funk(int foo) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:18-1:21 + >---< +1| void funk(int foo) {} + +[#3 Removal] = 1:17-1:21 + >----< +1| void funk(int foo) {} + +[#3 Leading delimiter] = 1:17-1:18 + >-< +1| void funk(int foo) {} + +[#3 Domain] = 1:14-1:21 + >-------< +1| void funk(int foo) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.class.scope b/data/fixtures/scopes/csharp/name.class.scope new file mode 100644 index 0000000000..004c73ac7b --- /dev/null +++ b/data/fixtures/scopes/csharp/name.class.scope @@ -0,0 +1,24 @@ +class MyClass {} +--- + +[Content] = 0:6-0:13 + >-------< +0| class MyClass {} + +[Removal] = 0:6-0:14 + >--------< +0| class MyClass {} + +[Leading delimiter] = 0:5-0:6 + >-< +0| class MyClass {} + +[Trailing delimiter] = 0:13-0:14 + >-< +0| class MyClass {} + +[Domain] = 0:0-0:16 + >----------------< +0| class MyClass {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.constructor.scope b/data/fixtures/scopes/csharp/name.constructor.scope new file mode 100644 index 0000000000..62614526f6 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.constructor.scope @@ -0,0 +1,45 @@ +class MyClass { + MyClass() {} +} +--- + +[#1 Content] = 0:6-0:13 + >-------< +0| class MyClass { + +[#1 Removal] = 0:6-0:14 + >--------< +0| class MyClass { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class MyClass { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| class MyClass { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass() {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:11 + >-------< +1| MyClass() {} + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| MyClass() {} + +[#2 Domain] = 1:4-1:16 + >------------< +1| MyClass() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.field.scope b/data/fixtures/scopes/csharp/name.field.scope new file mode 100644 index 0000000000..1dea8fe9b3 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.field.scope @@ -0,0 +1,48 @@ +class MyClass { + int value; +} +--- + +[#1 Content] = 0:6-0:13 + >-------< +0| class MyClass { + +[#1 Removal] = 0:6-0:14 + >--------< +0| class MyClass { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class MyClass { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| class MyClass { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| int value; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:13 + >-----< +1| int value; + +[#2 Removal] = 1:7-1:13 + >------< +1| int value; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int value; + +[#2 Domain] = 1:4-1:13 + >---------< +1| int value; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.foreach.scope b/data/fixtures/scopes/csharp/name.foreach.scope new file mode 100644 index 0000000000..e102189616 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.foreach.scope @@ -0,0 +1,24 @@ +foreach (int value in values) {} +--- + +[Content] = 0:13-0:18 + >-----< +0| foreach (int value in values) {} + +[Removal] = 0:13-0:19 + >------< +0| foreach (int value in values) {} + +[Leading delimiter] = 0:12-0:13 + >-< +0| foreach (int value in values) {} + +[Trailing delimiter] = 0:18-0:19 + >-< +0| foreach (int value in values) {} + +[Domain] = 0:0-0:32 + >--------------------------------< +0| foreach (int value in values) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.function.scope b/data/fixtures/scopes/csharp/name.function.scope new file mode 100644 index 0000000000..80cde86ee4 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.function.scope @@ -0,0 +1,17 @@ +void foo() {} +--- + +[Content] = +[Removal] = 0:5-0:8 + >---< +0| void foo() {} + +[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/csharp/name.iteration.block.scope b/data/fixtures/scopes/csharp/name.iteration.block.scope new file mode 100644 index 0000000000..a9bd7ec26f --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.block.scope @@ -0,0 +1,13 @@ +class MyClass { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| class MyClass { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| class MyClass { } diff --git a/data/fixtures/scopes/csharp/name.iteration.block2.scope b/data/fixtures/scopes/csharp/name.iteration.block2.scope new file mode 100644 index 0000000000..4ae59561fa --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.block2.scope @@ -0,0 +1,19 @@ +void MyFunk() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| void MyFunk() { } + + +[#2 Range] = +[#2 Domain] = 0:12-0:12 + >< +0| void MyFunk() { } + + +[#3 Range] = +[#3 Domain] = 0:15-0:16 + >-< +0| void MyFunk() { } diff --git a/data/fixtures/scopes/csharp/name.iteration.document.scope b/data/fixtures/scopes/csharp/name.iteration.document.scope new file mode 100644 index 0000000000..a1948c1fe5 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.document.scope @@ -0,0 +1,18 @@ + +class MyClass {} + +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:0 + > +0| +1| class MyClass {} +2| + < + + +[#2 Range] = +[#2 Domain] = 1:15-1:15 + >< +1| class MyClass {} diff --git a/data/fixtures/scopes/csharp/name.method.scope b/data/fixtures/scopes/csharp/name.method.scope new file mode 100644 index 0000000000..219e506b77 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.method.scope @@ -0,0 +1,45 @@ +class MyClass { + void funk() {} +} +--- + +[#1 Content] = 0:6-0:13 + >-------< +0| class MyClass { + +[#1 Removal] = 0:6-0:14 + >--------< +0| class MyClass { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class MyClass { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| class MyClass { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| void funk() {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:9-1:13 + >----< +1| void funk() {} + +[#2 Leading delimiter] = 1:8-1:9 + >-< +1| void funk() {} + +[#2 Domain] = 1:4-1:18 + >--------------< +1| void funk() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/statement.class.scope b/data/fixtures/scopes/csharp/statement.class.scope new file mode 100644 index 0000000000..bcfb80fe89 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.class.scope @@ -0,0 +1,10 @@ +class MyClass { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| class MyClass { } + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.iteration.block.scope b/data/fixtures/scopes/csharp/statement.iteration.block.scope new file mode 100644 index 0000000000..a9bd7ec26f --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.block.scope @@ -0,0 +1,13 @@ +class MyClass { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| class MyClass { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| class MyClass { } diff --git a/data/fixtures/scopes/csharp/statement.iteration.block2.scope b/data/fixtures/scopes/csharp/statement.iteration.block2.scope new file mode 100644 index 0000000000..3736f6b85b --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.block2.scope @@ -0,0 +1,13 @@ +void MyFunk() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| void MyFunk() { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| void MyFunk() { } diff --git a/data/fixtures/scopes/csharp/statement.iteration.document.scope b/data/fixtures/scopes/csharp/statement.iteration.document.scope new file mode 100644 index 0000000000..a1948c1fe5 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.document.scope @@ -0,0 +1,18 @@ + +class MyClass {} + +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:0 + > +0| +1| class MyClass {} +2| + < + + +[#2 Range] = +[#2 Domain] = 1:15-1:15 + >< +1| class MyClass {} diff --git a/data/fixtures/scopes/csharp/statement.scope b/data/fixtures/scopes/csharp/statement.scope new file mode 100644 index 0000000000..80a2e8baf9 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.scope @@ -0,0 +1,10 @@ +int value = 2; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| int value = 2; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/string.multiLine.scope b/data/fixtures/scopes/csharp/string.multiLine.scope new file mode 100644 index 0000000000..ad49870e40 --- /dev/null +++ b/data/fixtures/scopes/csharp/string.multiLine.scope @@ -0,0 +1,13 @@ +@"hello +world"; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:6 + >------- +0| @"hello +1| world"; + ------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/string.singleLine.scope b/data/fixtures/scopes/csharp/string.singleLine.scope new file mode 100644 index 0000000000..60e24228a6 --- /dev/null +++ b/data/fixtures/scopes/csharp/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/csharp/textFragment.comment.block.scope b/data/fixtures/scopes/csharp/textFragment.comment.block.scope new file mode 100644 index 0000000000..e84187cf56 --- /dev/null +++ b/data/fixtures/scopes/csharp/textFragment.comment.block.scope @@ -0,0 +1,17 @@ +/* + Hello + World +*/ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:2 + >-- +0| /* +1| Hello +2| World +3| */ + --< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/textFragment.comment.line.scope b/data/fixtures/scopes/csharp/textFragment.comment.line.scope new file mode 100644 index 0000000000..6758f81490 --- /dev/null +++ b/data/fixtures/scopes/csharp/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/csharp/textFragment.string.multiLine.scope b/data/fixtures/scopes/csharp/textFragment.string.multiLine.scope new file mode 100644 index 0000000000..bf3f875972 --- /dev/null +++ b/data/fixtures/scopes/csharp/textFragment.string.multiLine.scope @@ -0,0 +1,13 @@ +@"hello +world"; +--- + +[Content] = +[Removal] = +[Domain] = 0:2-1:5 + >----- +0| @"hello +1| world"; + -----< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/textFragment.string.singleLine.scope b/data/fixtures/scopes/csharp/textFragment.string.singleLine.scope new file mode 100644 index 0000000000..4ea57d25f0 --- /dev/null +++ b/data/fixtures/scopes/csharp/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/csharp/type.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/csharp/type.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..5f46efab43 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.argument.formal.constructor.iteration.scope @@ -0,0 +1,24 @@ +class MyClass { + MyClass(int a, int b) {} +} +--- + +[#1 Range] = +[#1 Domain] = 0:15-2:0 + > +0| class MyClass { +1| MyClass(int a, int b) {} +2| } + < + + +[#2 Range] = +[#2 Domain] = 1:12-1:24 + >------------< +1| MyClass(int a, int b) {} + + +[#3 Range] = +[#3 Domain] = 1:27-1:27 + >< +1| MyClass(int a, int b) {} diff --git a/data/fixtures/scopes/csharp/type.argument.formal.constructor.scope b/data/fixtures/scopes/csharp/type.argument.formal.constructor.scope new file mode 100644 index 0000000000..1709516671 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.argument.formal.constructor.scope @@ -0,0 +1,34 @@ +class MyClass { + MyClass(int a) {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass(int a) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:12-1:15 + >---< +1| MyClass(int a) {} + +[#2 Removal] = 1:12-1:16 + >----< +1| MyClass(int a) {} + +[#2 Trailing delimiter] = 1:15-1:16 + >-< +1| MyClass(int a) {} + +[#2 Domain] = 1:12-1:17 + >-----< +1| MyClass(int a) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/csharp/type.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..9fd010aa96 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.argument.formal.method.iteration.scope @@ -0,0 +1,24 @@ +class MyClass { + void funk(int a, int b) {} +} +--- + +[#1 Range] = +[#1 Domain] = 0:15-2:0 + > +0| class MyClass { +1| void funk(int a, int b) {} +2| } + < + + +[#2 Range] = +[#2 Domain] = 1:14-1:26 + >------------< +1| void funk(int a, int b) {} + + +[#3 Range] = +[#3 Domain] = 1:29-1:29 + >< +1| void funk(int a, int b) {} diff --git a/data/fixtures/scopes/csharp/type.argument.formal.method.scope b/data/fixtures/scopes/csharp/type.argument.formal.method.scope new file mode 100644 index 0000000000..91ac9a42a8 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.argument.formal.method.scope @@ -0,0 +1,57 @@ +class MyClass { + void funk(int a) {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| void funk(int a) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:8 + >----< +1| void funk(int a) {} + +[#2 Removal] = 1:4-1:9 + >-----< +1| void funk(int a) {} + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| void funk(int a) {} + +[#2 Trailing delimiter] = 1:8-1:9 + >-< +1| void funk(int a) {} + +[#2 Domain] = 1:4-1:23 + >-------------------< +1| void funk(int a) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:14-1:17 + >---< +1| void funk(int a) {} + +[#3 Removal] = 1:14-1:18 + >----< +1| void funk(int a) {} + +[#3 Trailing delimiter] = 1:17-1:18 + >-< +1| void funk(int a) {} + +[#3 Domain] = 1:14-1:19 + >-----< +1| void funk(int a) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.cast.scope b/data/fixtures/scopes/csharp/type.cast.scope new file mode 100644 index 0000000000..74cd6e837c --- /dev/null +++ b/data/fixtures/scopes/csharp/type.cast.scope @@ -0,0 +1,16 @@ +(int)5.5; +--- + +[Content] = 0:1-0:4 + >---< +0| (int)5.5; + +[Removal] = 0:0-0:5 + >-----< +0| (int)5.5; + +[Domain] = 0:0-0:8 + >--------< +0| (int)5.5; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.class.scope b/data/fixtures/scopes/csharp/type.class.scope new file mode 100644 index 0000000000..696dd5c641 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.class.scope @@ -0,0 +1,10 @@ +class MyClass { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| class MyClass { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.enum.scope b/data/fixtures/scopes/csharp/type.enum.scope new file mode 100644 index 0000000000..ffa3f8bbb0 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.enum.scope @@ -0,0 +1,10 @@ +enum State { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| enum State { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.field.iteration.scope b/data/fixtures/scopes/csharp/type.field.iteration.scope new file mode 100644 index 0000000000..4eaba49f3c --- /dev/null +++ b/data/fixtures/scopes/csharp/type.field.iteration.scope @@ -0,0 +1,7 @@ +class MyClass { } +--- + +[Range] = +[Domain] = 0:15-0:16 + >-< +0| class MyClass { } diff --git a/data/fixtures/scopes/csharp/type.field.scope b/data/fixtures/scopes/csharp/type.field.scope new file mode 100644 index 0000000000..6228c94197 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.field.scope @@ -0,0 +1,38 @@ +class MyClass { + int value; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| int value; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int value; + +[#2 Removal] = 1:4-1:8 + >----< +1| int value; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int value; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int value; + +[#2 Domain] = 1:4-1:13 + >---------< +1| int value; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.foreach.scope b/data/fixtures/scopes/csharp/type.foreach.scope new file mode 100644 index 0000000000..05dbc70579 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.foreach.scope @@ -0,0 +1,20 @@ +foreach (int value in values) {} +--- + +[Content] = 0:9-0:12 + >---< +0| foreach (int value in values) {} + +[Removal] = 0:9-0:13 + >----< +0| foreach (int value in values) {} + +[Trailing delimiter] = 0:12-0:13 + >-< +0| foreach (int value in values) {} + +[Domain] = 0:0-0:32 + >--------------------------------< +0| foreach (int value in values) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.interface.scope b/data/fixtures/scopes/csharp/type.interface.scope new file mode 100644 index 0000000000..fcc6af440a --- /dev/null +++ b/data/fixtures/scopes/csharp/type.interface.scope @@ -0,0 +1,10 @@ +interface IClass { } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:20 + >--------------------< +0| interface IClass { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.return.scope b/data/fixtures/scopes/csharp/type.return.scope new file mode 100644 index 0000000000..30a50088ad --- /dev/null +++ b/data/fixtures/scopes/csharp/type.return.scope @@ -0,0 +1,20 @@ +int funk() {} +--- + +[Content] = 0:0-0:3 + >---< +0| int funk() {} + +[Removal] = 0:0-0:4 + >----< +0| int funk() {} + +[Trailing delimiter] = 0:3-0:4 + >-< +0| int funk() {} + +[Domain] = 0:0-0:13 + >-------------< +0| int funk() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.typeArgument.iteration.scope b/data/fixtures/scopes/csharp/type.typeArgument.iteration.scope new file mode 100644 index 0000000000..68b192c991 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.typeArgument.iteration.scope @@ -0,0 +1,7 @@ +Dictionary values; +--- + +[Range] = +[Domain] = 0:11-0:22 + >-----------< +0| Dictionary values; diff --git a/data/fixtures/scopes/csharp/type.typeArgument.scope b/data/fixtures/scopes/csharp/type.typeArgument.scope new file mode 100644 index 0000000000..8e2f5622bd --- /dev/null +++ b/data/fixtures/scopes/csharp/type.typeArgument.scope @@ -0,0 +1,29 @@ +List values; +--- + +[#1 Content] = 0:0-0:9 + >---------< +0| List values; + +[#1 Removal] = 0:0-0:10 + >----------< +0| List values; + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| List values; + +[#1 Domain] = 0:0-0:16 + >----------------< +0| List values; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 0:5-0:8 + >---< +0| List values; + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..e7cd07a8e1 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope @@ -0,0 +1,24 @@ +class MyClass { + MyClass(int a = 1, int b = 2) {} +} +--- + +[#1 Range] = +[#1 Domain] = 0:15-2:0 + > +0| class MyClass { +1| MyClass(int a = 1, int b = 2) {} +2| } + < + + +[#2 Range] = +[#2 Domain] = 1:12-1:32 + >--------------------< +1| MyClass(int a = 1, int b = 2) {} + + +[#3 Range] = +[#3 Domain] = 1:35-1:35 + >< +1| MyClass(int a = 1, int b = 2) {} diff --git a/data/fixtures/scopes/csharp/value.argument.formal.constructor.scope b/data/fixtures/scopes/csharp/value.argument.formal.constructor.scope new file mode 100644 index 0000000000..0cb76ed477 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.argument.formal.constructor.scope @@ -0,0 +1,22 @@ +class MyClass { + MyClass(int a = 1) {} +} +--- + +[Content] = 1:20-1:21 + >-< +1| MyClass(int a = 1) {} + +[Removal] = 1:17-1:21 + >----< +1| MyClass(int a = 1) {} + +[Leading delimiter] = 1:17-1:20 + >---< +1| MyClass(int a = 1) {} + +[Domain] = 1:12-1:21 + >---------< +1| MyClass(int a = 1) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope b/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..c96c7e651f --- /dev/null +++ b/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope @@ -0,0 +1,24 @@ +class MyClass { + void funk(int a = 1, int b = 2) {} +} +--- + +[#1 Range] = +[#1 Domain] = 0:15-2:0 + > +0| class MyClass { +1| void funk(int a = 1, int b = 2) {} +2| } + < + + +[#2 Range] = +[#2 Domain] = 1:14-1:34 + >--------------------< +1| void funk(int a = 1, int b = 2) {} + + +[#3 Range] = +[#3 Domain] = 1:37-1:37 + >< +1| void funk(int a = 1, int b = 2) {} diff --git a/data/fixtures/scopes/csharp/value.argument.formal.method.scope b/data/fixtures/scopes/csharp/value.argument.formal.method.scope new file mode 100644 index 0000000000..bdff558cb2 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.argument.formal.method.scope @@ -0,0 +1,22 @@ +class MyClass { + void funk(int a = 1) {} +} +--- + +[Content] = 1:22-1:23 + >-< +1| void funk(int a = 1) {} + +[Removal] = 1:19-1:23 + >----< +1| void funk(int a = 1) {} + +[Leading delimiter] = 1:19-1:22 + >---< +1| void funk(int a = 1) {} + +[Domain] = 1:14-1:23 + >---------< +1| void funk(int a = 1) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.field.scope b/data/fixtures/scopes/csharp/value.field.scope new file mode 100644 index 0000000000..80a7d73d2f --- /dev/null +++ b/data/fixtures/scopes/csharp/value.field.scope @@ -0,0 +1,22 @@ +class MyClass { + int value = 2; +} +--- + +[Content] = 1:16-1:17 + >-< +1| int value = 2; + +[Removal] = 1:13-1:17 + >----< +1| int value = 2; + +[Leading delimiter] = 1:13-1:16 + >---< +1| int value = 2; + +[Domain] = 1:4-1:17 + >-------------< +1| int value = 2; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.foreach.scope b/data/fixtures/scopes/csharp/value.foreach.scope new file mode 100644 index 0000000000..1894ca1a2f --- /dev/null +++ b/data/fixtures/scopes/csharp/value.foreach.scope @@ -0,0 +1,20 @@ +foreach (int value in values) {} +--- + +[Content] = 0:22-0:28 + >------< +0| foreach (int value in values) {} + +[Removal] = 0:21-0:28 + >-------< +0| foreach (int value in values) {} + +[Leading delimiter] = 0:21-0:22 + >-< +0| foreach (int value in values) {} + +[Domain] = 0:0-0:32 + >--------------------------------< +0| foreach (int value in values) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.return.lambda.scope b/data/fixtures/scopes/csharp/value.return.lambda.scope new file mode 100644 index 0000000000..0d759fd8d3 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.return.lambda.scope @@ -0,0 +1,20 @@ +() => 2; +--- + +[Content] = 0:6-0:7 + >-< +0| () => 2; + +[Removal] = 0:5-0:7 + >--< +0| () => 2; + +[Leading delimiter] = 0:5-0:6 + >-< +0| () => 2; + +[Domain] = 0:0-0:7 + >-------< +0| () => 2; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.return.lambda2.scope b/data/fixtures/scopes/csharp/value.return.lambda2.scope new file mode 100644 index 0000000000..5dc35f18ef --- /dev/null +++ b/data/fixtures/scopes/csharp/value.return.lambda2.scope @@ -0,0 +1,22 @@ +() => { + return 2; +}; +--- + +[Content] = 1:11-1:12 + >-< +1| return 2; + +[Removal] = 1:10-1:12 + >--< +1| return 2; + +[Leading delimiter] = 1:10-1:11 + >-< +1| return 2; + +[Domain] = 1:4-1:13 + >---------< +1| return 2; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.return.scope b/data/fixtures/scopes/csharp/value.return.scope new file mode 100644 index 0000000000..77155463c2 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.return.scope @@ -0,0 +1,22 @@ +int funk() { + return 2; +} +--- + +[Content] = 1:11-1:12 + >-< +1| return 2; + +[Removal] = 1:10-1:12 + >--< +1| return 2; + +[Leading delimiter] = 1:10-1:11 + >-< +1| return 2; + +[Domain] = 1:4-1:13 + >---------< +1| return 2; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.yield.scope b/data/fixtures/scopes/csharp/value.yield.scope new file mode 100644 index 0000000000..caef32a3cf --- /dev/null +++ b/data/fixtures/scopes/csharp/value.yield.scope @@ -0,0 +1,22 @@ +IEnumerable funk() { + yield return 2; +} +--- + +[Content] = 1:17-1:18 + >-< +1| yield return 2; + +[Removal] = 1:16-1:18 + >--< +1| yield return 2; + +[Leading delimiter] = 1:16-1:17 + >-< +1| yield return 2; + +[Domain] = 1:4-1:19 + >---------------< +1| yield return 2; + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 29754f67fa..fd995bd186 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -1,10 +1,9 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported, notApplicable } = ScopeSupportFacetLevel; +const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const csharpScopeSupport: LanguageScopeSupportFacetMap = { - ifStatement: supported, switchStatementSubject: supported, anonymousFunction: supported, map: supported, @@ -20,6 +19,9 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "className.iteration.document": supported, "className.iteration.block": supported, + "comment.line": supported, + "comment.block": supported, + functionCall: supported, "functionCall.constructor": supported, functionCallee: supported, @@ -52,21 +54,56 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "condition.ternary": supported, "condition.switchCase.iteration": supported, - "name.variable": supported, - "name.assignment": supported, - "name.argument.formal": supported, + "name.argument.formal.constructor": supported, + "name.argument.formal.constructor.iteration": supported, "name.argument.formal.iteration": supported, + "name.argument.formal.method": supported, + "name.argument.formal.method.iteration": supported, + "name.argument.formal": supported, + "name.assignment": supported, + "name.class": supported, + "name.constructor": supported, + "name.field": supported, + "name.foreach": supported, + "name.function": supported, + "name.iteration.block": supported, + "name.iteration.document": supported, + "name.method": supported, + "name.variable": supported, - "value.variable": supported, + "value.argument.formal.constructor": supported, + "value.argument.formal.constructor.iteration": supported, + "value.argument.formal.iteration": supported, + "value.argument.formal.method": supported, + "value.argument.formal.method.iteration": supported, + "value.argument.formal": supported, "value.assignment": supported, + "value.field": supported, + "value.foreach": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, - "value.argument.formal": supported, - "value.argument.formal.iteration": supported, + "value.return.lambda": supported, + "value.return": supported, + "value.variable": supported, + "value.yield": supported, - "type.variable": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, + "type.argument.formal.method": supported, + "type.argument.formal.method.iteration": supported, + "type.argument.formal.constructor": supported, + "type.argument.formal.constructor.iteration": supported, + "type.cast": supported, + "type.class": supported, + "type.foreach": supported, + "type.field": supported, + "type.field.iteration": supported, + "type.interface": supported, + "type.enum": supported, + "type.return": supported, + "type.variable": supported, + "type.typeArgument": supported, + "type.typeArgument.iteration": supported, "key.mapPair": supported, "key.mapPair.iteration": supported, @@ -87,23 +124,76 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.iteration": supported, "argument.formal": supported, "argument.formal.iteration": supported, + "argument.formal.lambda": supported, + "argument.formal.lambda.iteration": supported, "argument.formal.constructor": supported, "argument.formal.constructor.iteration": supported, "argument.formal.method": supported, "argument.formal.method.iteration": supported, + ifStatement: supported, + statement: supported, + "statement.class": supported, + "statement.iteration.block": supported, + "statement.iteration.document": supported, + + "string.singleLine": supported, + "string.multiLine": supported, + + "textFragment.string.singleLine": supported, + "textFragment.string.multiLine": supported, + "textFragment.comment.line": supported, + "textFragment.comment.block": supported, + + // Unsupported + + "interior.class": unsupported, + "interior.function": unsupported, + "interior.if": unsupported, + "interior.lambda": unsupported, + "interior.loop": unsupported, + "interior.switchCase": unsupported, + "interior.ternary": unsupported, + "interior.try": unsupported, + // Not applicable + "collectionItem.unenclosed.iteration": notApplicable, + "collectionItem.unenclosed": notApplicable, + "functionName.iteration.block": notApplicable, + "functionName.iteration.document": notApplicable, + "interior.cell": notApplicable, + "interior.command": notApplicable, "interior.element": notApplicable, + "interior.resource": notApplicable, "key.attribute": notApplicable, + "name.argument.actual.iteration": notApplicable, + "name.argument.actual": notApplicable, + "name.assignment.pattern": notApplicable, + "name.resource.iteration": notApplicable, + "name.resource": notApplicable, + "name.variable.pattern": notApplicable, + "namedFunction.iteration.block": notApplicable, + "namedFunction.iteration.document": notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, "textFragment.element": notApplicable, + "type.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.alias": notApplicable, + "value.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.attribute": notApplicable, + "value.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.typeAlias": notApplicable, + "value.variable.pattern": notApplicable, command: notApplicable, element: notApplicable, endTag: notApplicable, environment: notApplicable, notebookCell: notApplicable, + pairDelimiter: notApplicable, regularExpression: notApplicable, section: notApplicable, startTag: notApplicable, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts index b91b10517f..ee6017954b 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/delimiterMaps.ts @@ -73,6 +73,13 @@ const delimiterToTextOverrides: Record> = { ruby: { tripleDoubleQuotes: ["%Q(", ")"], }, + + csharp: { + doubleQuotes: [ + ['@"', '"'], + ['"', '"'], + ], + }, }; export const leftToRightMap: Record = Object.fromEntries( diff --git a/queries/csharp.scm b/queries/csharp.scm index ceb1bf913d..d739eb687b 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -50,6 +50,18 @@ (if_statement) @ifStatement +( + (compilation_unit) @statement.iteration @name.iteration + (#document-range! @statement.iteration @name.iteration) +) + +(_ + body: (_ + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf + ) +) + ;;!! if () {} ;;! ^^^^^^^^ ( @@ -110,6 +122,13 @@ (do_statement) ] @branch +;;!! foreach (int value in values) {} +;;! ^^^^^ +(for_each_statement + left: (_) @name + right: (_) @value +) @_.domain + ;;!! true ? 0 : 1; ;;! ^^^^ ;;! ^ ^ @@ -121,9 +140,11 @@ alternative: (_) @branch ) @condition.domain +;;!! class Foo {} +;;! ^^^^^^^^^^^^ (class_declaration name: (identifier) @className -) @class @_.domain +) @class @type @_.domain ( (compilation_unit) @class.iteration @className.iteration @@ -142,15 +163,46 @@ ) ) +;;!! "Hello world" ( (string_literal) @string @textFragment (#child-range! @textFragment 0 -1 true true) ) +;;!! @"Hello world" +( + (verbatim_string_literal) @string @textFragment + (#character-range! @textFragment 2 -1) +) + +;;!! // Hello world (comment) @comment @textFragment +;;!! () => {}; +;;! ^^^^^^^^ (lambda_expression) @anonymousFunction +;;!! () => 2; +;;! ^ +(lambda_expression + body: (_) @value + (#not-type? @value block) +) @_.domain + +;;!! return 2; +;;! ^ +(return_statement + (_) @value +) @_.domain + +;;!! yield return 2; +;;! ^ +(yield_statement + (_) @value +) @_.domain + +;;!! [Obsolete("Deprecated")] +;;! ^^^^^^^^^^^^^^^^^^^^^^ (attribute) @attribute [ @@ -175,6 +227,7 @@ ) ) +;;!! void foo() {} [ (invocation_expression) (object_creation_expression) @@ -310,10 +363,44 @@ name: (_) @name ) @_.domain -(_ +( + (_ + type: (_) @type + ) @_.domain + (#not-type? @_.domain cast_expression) +) + +;;!! (int)5.5; +;;! ^^^ +(cast_expression + "(" @type.removal.start type: (_) @type + ")" @type.removal.end ) @_.domain +;;!! enum Foo {} +;;!! interface IFoo {} +[ + (enum_declaration) + (interface_declaration) +] @type + +;; Dictionary values; +;;! ^^^^^^ ^^^ +(type_argument_list + (_)? @_.leading.endOf + . + (_) @type + . + (_)? @_.trailing.startOf + (#insertion-delimiter! @type ", ") +) + +(type_argument_list + "<" @type.iteration.start.endOf + ">" @type.iteration.end.startOf +) + ;;!! int value = 5 ;;! ^ (parameter diff --git a/queries/java.scm b/queries/java.scm index 5fae385b9d..c898bcfbcc 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -60,27 +60,21 @@ ;;!! class MyClass { } ;;! ^ (class_body - . "{" @class.iteration.start.endOf @className.iteration.start.endOf "}" @class.iteration.end.startOf @className.iteration.end.startOf - . ) (class_body - . "{" @type.iteration.start.endOf @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf "}" @type.iteration.end.startOf @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf - . ) ;;!! for (...) { } ;;! ^ (_ body: (_ - . "{" @name.iteration.start.endOf @statement.iteration.start.endOf "}" @name.iteration.end.startOf @statement.iteration.end.startOf - . ) ) @@ -88,10 +82,8 @@ ;;! ^ (if_statement (block - . "{" @name.iteration.start.endOf @statement.iteration.start.endOf "}" @name.iteration.end.startOf @statement.iteration.end.startOf - . ) ) @@ -300,10 +292,8 @@ ;;!! void myFunk(int value) {} ;;! ^^^^^^^^^ (formal_parameters - . "(" @type.iteration.start.endOf @name.iteration.start.endOf ")" @type.iteration.end.startOf @name.iteration.end.startOf - . ) @type.iteration.domain @name.iteration.domain ;;!! List list = value; @@ -495,10 +485,8 @@ ;;!! Map foo; ;;! ^^^^^^^^ (type_arguments - . "<" @type.iteration.start.endOf ">" @type.iteration.end.startOf - . ) ;;!! foo(name: string) {} diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 2d016e475e..316263a0ea 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -432,10 +432,8 @@ ;;! *** (_ body: (_ - . "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf - . ) ) diff --git a/queries/javascript.function.scm b/queries/javascript.function.scm index 7a274bfcac..831d1dc155 100644 --- a/queries/javascript.function.scm +++ b/queries/javascript.function.scm @@ -171,10 +171,8 @@ ] @namedFunction.iteration @functionName.iteration (class_body - . "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf - . ) ;;!! { funk: function() { } } diff --git a/queries/kotlin.scm b/queries/kotlin.scm index 60b48b1087..582be892f3 100644 --- a/queries/kotlin.scm +++ b/queries/kotlin.scm @@ -102,8 +102,7 @@ ( "else" (control_structure_body) @branch.removal.end.startOf - ) -? + )? ) ;; Else-if branch @@ -384,10 +383,8 @@ (type_projection) @type ) (type_arguments - . "<" @type.iteration.start.endOf ">" @type.iteration.end.startOf - . ) (anonymous_function diff --git a/queries/python.scm b/queries/python.scm index 3783d2d2a9..cf28622272 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -118,10 +118,8 @@ ;;! ------------- (generic_type (type_parameter - . "[" @type.iteration.start.endOf "]" @type.iteration.end.startOf - . ) ) diff --git a/queries/scss.scm b/queries/scss.scm index 5673d1cbb9..53d624ecc2 100644 --- a/queries/scss.scm +++ b/queries/scss.scm @@ -67,18 +67,14 @@ (_ (parameters - . "(" @argumentOrParameter.iteration.start.endOf ")" @argumentOrParameter.iteration.end.startOf - . ) ) @argumentOrParameter.iteration.domain (parameters - . "(" @name.iteration.start.endOf @value.iteration.start.endOf ")" @name.iteration.end.startOf @value.iteration.end.startOf - . ) @name.iteration.domain @value.iteration.domain ;;!! foo($foo: 123) @@ -97,10 +93,8 @@ ) (block - . "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf - . ) (binary_expression diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index 58ddad21f9..2b792cd352 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -427,8 +427,6 @@ ;;!! class Aaa { } ;;! ^ (class_body - . "{" @type.iteration.start.endOf "}" @type.iteration.end.startOf - . )