diff --git a/data/fixtures/recorded/languages/talon/clearEveryValue5.yml b/data/fixtures/recorded/languages/talon/clearEveryValue5.yml index 0d31e31872..9c84c79d86 100644 --- a/data/fixtures/recorded/languages/talon/clearEveryValue5.yml +++ b/data/fixtures/recorded/languages/talon/clearEveryValue5.yml @@ -23,11 +23,9 @@ initialState: finalState: documentContents: |- foo: - + bar = 1 baz: selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} - anchor: {line: 3, character: 5} active: {line: 3, character: 5} diff --git a/data/fixtures/scopes/c/class.scope b/data/fixtures/scopes/c/class.scope index d851092048..ff77f6ac3b 100644 --- a/data/fixtures/scopes/c/class.scope +++ b/data/fixtures/scopes/c/class.scope @@ -1,33 +1,10 @@ -struct aaa { int bbb; }; - -typedef struct { int fff; } ggg; +struct Foo {}; --- -[#1 Content] = -[#1 Domain] = 0:0-0:24 - >------------------------< -0| struct aaa { int bbb; }; - -[#1 Removal] = 0:0-2:0 - >------------------------ -0| struct aaa { int bbb; }; -1| -2| typedef struct { int fff; } ggg; - < - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 2:0-2:32 - >--------------------------------< -2| typedef struct { int fff; } ggg; - -[#2 Removal] = 0:24-2:32 - > -0| struct aaa { int bbb; }; -1| -2| typedef struct { int fff; } ggg; - --------------------------------< +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| struct Foo {}; -[#2 Insertion delimiter] = "\n\n" +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/class2.scope b/data/fixtures/scopes/c/class2.scope index bc5988ab0c..18694d5397 100644 --- a/data/fixtures/scopes/c/class2.scope +++ b/data/fixtures/scopes/c/class2.scope @@ -1,33 +1,10 @@ -union bbb { int ccc; }; - -typedef union { int hhh; } iii; +union Foo {}; --- -[#1 Content] = -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| union bbb { int ccc; }; - -[#1 Removal] = 0:0-2:0 - >----------------------- -0| union bbb { int ccc; }; -1| -2| typedef union { int hhh; } iii; - < - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 2:0-2:31 - >-------------------------------< -2| typedef union { int hhh; } iii; - -[#2 Removal] = 0:23-2:31 - > -0| union bbb { int ccc; }; -1| -2| typedef union { int hhh; } iii; - -------------------------------< +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| union Foo {}; -[#2 Insertion delimiter] = "\n\n" +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/class3.scope b/data/fixtures/scopes/c/class3.scope index 682ccd1e92..bbf9d41bb3 100644 --- a/data/fixtures/scopes/c/class3.scope +++ b/data/fixtures/scopes/c/class3.scope @@ -1,33 +1,10 @@ -enum ccc { ddd, eee }; - -typedef enum { jjj, kkk } lll; +enum Foo {}; --- -[#1 Content] = -[#1 Domain] = 0:0-0:22 - >----------------------< -0| enum ccc { ddd, eee }; - -[#1 Removal] = 0:0-2:0 - >---------------------- -0| enum ccc { ddd, eee }; -1| -2| typedef enum { jjj, kkk } lll; - < - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 2:0-2:30 - >------------------------------< -2| typedef enum { jjj, kkk } lll; - -[#2 Removal] = 0:22-2:30 - > -0| enum ccc { ddd, eee }; -1| -2| typedef enum { jjj, kkk } lll; - ------------------------------< +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| enum Foo {}; -[#2 Insertion delimiter] = "\n\n" +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/class4.scope b/data/fixtures/scopes/c/class4.scope new file mode 100644 index 0000000000..f5372dbb21 --- /dev/null +++ b/data/fixtures/scopes/c/class4.scope @@ -0,0 +1,10 @@ +typedef struct { } Foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:23 + >-----------------------< +0| typedef struct { } Foo; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/class5.scope b/data/fixtures/scopes/c/class5.scope new file mode 100644 index 0000000000..2d7678d839 --- /dev/null +++ b/data/fixtures/scopes/c/class5.scope @@ -0,0 +1,10 @@ +typedef union { } Foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:22 + >----------------------< +0| typedef union { } Foo; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/class6.scope b/data/fixtures/scopes/c/class6.scope new file mode 100644 index 0000000000..08ce54b930 --- /dev/null +++ b/data/fixtures/scopes/c/class6.scope @@ -0,0 +1,10 @@ +typedef enum { } Foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| typedef enum { } Foo; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/c/name.iteration.class.scope b/data/fixtures/scopes/c/name.iteration.class.scope new file mode 100644 index 0000000000..91fb39ebc7 --- /dev/null +++ b/data/fixtures/scopes/c/name.iteration.class.scope @@ -0,0 +1,24 @@ +struct Foo { }; + +typedef struct { } Bar; +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:23 + >--------------- +0| struct Foo { }; +1| +2| typedef struct { } Bar; + -----------------------< + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| struct Foo { }; + + +[#3 Range] = +[#3 Domain] = 2:16-2:17 + >-< +2| typedef struct { } Bar; diff --git a/data/fixtures/scopes/c/name.iteration.class2.scope b/data/fixtures/scopes/c/name.iteration.class2.scope new file mode 100644 index 0000000000..af4e4e8adf --- /dev/null +++ b/data/fixtures/scopes/c/name.iteration.class2.scope @@ -0,0 +1,24 @@ +union Foo { }; + +typedef union { } Bar; +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:22 + >-------------- +0| union Foo { }; +1| +2| typedef union { } Bar; + ----------------------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| union Foo { }; + + +[#3 Range] = +[#3 Domain] = 2:15-2:16 + >-< +2| typedef union { } Bar; diff --git a/data/fixtures/scopes/c/value.iteration.block.scope b/data/fixtures/scopes/c/value.iteration.block.scope new file mode 100644 index 0000000000..95df2cd3c4 --- /dev/null +++ b/data/fixtures/scopes/c/value.iteration.block.scope @@ -0,0 +1,13 @@ +if (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| if (true) { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } diff --git a/data/fixtures/scopes/c/value.iteration.block2.scope b/data/fixtures/scopes/c/value.iteration.block2.scope new file mode 100644 index 0000000000..dd07df8311 --- /dev/null +++ b/data/fixtures/scopes/c/value.iteration.block2.scope @@ -0,0 +1,13 @@ +void foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| void foo() { } + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| void foo() { } diff --git a/data/fixtures/scopes/c/value.iteration.class.scope b/data/fixtures/scopes/c/value.iteration.class.scope new file mode 100644 index 0000000000..91fb39ebc7 --- /dev/null +++ b/data/fixtures/scopes/c/value.iteration.class.scope @@ -0,0 +1,24 @@ +struct Foo { }; + +typedef struct { } Bar; +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:23 + >--------------- +0| struct Foo { }; +1| +2| typedef struct { } Bar; + -----------------------< + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| struct Foo { }; + + +[#3 Range] = +[#3 Domain] = 2:16-2:17 + >-< +2| typedef struct { } Bar; diff --git a/data/fixtures/scopes/c/value.iteration.class2.scope b/data/fixtures/scopes/c/value.iteration.class2.scope new file mode 100644 index 0000000000..af4e4e8adf --- /dev/null +++ b/data/fixtures/scopes/c/value.iteration.class2.scope @@ -0,0 +1,24 @@ +union Foo { }; + +typedef union { } Bar; +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:22 + >-------------- +0| union Foo { }; +1| +2| typedef union { } Bar; + ----------------------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| union Foo { }; + + +[#3 Range] = +[#3 Domain] = 2:15-2:16 + >-< +2| typedef union { } Bar; diff --git a/data/fixtures/scopes/c/value.iteration.document.scope b/data/fixtures/scopes/c/value.iteration.document.scope new file mode 100644 index 0000000000..3e0daecfa3 --- /dev/null +++ b/data/fixtures/scopes/c/value.iteration.document.scope @@ -0,0 +1,12 @@ + +int foo; + +--- + +[Range] = +[Domain] = 0:0-2:0 + > +0| +1| int foo; +2| + < diff --git a/data/fixtures/scopes/cpp/class.scope b/data/fixtures/scopes/cpp/class.scope index c0d93c7ae9..9ffdb1c0de 100644 --- a/data/fixtures/scopes/cpp/class.scope +++ b/data/fixtures/scopes/cpp/class.scope @@ -1,30 +1,10 @@ -class aaa { int bbb; }; -enum class ccc { ddd, eee }; +class Foo {}; --- -[#1 Content] = -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| class aaa { int bbb; }; +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| class Foo {}; -[#1 Removal] = 0:0-1:0 - >----------------------- -0| class aaa { int bbb; }; -1| enum class ccc { ddd, eee }; - < - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 1:0-1:28 - >----------------------------< -1| enum class ccc { ddd, eee }; - -[#2 Removal] = 0:23-1:28 - > -0| class aaa { int bbb; }; -1| enum class ccc { ddd, eee }; - ----------------------------< - -[#2 Insertion delimiter] = "\n\n" +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/cpp/class2.scope b/data/fixtures/scopes/cpp/class2.scope new file mode 100644 index 0000000000..90124d73e3 --- /dev/null +++ b/data/fixtures/scopes/cpp/class2.scope @@ -0,0 +1,10 @@ +enum class Foo {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| enum class Foo {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/cpp/name.iteration.class.scope b/data/fixtures/scopes/cpp/name.iteration.class.scope new file mode 100644 index 0000000000..b79d7b395c --- /dev/null +++ b/data/fixtures/scopes/cpp/name.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { }; +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| class Foo { }; + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { }; diff --git a/data/fixtures/scopes/cpp/value.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/cpp/value.argument.formal.constructor.iteration.scope index 48cc8810d5..9d6f2a4747 100644 --- a/data/fixtures/scopes/cpp/value.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/cpp/value.argument.formal.constructor.iteration.scope @@ -4,7 +4,16 @@ class MyClass { --- [#1 Range] = -[#1 Domain] = 0:15-2:0 +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass(int aaa, int bbb = 2) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| MyClass(int aaa, int bbb = 2) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:12-1:32 +[#3 Range] = +[#3 Domain] = 1:12-1:32 >--------------------< 1| MyClass(int aaa, int bbb = 2) {} diff --git a/data/fixtures/scopes/cpp/value.argument.formal.iteration.scope b/data/fixtures/scopes/cpp/value.argument.formal.iteration.scope index c42713d2a2..c4e65a1da0 100644 --- a/data/fixtures/scopes/cpp/value.argument.formal.iteration.scope +++ b/data/fixtures/scopes/cpp/value.argument.formal.iteration.scope @@ -1,7 +1,13 @@ void aaa(int bbb = 0, int ccc = 0) {} --- -[Range] = -[Domain] = 0:9-0:33 +[#1 Range] = +[#1 Domain] = 0:0-0:37 + >-------------------------------------< +0| void aaa(int bbb = 0, int ccc = 0) {} + + +[#2 Range] = +[#2 Domain] = 0:9-0:33 >------------------------< 0| void aaa(int bbb = 0, int ccc = 0) {} diff --git a/data/fixtures/scopes/cpp/value.argument.formal.method.iteration.scope b/data/fixtures/scopes/cpp/value.argument.formal.method.iteration.scope index d6a6f3aaba..f103bb7282 100644 --- a/data/fixtures/scopes/cpp/value.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/cpp/value.argument.formal.method.iteration.scope @@ -4,7 +4,16 @@ class MyClass { --- [#1 Range] = -[#1 Domain] = 0:15-2:0 +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| void foo(int aaa, int bbb = 2) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| void foo(int aaa, int bbb = 2) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:13-1:33 +[#3 Range] = +[#3 Domain] = 1:13-1:33 >--------------------< 1| void foo(int aaa, int bbb = 2) {} diff --git a/data/fixtures/scopes/cpp/value.iteration.class.scope b/data/fixtures/scopes/cpp/value.iteration.class.scope new file mode 100644 index 0000000000..b79d7b395c --- /dev/null +++ b/data/fixtures/scopes/cpp/value.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { }; +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| class Foo { }; + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { }; diff --git a/data/fixtures/scopes/csharp/interior.lambda.block.scope b/data/fixtures/scopes/csharp/interior.lambda.block.scope index ef5ef5acf1..1d94e214a0 100644 --- a/data/fixtures/scopes/csharp/interior.lambda.block.scope +++ b/data/fixtures/scopes/csharp/interior.lambda.block.scope @@ -1,37 +1,43 @@ -() => { }; +() => { foo; }; --- [#1 Content] = [#1 Removal] = 0:1-0:1 >< -0| () => { }; +0| () => { foo; }; [#1 Domain] = 0:0-0:2 >--< -0| () => { }; +0| () => { foo; }; [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 0:7-0:8 - >-< -0| () => { }; +[#2 Content] = 0:8-0:12 + >----< +0| () => { foo; }; -[#2 Domain] = 0:0-0:9 - >---------< -0| () => { }; +[#2 Removal] = 0:7-0:13 + >------< +0| () => { foo; }; + +[#2 Domain] = 0:0-0:14 + >--------------< +0| () => { foo; }; [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Removal] = 0:7-0:8 - >-< -0| () => { }; +[#3 Content] = 0:8-0:12 + >----< +0| () => { foo; }; + +[#3 Removal] = 0:7-0:13 + >------< +0| () => { foo; }; -[#3 Domain] = 0:6-0:9 - >---< -0| () => { }; +[#3 Domain] = 0:6-0:14 + >--------< +0| () => { foo; }; [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior.while.scope b/data/fixtures/scopes/csharp/interior.while.scope index 0fe48d4d34..3e16181107 100644 --- a/data/fixtures/scopes/csharp/interior.while.scope +++ b/data/fixtures/scopes/csharp/interior.while.scope @@ -2,24 +2,36 @@ while (true) { } --- [#1 Content] = -[#1 Removal] = 0:7-0:11 - >----< +[#1 Removal] = 0:14-0:15 + >-< 0| while (true) { } -[#1 Domain] = 0:6-0:12 - >------< +[#1 Domain] = 0:0-0:16 + >----------------< 0| while (true) { } [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:14-0:15 +[#2 Removal] = 0:7-0:11 + >----< +0| while (true) { } + +[#2 Domain] = 0:6-0:12 + >------< +0| while (true) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = 0:14-0:15 >-< 0| while (true) { } -[#2 Domain] = 0:13-0:16 +[#3 Domain] = 0:13-0:16 >---< 0| while (true) { } -[#2 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.iteration.block.scope b/data/fixtures/scopes/csharp/name.iteration.block.scope index a9bd7ec26f..cf58c9ddb6 100644 --- a/data/fixtures/scopes/csharp/name.iteration.block.scope +++ b/data/fixtures/scopes/csharp/name.iteration.block.scope @@ -1,13 +1,27 @@ -class MyClass { } +class Foo { + bar() { } +} --- [#1 Range] = -[#1 Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| bar() { } +2| } + -< [#2 Range] = -[#2 Domain] = 0:15-0:16 - >-< -0| class MyClass { } +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| bar() { } +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:11-1:12 + >-< +1| bar() { } diff --git a/data/fixtures/scopes/csharp/name.iteration.block2.scope b/data/fixtures/scopes/csharp/name.iteration.block2.scope index 3736f6b85b..ebc8bdb16c 100644 --- a/data/fixtures/scopes/csharp/name.iteration.block2.scope +++ b/data/fixtures/scopes/csharp/name.iteration.block2.scope @@ -1,13 +1,13 @@ -void MyFunk() { } +void Foo() { } --- [#1 Range] = -[#1 Domain] = 0:0-0:17 - >-----------------< -0| void MyFunk() { } +[#1 Domain] = 0:0-0:14 + >--------------< +0| void Foo() { } [#2 Range] = -[#2 Domain] = 0:15-0:16 - >-< -0| void MyFunk() { } +[#2 Domain] = 0:12-0:13 + >-< +0| void Foo() { } diff --git a/data/fixtures/scopes/csharp/name.iteration.block3.scope b/data/fixtures/scopes/csharp/name.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/csharp/name.iteration.block4.scope b/data/fixtures/scopes/csharp/name.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/csharp/name.iteration.class.scope b/data/fixtures/scopes/csharp/name.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/csharp/statement.iteration.block.scope b/data/fixtures/scopes/csharp/statement.iteration.block.scope index a9bd7ec26f..cf58c9ddb6 100644 --- a/data/fixtures/scopes/csharp/statement.iteration.block.scope +++ b/data/fixtures/scopes/csharp/statement.iteration.block.scope @@ -1,13 +1,27 @@ -class MyClass { } +class Foo { + bar() { } +} --- [#1 Range] = -[#1 Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| bar() { } +2| } + -< [#2 Range] = -[#2 Domain] = 0:15-0:16 - >-< -0| class MyClass { } +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| bar() { } +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:11-1:12 + >-< +1| bar() { } diff --git a/data/fixtures/scopes/csharp/statement.iteration.block2.scope b/data/fixtures/scopes/csharp/statement.iteration.block2.scope index 3736f6b85b..ebc8bdb16c 100644 --- a/data/fixtures/scopes/csharp/statement.iteration.block2.scope +++ b/data/fixtures/scopes/csharp/statement.iteration.block2.scope @@ -1,13 +1,13 @@ -void MyFunk() { } +void Foo() { } --- [#1 Range] = -[#1 Domain] = 0:0-0:17 - >-----------------< -0| void MyFunk() { } +[#1 Domain] = 0:0-0:14 + >--------------< +0| void Foo() { } [#2 Range] = -[#2 Domain] = 0:15-0:16 - >-< -0| void MyFunk() { } +[#2 Domain] = 0:12-0:13 + >-< +0| void Foo() { } diff --git a/data/fixtures/scopes/csharp/statement.iteration.block3.scope b/data/fixtures/scopes/csharp/statement.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/csharp/statement.iteration.block4.scope b/data/fixtures/scopes/csharp/statement.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope index 089441dbd5..0e24f0f8a3 100644 --- a/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/csharp/value.argument.formal.constructor.iteration.scope @@ -4,7 +4,16 @@ class MyClass { --- [#1 Range] = -[#1 Domain] = 0:15-2:0 +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| MyClass(int a = 1, int b = 2) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| MyClass(int a = 1, int b = 2) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:12-1:32 +[#3 Range] = +[#3 Domain] = 1:12-1:32 >--------------------< 1| MyClass(int a = 1, int b = 2) {} diff --git a/data/fixtures/scopes/csharp/value.argument.formal.iteration.scope b/data/fixtures/scopes/csharp/value.argument.formal.iteration.scope index 963f3d58ac..a3e25dc344 100644 --- a/data/fixtures/scopes/csharp/value.argument.formal.iteration.scope +++ b/data/fixtures/scopes/csharp/value.argument.formal.iteration.scope @@ -1,7 +1,13 @@ void myFunk(String name, int value = 5) {} --- -[Range] = -[Domain] = 0:12-0:38 +[#1 Range] = +[#1 Domain] = 0:0-0:42 + >------------------------------------------< +0| void myFunk(String name, int value = 5) {} + + +[#2 Range] = +[#2 Domain] = 0:12-0:38 >--------------------------< 0| void myFunk(String name, int value = 5) {} diff --git a/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope b/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope index ee8e38be0c..ea72c107b5 100644 --- a/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/csharp/value.argument.formal.method.iteration.scope @@ -4,7 +4,16 @@ class MyClass { --- [#1 Range] = -[#1 Domain] = 0:15-2:0 +[#1 Domain] = 0:0-2:1 + >--------------- +0| class MyClass { +1| void funk(int a = 1, int b = 2) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| void funk(int a = 1, int b = 2) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:14-1:34 +[#3 Range] = +[#3 Domain] = 1:14-1:34 >--------------------< 1| void funk(int a = 1, int b = 2) {} diff --git a/data/fixtures/scopes/csharp/value.iteration.block.scope b/data/fixtures/scopes/csharp/value.iteration.block.scope new file mode 100644 index 0000000000..cf58c9ddb6 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.block.scope @@ -0,0 +1,27 @@ +class Foo { + bar() { } +} +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| bar() { } +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| bar() { } +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:11-1:12 + >-< +1| bar() { } diff --git a/data/fixtures/scopes/csharp/value.iteration.block2.scope b/data/fixtures/scopes/csharp/value.iteration.block2.scope new file mode 100644 index 0000000000..ebc8bdb16c --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.block2.scope @@ -0,0 +1,13 @@ +void Foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| void Foo() { } + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| void Foo() { } diff --git a/data/fixtures/scopes/csharp/value.iteration.block3.scope b/data/fixtures/scopes/csharp/value.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/csharp/value.iteration.block4.scope b/data/fixtures/scopes/csharp/value.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/csharp/value.iteration.class.scope b/data/fixtures/scopes/csharp/value.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/csharp/value.iteration.document.scope b/data/fixtures/scopes/csharp/value.iteration.document.scope new file mode 100644 index 0000000000..4da6d738ac --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.document.scope @@ -0,0 +1,18 @@ + +class Foo { } + +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:0 + > +0| +1| class Foo { } +2| + < + + +[#2 Range] = +[#2 Domain] = 1:11-1:12 + >-< +1| class Foo { } diff --git a/data/fixtures/scopes/csharp/value.mapPair.iteration.scope b/data/fixtures/scopes/csharp/value.mapPair.iteration.scope index 96c73a63fe..4a0fca1c7d 100644 --- a/data/fixtures/scopes/csharp/value.mapPair.iteration.scope +++ b/data/fixtures/scopes/csharp/value.mapPair.iteration.scope @@ -3,8 +3,17 @@ new StudentName { }; --- -[Range] = -[Domain] = 0:17-2:0 +[#1 Range] = +[#1 Domain] = 0:0-2:2 + >----------------- +0| new StudentName { +1| FirstName = "Craig" +2| }; + --< + + +[#2 Range] = +[#2 Domain] = 0:17-2:0 > 0| new StudentName { 1| FirstName = "Craig" diff --git a/data/fixtures/scopes/java/name.iteration.block.scope b/data/fixtures/scopes/java/name.iteration.block.scope index e5ad7fb760..4d4bdd63b9 100644 --- a/data/fixtures/scopes/java/name.iteration.block.scope +++ b/data/fixtures/scopes/java/name.iteration.block.scope @@ -1,42 +1,27 @@ -public class MyClass { - public void myFunk() { - if (true) { } - } +class Foo { + void bar() { } } --- [#1 Range] = -[#1 Domain] = 0:0-4:1 - >---------------------- -0| public class MyClass { -1| public void myFunk() { -2| if (true) { } -3| } -4| } +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| void bar() { } +2| } -< [#2 Range] = -[#2 Domain] = 0:22-4:0 - > -0| public class MyClass { -1| public void myFunk() { -2| if (true) { } -3| } -4| } +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| void bar() { } +2| } < [#3 Range] = -[#3 Domain] = 1:25-3:3 - > -1| public void myFunk() { -2| if (true) { } -3| } - ---< - - -[#4 Range] = -[#4 Domain] = 2:15-2:16 - >-< -2| if (true) { } +[#3 Domain] = 1:16-1:17 + >-< +1| void bar() { } diff --git a/data/fixtures/scopes/java/name.iteration.block2.scope b/data/fixtures/scopes/java/name.iteration.block2.scope new file mode 100644 index 0000000000..dd07df8311 --- /dev/null +++ b/data/fixtures/scopes/java/name.iteration.block2.scope @@ -0,0 +1,13 @@ +void foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| void foo() { } + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| void foo() { } diff --git a/data/fixtures/scopes/java/name.iteration.block3.scope b/data/fixtures/scopes/java/name.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/java/name.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/java/name.iteration.block4.scope b/data/fixtures/scopes/java/name.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/java/name.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/java/name.iteration.class.scope b/data/fixtures/scopes/java/name.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/java/name.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/java/name.iteration.class2.scope b/data/fixtures/scopes/java/name.iteration.class2.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/name.iteration.class2.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/data/fixtures/scopes/java/name.iteration.document.scope b/data/fixtures/scopes/java/name.iteration.document.scope index f1996be268..3e0daecfa3 100644 --- a/data/fixtures/scopes/java/name.iteration.document.scope +++ b/data/fixtures/scopes/java/name.iteration.document.scope @@ -1,18 +1,12 @@ -public class MyClass { } +int foo; --- -[#1 Range] = -[#1 Domain] = 0:0-2:0 +[Range] = +[Domain] = 0:0-2:0 > 0| -1| public class MyClass { } +1| int foo; 2| < - - -[#2 Range] = -[#2 Domain] = 1:22-1:23 - >-< -1| public class MyClass { } diff --git a/data/fixtures/scopes/java/statement.iteration.block.scope b/data/fixtures/scopes/java/statement.iteration.block.scope index 8c9fc9cd8f..4d4bdd63b9 100644 --- a/data/fixtures/scopes/java/statement.iteration.block.scope +++ b/data/fixtures/scopes/java/statement.iteration.block.scope @@ -1,52 +1,27 @@ -public class MyClass { - public void myFunk() { - if (true) { } - while (true) { } - } +class Foo { + void bar() { } } --- [#1 Range] = -[#1 Domain] = 0:0-5:1 - >---------------------- -0| public class MyClass { -1| public void myFunk() { -2| if (true) { } -3| while (true) { } -4| } -5| } +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| void bar() { } +2| } -< [#2 Range] = -[#2 Domain] = 0:22-5:0 - > -0| public class MyClass { -1| public void myFunk() { -2| if (true) { } -3| while (true) { } -4| } -5| } +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| void bar() { } +2| } < [#3 Range] = -[#3 Domain] = 1:25-4:3 - > -1| public void myFunk() { -2| if (true) { } -3| while (true) { } -4| } - ---< - - -[#4 Range] = -[#4 Domain] = 2:15-2:16 - >-< -2| if (true) { } - - -[#5 Range] = -[#5 Domain] = 3:18-3:19 - >-< -3| while (true) { } +[#3 Domain] = 1:16-1:17 + >-< +1| void bar() { } diff --git a/data/fixtures/scopes/java/statement.iteration.block2.scope b/data/fixtures/scopes/java/statement.iteration.block2.scope new file mode 100644 index 0000000000..dd07df8311 --- /dev/null +++ b/data/fixtures/scopes/java/statement.iteration.block2.scope @@ -0,0 +1,13 @@ +void foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| void foo() { } + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| void foo() { } diff --git a/data/fixtures/scopes/java/statement.iteration.block3.scope b/data/fixtures/scopes/java/statement.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/java/statement.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/java/statement.iteration.block4.scope b/data/fixtures/scopes/java/statement.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/java/statement.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/java/statement.iteration.document.scope b/data/fixtures/scopes/java/statement.iteration.document.scope index f1996be268..3e0daecfa3 100644 --- a/data/fixtures/scopes/java/statement.iteration.document.scope +++ b/data/fixtures/scopes/java/statement.iteration.document.scope @@ -1,18 +1,12 @@ -public class MyClass { } +int foo; --- -[#1 Range] = -[#1 Domain] = 0:0-2:0 +[Range] = +[Domain] = 0:0-2:0 > 0| -1| public class MyClass { } +1| int foo; 2| < - - -[#2 Range] = -[#2 Domain] = 1:22-1:23 - >-< -1| public class MyClass { } diff --git a/data/fixtures/scopes/java/value.iteration.block.scope b/data/fixtures/scopes/java/value.iteration.block.scope new file mode 100644 index 0000000000..4d4bdd63b9 --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.block.scope @@ -0,0 +1,27 @@ +class Foo { + void bar() { } +} +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| void bar() { } +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| void bar() { } +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:16-1:17 + >-< +1| void bar() { } diff --git a/data/fixtures/scopes/java/value.iteration.block2.scope b/data/fixtures/scopes/java/value.iteration.block2.scope new file mode 100644 index 0000000000..dd07df8311 --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.block2.scope @@ -0,0 +1,13 @@ +void foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| void foo() { } + + +[#2 Range] = +[#2 Domain] = 0:12-0:13 + >-< +0| void foo() { } diff --git a/data/fixtures/scopes/java/value.iteration.block3.scope b/data/fixtures/scopes/java/value.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/java/value.iteration.block4.scope b/data/fixtures/scopes/java/value.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/java/value.iteration.class.scope b/data/fixtures/scopes/java/value.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/java/value.iteration.class2.scope b/data/fixtures/scopes/java/value.iteration.class2.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.class2.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/data/fixtures/scopes/java/value.iteration.document.scope b/data/fixtures/scopes/java/value.iteration.document.scope new file mode 100644 index 0000000000..3e0daecfa3 --- /dev/null +++ b/data/fixtures/scopes/java/value.iteration.document.scope @@ -0,0 +1,12 @@ + +int foo; + +--- + +[Range] = +[Domain] = 0:0-2:0 + > +0| +1| int foo; +2| + < diff --git a/data/fixtures/scopes/javascript.core/name.iteration.block.scope b/data/fixtures/scopes/javascript.core/name.iteration.block.scope index cb73f4ef7c..cf58c9ddb6 100644 --- a/data/fixtures/scopes/javascript.core/name.iteration.block.scope +++ b/data/fixtures/scopes/javascript.core/name.iteration.block.scope @@ -1,27 +1,27 @@ -class MyClass { - myFunk() { } +class Foo { + bar() { } } --- [#1 Range] = [#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| myFunk() { } + >----------- +0| class Foo { +1| bar() { } 2| } -< [#2 Range] = -[#2 Domain] = 0:15-2:0 - > -0| class MyClass { -1| myFunk() { } +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| bar() { } 2| } < [#3 Range] = -[#3 Domain] = 1:14-1:15 - >-< -1| myFunk() { } +[#3 Domain] = 1:11-1:12 + >-< +1| bar() { } diff --git a/data/fixtures/scopes/javascript.core/name.iteration.block2.scope b/data/fixtures/scopes/javascript.core/name.iteration.block2.scope index da00f553fb..631a35c951 100644 --- a/data/fixtures/scopes/javascript.core/name.iteration.block2.scope +++ b/data/fixtures/scopes/javascript.core/name.iteration.block2.scope @@ -1,13 +1,13 @@ -function myFunk() { } +function foo() { } --- [#1 Range] = -[#1 Domain] = 0:0-0:21 - >---------------------< -0| function myFunk() { } +[#1 Domain] = 0:0-0:18 + >------------------< +0| function foo() { } [#2 Range] = -[#2 Domain] = 0:19-0:20 - >-< -0| function myFunk() { } +[#2 Domain] = 0:16-0:17 + >-< +0| function foo() { } diff --git a/data/fixtures/scopes/javascript.core/name.iteration.block3.scope b/data/fixtures/scopes/javascript.core/name.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/javascript.core/name.iteration.class.scope b/data/fixtures/scopes/javascript.core/name.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/javascript.core/name.iteration.document.scope b/data/fixtures/scopes/javascript.core/name.iteration.document.scope index bc004e6a9e..cf1e2c36ea 100644 --- a/data/fixtures/scopes/javascript.core/name.iteration.document.scope +++ b/data/fixtures/scopes/javascript.core/name.iteration.document.scope @@ -1,10 +1,12 @@ -const aaa = 2; + +let foo; --- [Range] = -[Domain] = 0:0-1:0 - >-------------- -0| const aaa = 2; -1| +[Domain] = 0:0-2:0 + > +0| +1| let foo; +2| < diff --git a/data/fixtures/scopes/javascript.core/statement.iteration.block.scope b/data/fixtures/scopes/javascript.core/statement.iteration.block.scope index 5cde5b4e3f..cf58c9ddb6 100644 --- a/data/fixtures/scopes/javascript.core/statement.iteration.block.scope +++ b/data/fixtures/scopes/javascript.core/statement.iteration.block.scope @@ -1,21 +1,27 @@ -function foo() { - +class Foo { + bar() { } } --- [#1 Range] = [#1 Domain] = 0:0-2:1 - >---------------- -0| function foo() { -1| + >----------- +0| class Foo { +1| bar() { } 2| } -< [#2 Range] = -[#2 Domain] = 0:16-2:0 - > -0| function foo() { -1| +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| bar() { } 2| } < + + +[#3 Range] = +[#3 Domain] = 1:11-1:12 + >-< +1| bar() { } diff --git a/data/fixtures/scopes/javascript.core/statement.iteration.block2.scope b/data/fixtures/scopes/javascript.core/statement.iteration.block2.scope new file mode 100644 index 0000000000..631a35c951 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement.iteration.block2.scope @@ -0,0 +1,13 @@ +function foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| function foo() { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| function foo() { } diff --git a/data/fixtures/scopes/javascript.core/statement.iteration.block3.scope b/data/fixtures/scopes/javascript.core/statement.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/javascript.core/statement.iteration.block4.scope b/data/fixtures/scopes/javascript.core/statement.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement.iteration.block4.scope @@ -0,0 +1,13 @@ +while (true) { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:16 + >----------------< +0| while (true) { } + + +[#2 Range] = +[#2 Domain] = 0:14-0:15 + >-< +0| while (true) { } diff --git a/data/fixtures/scopes/javascript.core/value.iteration.block.scope b/data/fixtures/scopes/javascript.core/value.iteration.block.scope new file mode 100644 index 0000000000..cf58c9ddb6 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.iteration.block.scope @@ -0,0 +1,27 @@ +class Foo { + bar() { } +} +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:1 + >----------- +0| class Foo { +1| bar() { } +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:11-2:0 + > +0| class Foo { +1| bar() { } +2| } + < + + +[#3 Range] = +[#3 Domain] = 1:11-1:12 + >-< +1| bar() { } diff --git a/data/fixtures/scopes/javascript.core/value.iteration.block2.scope b/data/fixtures/scopes/javascript.core/value.iteration.block2.scope new file mode 100644 index 0000000000..631a35c951 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.iteration.block2.scope @@ -0,0 +1,13 @@ +function foo() { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| function foo() { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| function foo() { } diff --git a/data/fixtures/scopes/javascript.core/value.iteration.block3.scope b/data/fixtures/scopes/javascript.core/value.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.iteration.block3.scope @@ -0,0 +1,30 @@ +if (true) { } +else if (false) { } +else { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:8 + >------------- +0| if (true) { } +1| else if (false) { } +2| else { } + --------< + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| if (true) { } + + +[#3 Range] = +[#3 Domain] = 1:17-1:18 + >-< +1| else if (false) { } + + +[#4 Range] = +[#4 Domain] = 2:6-2:7 + >-< +2| else { } diff --git a/data/fixtures/scopes/javascript.core/value.iteration.class.scope b/data/fixtures/scopes/javascript.core/value.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.iteration.class.scope @@ -0,0 +1,13 @@ +class Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } + + +[#2 Range] = +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/javascript.core/value.iteration.document.scope b/data/fixtures/scopes/javascript.core/value.iteration.document.scope new file mode 100644 index 0000000000..cf1e2c36ea --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.iteration.document.scope @@ -0,0 +1,12 @@ + +let foo; + +--- + +[Range] = +[Domain] = 0:0-2:0 + > +0| +1| let foo; +2| + < diff --git a/data/fixtures/scopes/python/name.iteration.block.scope b/data/fixtures/scopes/python/name.iteration.block.scope index 3644f639c8..ec2e6429b2 100644 --- a/data/fixtures/scopes/python/name.iteration.block.scope +++ b/data/fixtures/scopes/python/name.iteration.block.scope @@ -1,16 +1,26 @@ -if True: - pass +class Foo: + def bar(): + pass --- [#1 Range] = -[#1 Domain] = 0:0-1:8 - >-------- -0| if True: -1| pass - --------< +[#1 Domain] = 0:0-2:12 + >---------- +0| class Foo: +1| def bar(): +2| pass + ------------< [#2 Range] = -[#2 Domain] = 1:4-1:8 - >----< -1| pass +[#2 Domain] = 1:4-2:12 + >---------- +1| def bar(): +2| pass + ------------< + + +[#3 Range] = +[#3 Domain] = 2:8-2:12 + >----< +2| pass diff --git a/data/fixtures/scopes/python/name.iteration.block2.scope b/data/fixtures/scopes/python/name.iteration.block2.scope new file mode 100644 index 0000000000..d22d90cda3 --- /dev/null +++ b/data/fixtures/scopes/python/name.iteration.block2.scope @@ -0,0 +1,16 @@ +def foo(): + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >---------- +0| def foo(): +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/name.iteration.block3.scope b/data/fixtures/scopes/python/name.iteration.block3.scope new file mode 100644 index 0000000000..382f662f8d --- /dev/null +++ b/data/fixtures/scopes/python/name.iteration.block3.scope @@ -0,0 +1,36 @@ +if True: + pass +elif False: + pass +else: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-5:8 + >-------- +0| if True: +1| pass +2| elif False: +3| pass +4| else: +5| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass + + +[#3 Range] = +[#3 Domain] = 3:4-3:8 + >----< +3| pass + + +[#4 Range] = +[#4 Domain] = 5:4-5:8 + >----< +5| pass diff --git a/data/fixtures/scopes/python/name.iteration.block4.scope b/data/fixtures/scopes/python/name.iteration.block4.scope new file mode 100644 index 0000000000..98a8f15c8f --- /dev/null +++ b/data/fixtures/scopes/python/name.iteration.block4.scope @@ -0,0 +1,16 @@ +while True: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >----------- +0| while True: +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/name.iteration.class.scope b/data/fixtures/scopes/python/name.iteration.class.scope new file mode 100644 index 0000000000..6a16802260 --- /dev/null +++ b/data/fixtures/scopes/python/name.iteration.class.scope @@ -0,0 +1,16 @@ +class Foo: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >---------- +0| class Foo: +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/name.iteration.document.scope b/data/fixtures/scopes/python/name.iteration.document.scope index 61a2c608f7..10eeeb6737 100644 --- a/data/fixtures/scopes/python/name.iteration.document.scope +++ b/data/fixtures/scopes/python/name.iteration.document.scope @@ -1,5 +1,5 @@ -aaa = 2 +foo --- @@ -7,6 +7,6 @@ aaa = 2 [Domain] = 0:0-2:0 > 0| -1| aaa = 2 +1| foo 2| < diff --git a/data/fixtures/scopes/python/statement.iteration.block.scope b/data/fixtures/scopes/python/statement.iteration.block.scope index 3644f639c8..ec2e6429b2 100644 --- a/data/fixtures/scopes/python/statement.iteration.block.scope +++ b/data/fixtures/scopes/python/statement.iteration.block.scope @@ -1,16 +1,26 @@ -if True: - pass +class Foo: + def bar(): + pass --- [#1 Range] = -[#1 Domain] = 0:0-1:8 - >-------- -0| if True: -1| pass - --------< +[#1 Domain] = 0:0-2:12 + >---------- +0| class Foo: +1| def bar(): +2| pass + ------------< [#2 Range] = -[#2 Domain] = 1:4-1:8 - >----< -1| pass +[#2 Domain] = 1:4-2:12 + >---------- +1| def bar(): +2| pass + ------------< + + +[#3 Range] = +[#3 Domain] = 2:8-2:12 + >----< +2| pass diff --git a/data/fixtures/scopes/python/statement.iteration.block2.scope b/data/fixtures/scopes/python/statement.iteration.block2.scope new file mode 100644 index 0000000000..d22d90cda3 --- /dev/null +++ b/data/fixtures/scopes/python/statement.iteration.block2.scope @@ -0,0 +1,16 @@ +def foo(): + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >---------- +0| def foo(): +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/statement.iteration.block3.scope b/data/fixtures/scopes/python/statement.iteration.block3.scope new file mode 100644 index 0000000000..382f662f8d --- /dev/null +++ b/data/fixtures/scopes/python/statement.iteration.block3.scope @@ -0,0 +1,36 @@ +if True: + pass +elif False: + pass +else: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-5:8 + >-------- +0| if True: +1| pass +2| elif False: +3| pass +4| else: +5| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass + + +[#3 Range] = +[#3 Domain] = 3:4-3:8 + >----< +3| pass + + +[#4 Range] = +[#4 Domain] = 5:4-5:8 + >----< +5| pass diff --git a/data/fixtures/scopes/python/statement.iteration.block4.scope b/data/fixtures/scopes/python/statement.iteration.block4.scope new file mode 100644 index 0000000000..98a8f15c8f --- /dev/null +++ b/data/fixtures/scopes/python/statement.iteration.block4.scope @@ -0,0 +1,16 @@ +while True: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >----------- +0| while True: +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/statement.iteration.document.scope b/data/fixtures/scopes/python/statement.iteration.document.scope index 15018df48d..10eeeb6737 100644 --- a/data/fixtures/scopes/python/statement.iteration.document.scope +++ b/data/fixtures/scopes/python/statement.iteration.document.scope @@ -1,5 +1,5 @@ -value = 123 +foo --- @@ -7,6 +7,6 @@ value = 123 [Domain] = 0:0-2:0 > 0| -1| value = 123 +1| foo 2| < diff --git a/data/fixtures/scopes/python/value.iteration.block.scope b/data/fixtures/scopes/python/value.iteration.block.scope new file mode 100644 index 0000000000..ec2e6429b2 --- /dev/null +++ b/data/fixtures/scopes/python/value.iteration.block.scope @@ -0,0 +1,26 @@ +class Foo: + def bar(): + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:12 + >---------- +0| class Foo: +1| def bar(): +2| pass + ------------< + + +[#2 Range] = +[#2 Domain] = 1:4-2:12 + >---------- +1| def bar(): +2| pass + ------------< + + +[#3 Range] = +[#3 Domain] = 2:8-2:12 + >----< +2| pass diff --git a/data/fixtures/scopes/python/value.iteration.block2.scope b/data/fixtures/scopes/python/value.iteration.block2.scope new file mode 100644 index 0000000000..d22d90cda3 --- /dev/null +++ b/data/fixtures/scopes/python/value.iteration.block2.scope @@ -0,0 +1,16 @@ +def foo(): + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >---------- +0| def foo(): +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/value.iteration.block3.scope b/data/fixtures/scopes/python/value.iteration.block3.scope new file mode 100644 index 0000000000..382f662f8d --- /dev/null +++ b/data/fixtures/scopes/python/value.iteration.block3.scope @@ -0,0 +1,36 @@ +if True: + pass +elif False: + pass +else: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-5:8 + >-------- +0| if True: +1| pass +2| elif False: +3| pass +4| else: +5| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass + + +[#3 Range] = +[#3 Domain] = 3:4-3:8 + >----< +3| pass + + +[#4 Range] = +[#4 Domain] = 5:4-5:8 + >----< +5| pass diff --git a/data/fixtures/scopes/python/value.iteration.block4.scope b/data/fixtures/scopes/python/value.iteration.block4.scope new file mode 100644 index 0000000000..98a8f15c8f --- /dev/null +++ b/data/fixtures/scopes/python/value.iteration.block4.scope @@ -0,0 +1,16 @@ +while True: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >----------- +0| while True: +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/value.iteration.class.scope b/data/fixtures/scopes/python/value.iteration.class.scope new file mode 100644 index 0000000000..6a16802260 --- /dev/null +++ b/data/fixtures/scopes/python/value.iteration.class.scope @@ -0,0 +1,16 @@ +class Foo: + pass +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:8 + >---------- +0| class Foo: +1| pass + --------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:8 + >----< +1| pass diff --git a/data/fixtures/scopes/python/value.iteration.document.scope b/data/fixtures/scopes/python/value.iteration.document.scope new file mode 100644 index 0000000000..10eeeb6737 --- /dev/null +++ b/data/fixtures/scopes/python/value.iteration.document.scope @@ -0,0 +1,12 @@ + +foo + +--- + +[Range] = +[Domain] = 0:0-2:0 + > +0| +1| foo +2| + < diff --git a/data/fixtures/scopes/talon/name.iteration.block.scope b/data/fixtures/scopes/talon/name.iteration.block.scope new file mode 100644 index 0000000000..f839f283e9 --- /dev/null +++ b/data/fixtures/scopes/talon/name.iteration.block.scope @@ -0,0 +1,13 @@ +hello: "world" +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| hello: "world" + + +[#2 Range] = +[#2 Domain] = 0:7-0:14 + >-------< +0| hello: "world" diff --git a/data/fixtures/scopes/talon/name.iteration.block2.scope b/data/fixtures/scopes/talon/name.iteration.block2.scope new file mode 100644 index 0000000000..3bad208a56 --- /dev/null +++ b/data/fixtures/scopes/talon/name.iteration.block2.scope @@ -0,0 +1,16 @@ +settings(): + foo = 0 +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:11 + >----------- +0| settings(): +1| foo = 0 + -----------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 diff --git a/data/fixtures/scopes/talon/name.iteration.block3.scope b/data/fixtures/scopes/talon/name.iteration.block3.scope new file mode 100644 index 0000000000..ce63b7a8b6 --- /dev/null +++ b/data/fixtures/scopes/talon/name.iteration.block3.scope @@ -0,0 +1,48 @@ +mode: command +- + +hello: "world" + +settings(): + foo = 0 +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| mode: command + + +[#2 Range] = +[#2 Domain] = 0:0-6:11 + >------------- +0| mode: command +1| - +2| +3| hello: "world" +4| +5| settings(): +6| foo = 0 + -----------< + + +[#3 Range] = +[#3 Domain] = 3:0-6:11 + >-------------- +3| hello: "world" +4| +5| settings(): +6| foo = 0 + -----------< + + +[#4 Range] = +[#4 Domain] = 3:7-3:14 + >-------< +3| hello: "world" + + +[#5 Range] = +[#5 Domain] = 6:4-6:11 + >-------< +6| foo = 0 diff --git a/data/fixtures/scopes/talon/name.iteration.document.scope b/data/fixtures/scopes/talon/name.iteration.document.scope new file mode 100644 index 0000000000..cb50018a34 --- /dev/null +++ b/data/fixtures/scopes/talon/name.iteration.document.scope @@ -0,0 +1,20 @@ + +mode: command +- + +--- + +[#1 Range] = +[#1 Domain] = 0:0-3:0 + > +0| +1| mode: command +2| - +3| + < + + +[#2 Range] = +[#2 Domain] = 1:0-1:13 + >-------------< +1| mode: command diff --git a/data/fixtures/scopes/talon/value.iteration.block.scope b/data/fixtures/scopes/talon/value.iteration.block.scope new file mode 100644 index 0000000000..f839f283e9 --- /dev/null +++ b/data/fixtures/scopes/talon/value.iteration.block.scope @@ -0,0 +1,13 @@ +hello: "world" +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| hello: "world" + + +[#2 Range] = +[#2 Domain] = 0:7-0:14 + >-------< +0| hello: "world" diff --git a/data/fixtures/scopes/talon/value.iteration.block2.scope b/data/fixtures/scopes/talon/value.iteration.block2.scope new file mode 100644 index 0000000000..3bad208a56 --- /dev/null +++ b/data/fixtures/scopes/talon/value.iteration.block2.scope @@ -0,0 +1,16 @@ +settings(): + foo = 0 +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:11 + >----------- +0| settings(): +1| foo = 0 + -----------< + + +[#2 Range] = +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 diff --git a/data/fixtures/scopes/talon/value.iteration.block3.scope b/data/fixtures/scopes/talon/value.iteration.block3.scope new file mode 100644 index 0000000000..ce63b7a8b6 --- /dev/null +++ b/data/fixtures/scopes/talon/value.iteration.block3.scope @@ -0,0 +1,48 @@ +mode: command +- + +hello: "world" + +settings(): + foo = 0 +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| mode: command + + +[#2 Range] = +[#2 Domain] = 0:0-6:11 + >------------- +0| mode: command +1| - +2| +3| hello: "world" +4| +5| settings(): +6| foo = 0 + -----------< + + +[#3 Range] = +[#3 Domain] = 3:0-6:11 + >-------------- +3| hello: "world" +4| +5| settings(): +6| foo = 0 + -----------< + + +[#4 Range] = +[#4 Domain] = 3:7-3:14 + >-------< +3| hello: "world" + + +[#5 Range] = +[#5 Domain] = 6:4-6:11 + >-------< +6| foo = 0 diff --git a/data/fixtures/scopes/talon/value.iteration.document.scope b/data/fixtures/scopes/talon/value.iteration.document.scope new file mode 100644 index 0000000000..cb50018a34 --- /dev/null +++ b/data/fixtures/scopes/talon/value.iteration.document.scope @@ -0,0 +1,20 @@ + +mode: command +- + +--- + +[#1 Range] = +[#1 Domain] = 0:0-3:0 + > +0| +1| mode: command +2| - +3| + < + + +[#2 Range] = +[#2 Domain] = 1:0-1:13 + >-------------< +1| mode: command diff --git a/data/fixtures/scopes/typescript.core/name.iteration.class.scope b/data/fixtures/scopes/typescript.core/name.iteration.class.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.iteration.class.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/data/fixtures/scopes/typescript.core/type.cast.scope b/data/fixtures/scopes/typescript.core/type.cast.scope index f471cdc5ab..4dc82c5204 100644 --- a/data/fixtures/scopes/typescript.core/type.cast.scope +++ b/data/fixtures/scopes/typescript.core/type.cast.scope @@ -1,20 +1,20 @@ -aaa as Bbb +foo as Bar --- [Content] = 0:7-0:10 >---< -0| aaa as Bbb +0| foo as Bar [Removal] = 0:3-0:10 >-------< -0| aaa as Bbb +0| foo as Bar [Leading delimiter] = 0:3-0:7 >----< -0| aaa as Bbb +0| foo as Bar [Domain] = 0:0-0:10 >----------< -0| aaa as Bbb +0| foo as Bar [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.cast2.scope b/data/fixtures/scopes/typescript.core/type.cast2.scope index 6efd72521d..80cd8bbaa5 100644 --- a/data/fixtures/scopes/typescript.core/type.cast2.scope +++ b/data/fixtures/scopes/typescript.core/type.cast2.scope @@ -1,20 +1,20 @@ -aaa as const +foo as const --- [Content] = 0:7-0:12 >-----< -0| aaa as const +0| foo as const [Removal] = 0:3-0:12 >---------< -0| aaa as const +0| foo as const [Leading delimiter] = 0:3-0:7 >----< -0| aaa as const +0| foo as const [Domain] = 0:0-0:12 >------------< -0| aaa as const +0| foo as const [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.class.scope b/data/fixtures/scopes/typescript.core/type.class.scope index 3ccc5da772..2d8fb78b2f 100644 --- a/data/fixtures/scopes/typescript.core/type.class.scope +++ b/data/fixtures/scopes/typescript.core/type.class.scope @@ -1,10 +1,10 @@ -abstract class MyClass { } +abstract class Foo { } --- [Content] = [Removal] = -[Domain] = 0:0-0:26 - >--------------------------< -0| abstract class MyClass { } +[Domain] = 0:0-0:22 + >----------------------< +0| abstract class Foo { } [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.enum.scope b/data/fixtures/scopes/typescript.core/type.enum.scope index ebf7a46bf9..25a727623b 100644 --- a/data/fixtures/scopes/typescript.core/type.enum.scope +++ b/data/fixtures/scopes/typescript.core/type.enum.scope @@ -1,15 +1,10 @@ -enum Aaa { - bbb, -} +enum Foo { } --- [Content] = [Removal] = -[Domain] = 0:0-2:1 - >---------- -0| enum Aaa { -1| bbb, -2| } - -< +[Domain] = 0:0-0:12 + >------------< +0| enum Foo { } [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.enum2.scope b/data/fixtures/scopes/typescript.core/type.enum2.scope index 5cfb564c0c..66d0aeb8be 100644 --- a/data/fixtures/scopes/typescript.core/type.enum2.scope +++ b/data/fixtures/scopes/typescript.core/type.enum2.scope @@ -1,15 +1,10 @@ -const enum Aaa { - bbb, -} +const enum Foo { } --- [Content] = [Removal] = -[Domain] = 0:0-2:1 - >---------------- -0| const enum Aaa { -1| bbb, -2| } - -< +[Domain] = 0:0-0:18 + >------------------< +0| const enum Foo { } [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.field.iteration.scope b/data/fixtures/scopes/typescript.core/type.field.iteration.scope index a9bd7ec26f..d68d97881e 100644 --- a/data/fixtures/scopes/typescript.core/type.field.iteration.scope +++ b/data/fixtures/scopes/typescript.core/type.field.iteration.scope @@ -1,13 +1,13 @@ -class MyClass { } +class Foo { } --- [#1 Range] = -[#1 Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[#1 Domain] = 0:0-0:13 + >-------------< +0| class Foo { } [#2 Range] = -[#2 Domain] = 0:15-0:16 - >-< -0| class MyClass { } +[#2 Domain] = 0:11-0:12 + >-< +0| class Foo { } diff --git a/data/fixtures/scopes/typescript.core/type.interface.scope b/data/fixtures/scopes/typescript.core/type.interface.scope index 53c582acfa..cc97809272 100644 --- a/data/fixtures/scopes/typescript.core/type.interface.scope +++ b/data/fixtures/scopes/typescript.core/type.interface.scope @@ -1,15 +1,10 @@ -interface MyType { - -} +interface Foo { } --- [Content] = [Removal] = -[Domain] = 0:0-2:1 - >------------------ -0| interface MyType { -1| -2| } - -< +[Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/value.iteration.class.scope b/data/fixtures/scopes/typescript.core/value.iteration.class.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/value.iteration.class.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index ed9cdd8004..dbb135abb2 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -75,6 +75,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.class": supported, "name.field": supported, "name.iteration.block": supported, + "name.iteration.class": supported, "name.iteration.document": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, @@ -82,6 +83,9 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.assignment": supported, "value.variable": supported, "value.return": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, "type.variable": supported, "type.argument.formal": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 86c4da63bc..20b004ce90 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -69,6 +69,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.iteration.block": supported, + "name.iteration.class": supported, "name.iteration.document": supported, "name.method": supported, "name.variable": supported, @@ -88,6 +89,9 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.return": supported, "value.variable": supported, "value.yield": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 87546b4a9b..b2d2925b9b 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -156,6 +156,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.resource": notApplicable, "name.variable.pattern": notApplicable, "name.variable": notApplicable, + "name.iteration.class": notApplicable, "namedFunction.constructor": notApplicable, "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, @@ -217,4 +218,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.variable": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 58818832fa..2160d6228d 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -124,6 +124,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, + "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource.iteration": notApplicable, @@ -185,6 +186,9 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.variable": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, anonymousFunction: notApplicable, class: notApplicable, className: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 3eec6e205e..e4343ed47e 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -97,6 +97,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.method": supported, "name.variable": supported, "name.iteration.document": supported, + "name.iteration.class": supported, "name.iteration.block": supported, "name.resource": supported, @@ -138,6 +139,9 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.return.lambda": supported, "value.variable": supported, "value.resource": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, "interior.class": supported, "interior.constructor": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 63a4f750d3..a493d18f53 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -129,6 +129,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.class": supported, "name.field": supported, "name.iteration.document": supported, + "name.iteration.class": supported, "name.iteration.block": supported, "key.mapPair": supported, @@ -150,7 +151,12 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.return.lambda": supported, "value.field": supported, "value.yield": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, + // JS doesn't have types, but for muscle memory sake we will treat classes the + // same in JS and TS. "type.class": supported, "interior.class": supported, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index d7d6930b97..6550bb6f1e 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -141,6 +141,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, + "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -209,6 +210,9 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index ad507a1a79..fabc415f80 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -139,6 +139,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, + "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -208,6 +209,9 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 3b8a402399..c1ac6b9f17 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -22,6 +22,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.field": supported, "name.function": supported, "name.iteration.block": supported, + "name.iteration.class": supported, "name.iteration.document": supported, "name.method": supported, "name.variable": supported, @@ -47,6 +48,9 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.return.lambda": supported, "value.variable": supported, "value.variable.pattern": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, "type.argument.formal.constructor": supported, "type.argument.formal.constructor.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 2e01eed71a..fa61439a70 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -139,6 +139,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, + "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -209,6 +210,9 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 716f3c3b49..144dad861a 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -581,6 +581,22 @@ export const scopeSupportFacetInfos: Record< description: "Name (LHS) of a field in a class / interface", scopeType: "name", }, + "name.iteration.block": { + description: + "Iteration scope for names: statement blocks (body of functions / if statements / for loops / etc).", + scopeType: "name", + isIteration: true, + }, + "name.iteration.class": { + description: "Iteration scope for names: class body", + scopeType: "name", + isIteration: true, + }, + "name.iteration.document": { + description: "Iteration scope for names: the entire document", + scopeType: "name", + isIteration: true, + }, "name.resource": { description: "Name in a 'with' / 'use' / 'using' statement", scopeType: "name", @@ -631,17 +647,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "name", isIteration: true, }, - "name.iteration.block": { - description: - "Iteration scope for names: statement blocks (body of functions/if statements/for loops/etc).", - scopeType: "name", - isIteration: true, - }, - "name.iteration.document": { - description: "Iteration scope for names: the entire document", - scopeType: "name", - isIteration: true, - }, + "key.attribute": { description: "Key (LHS) of an attribute eg in a xml element", scopeType: "collectionKey", @@ -704,6 +710,22 @@ export const scopeSupportFacetInfos: Record< description: "Value of a yield statement", scopeType: "value", }, + "value.iteration.block": { + description: + "Iteration scope for values: statement blocks (body of functions / if statements / for loops / etc).", + scopeType: "value", + isIteration: true, + }, + "value.iteration.class": { + description: "Iteration scope for values: class body", + scopeType: "value", + isIteration: true, + }, + "value.iteration.document": { + description: "Iteration scope for values: the entire document", + scopeType: "value", + isIteration: true, + }, "value.resource": { description: "Value of a 'with' / 'use' / 'using' statement", scopeType: "value", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 3aa2462aef..8b4e2b9cc8 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -144,6 +144,9 @@ export const scopeSupportFacets = [ "name.class", "name.namespace", "name.field", + "name.iteration.block", + "name.iteration.class", + "name.iteration.document", "name.resource", "name.resource.iteration", "name.argument.actual", @@ -154,8 +157,6 @@ export const scopeSupportFacets = [ "name.argument.formal.method.iteration", "name.argument.formal.constructor", "name.argument.formal.constructor.iteration", - "name.iteration.block", - "name.iteration.document", "key.attribute", "key.mapPair", @@ -172,6 +173,10 @@ export const scopeSupportFacets = [ "value.return.lambda", "value.field", "value.yield", + "value.iteration.block", + "value.typeAlias", + "value.iteration.class", + "value.iteration.document", "value.resource", "value.resource.iteration", "value.argument.actual", @@ -182,7 +187,6 @@ export const scopeSupportFacets = [ "value.argument.formal.method.iteration", "value.argument.formal.constructor", "value.argument.formal.constructor.iteration", - "value.typeAlias", "type.variable", "type.argument.formal", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index f15b9d5f8a..ce33412da9 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -19,6 +19,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment": supported, "name.field": supported, "name.variable": supported, + "name.iteration.block": supported, + "name.iteration.document": supported, "statement.iteration.block": supported, "statement.iteration.document": supported, @@ -26,6 +28,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.assignment": supported, "value.field": supported, "value.variable": supported, + "value.iteration.block": supported, + "value.iteration.document": supported, command: supported, statement: supported, @@ -152,8 +156,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.constructor": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, - "name.iteration.block": notApplicable, - "name.iteration.document": notApplicable, + "name.iteration.class": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, "name.resource.iteration": notApplicable, @@ -215,6 +218,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.typeAlias": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, + "value.iteration.class": notApplicable, "string.multiLine": notApplicable, "textFragment.string.multiLine": notApplicable, selector: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index cf20a018bf..e646d7b07b 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -138,6 +138,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, + "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -205,6 +206,9 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index d12e609d85..7edd745ec7 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -145,6 +145,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, + "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -212,6 +213,9 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, + "value.iteration.block": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, }; diff --git a/queries/c.scm b/queries/c.scm index 47956df039..09c1f4f43e 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -35,9 +35,15 @@ (translation_unit) @statement.iteration @class.iteration @className.iteration (#document-range! @statement.iteration @class.iteration @className.iteration) ) + +( + (translation_unit) @namedFunction.iteration @functionName.iteration + (#document-range! @namedFunction.iteration @functionName.iteration) +) + ( - (translation_unit) @namedFunction.iteration @functionName.iteration @name.iteration - (#document-range! @namedFunction.iteration @functionName.iteration @name.iteration) + (translation_unit) @name.iteration @value.iteration + (#document-range! @name.iteration @value.iteration) ) (field_declaration_list @@ -47,8 +53,8 @@ ;; Body of statements (compound_statement - "{" @statement.iteration.start.endOf @name.iteration.start.endOf - "}" @statement.iteration.end.startOf @name.iteration.end.startOf + "{" @statement.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf + "}" @statement.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf ) ( diff --git a/queries/csharp.scm b/queries/csharp.scm index 3c89d4caeb..57336cd62f 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -54,15 +54,35 @@ ) ( - (compilation_unit) @name.iteration @namedFunction.iteration @functionName.iteration - (#document-range! @name.iteration @namedFunction.iteration @functionName.iteration) + (compilation_unit) @namedFunction.iteration @functionName.iteration + (#document-range! @namedFunction.iteration @functionName.iteration) ) -(_ - body: (_ - "{" @statement.iteration.start.endOf - "}" @statement.iteration.end.startOf - ) +( + (compilation_unit) @name.iteration @value.iteration + (#document-range! @name.iteration @value.iteration) +) + +;;!! { } +;;! ^ +(block + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf +) + +(block + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf +) + +( + (_ + (block + "{" @interior.start.endOf + "}" @interior.end.startOf + ) + ) @_.domain + (#not-type? @_.domain try_statement if_statement) ) ;;!! if () {} @@ -184,24 +204,18 @@ ) ) @class @type @_.domain -;; Treat interior of all bodies as iteration scopes for class and classname, eg -;;!! private static void foo() { } -;;! *** -(_ +(class_declaration body: (_ - "{" @class.iteration.start.endOf @className.iteration.start.endOf - "}" @class.iteration.end.startOf @className.iteration.end.startOf + "{" @class.iteration.start.endOf @className.iteration.start.endOf @statement.iteration.start.endOf + "}" @class.iteration.end.startOf @className.iteration.end.startOf @statement.iteration.end.startOf ) ) -( - (_ - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) - ) @_.domain - (#not-type? @_.domain try_statement) +(class_declaration + 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 + ) ) ;;!! "Hello world" @@ -284,6 +298,15 @@ ) ] @_.domain +;;!! switch(value) { } +;;! ^ +(switch_statement + (switch_body + "{" @interior.start.endOf + "}" @interior.end.startOf + ) +) @_.domain + (switch_statement (tuple_expression) @private.switchStatementSubject ) @_.domain @@ -539,16 +562,6 @@ ")" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf ) -;; Treat interior of all bodies as iteration scopes for `name`, eg -;;!! void foo() { } -;;! ^^^ -(_ - 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 - ) -) - operator: [ "->" "<" diff --git a/queries/java.scm b/queries/java.scm index e98080cf48..45d27f909d 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -49,12 +49,13 @@ ) @class @_.domain ( - (program) @class.iteration @className.iteration @name.iteration - (#document-range! @class.iteration @className.iteration @name.iteration) + (program) @class.iteration @className.iteration @statement.iteration + (#document-range! @class.iteration @className.iteration @statement.iteration) ) + ( - (program) @statement.iteration - (#document-range! @statement.iteration) + (program) @name.iteration @value.iteration + (#document-range! @name.iteration @value.iteration) ) ;;!! class MyClass { } @@ -65,37 +66,38 @@ ) (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 + "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf ) -;;!! xxx { } -;;! ^ +;;!! { } +;;! ^ ( (_ - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) - ) @_.domain - (#not-type? @_.domain try_statement) + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf + ) @_dummy + (#type? @_dummy block class_body interface_body constructor_body) ) -;;!! { } -;;! ^ -(_ - "{" @name.iteration.start.endOf @statement.iteration.start.endOf - "}" @name.iteration.end.startOf @statement.iteration.end.startOf +( + (_ + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf + ) @_dummy + (#type? @_dummy block class_body interface_body constructor_body) ) +;;!! { } +;;! ^ ( (_ - !body - (block + (_ "{" @interior.start.endOf "}" @interior.end.startOf - ) + ) @_dummy ) @_.domain + (#type? @_dummy block class_body interface_body constructor_body switch_block) (#not-type? @_.domain try_statement if_statement) ) diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 40d597a380..6d343f465b 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -427,24 +427,33 @@ (#document-range! @name.iteration @value.iteration @type.iteration) ) -;; Treat interior of all bodies as iteration scopes for `name`, eg -;;!! function foo() { } -;;! *** -(_ - 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 - ) + ) @_dummy + (#type? @_dummy statement_block class_body interface_body) ) ( (_ - body: (_ + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf + ) @_dummy + (#type? @_dummy statement_block class_body interface_body) +) + +( + (_ + (_ "{" @interior.start.endOf "}" @interior.end.startOf - ) + ) @_dummy ) @_.domain - (#not-type? @_.domain try_statement) + (#type? @_dummy statement_block class_body interface_body switch_body) + (#not-type? @_.domain if_statement try_statement) ) ;;!! const aaa = {bbb: 0, ccc: 0}; @@ -783,11 +792,6 @@ (#document-range! @statement.iteration) ) -(statement_block - "{" @statement.iteration.start.endOf - "}" @statement.iteration.end.startOf -) - ;;!! function foo(aaa, bbb) {} ;;! ^^^ ^^^ ( diff --git a/queries/talon.scm b/queries/talon.scm index 8a8f56fef6..ec82915292 100644 --- a/queries/talon.scm +++ b/queries/talon.scm @@ -39,7 +39,7 @@ (_ left: _ @name ) @_.domain - (#not-type? @_.domain "binary_operator") + (#not-type? @_.domain binary_operator) ) ;;!! not mode: command @@ -53,7 +53,7 @@ modifiers: (_)? @collectionKey.start left: _ @collectionKey.end ) @_.domain - (#not-type? @_.domain "binary_operator") + (#not-type? @_.domain binary_operator) ) ;;!! not mode: command @@ -64,32 +64,36 @@ (_ right: (_) @value ) @_.domain - (#not-type? @_.domain "binary_operator") + (#not-type? @_.domain binary_operator) ) -;;!! mode: command -;;! <************* -;;!! tag: user.foo -;;! *************> -;;!! - -;;!! settings(): -;;!! speech.debug = 1 -;;! <**************** -;;!! user.foo = "bar" -;;! ****************> -;;!! -;;!! hello: "world" -;;!1 <************** -;;!! foo: -;;!1 **** -;;!! bar = 5 -;;!1 *******> -;;!2 <*******> -(_ - (_ - right: (_) - ) -) @name.iteration @collectionKey.iteration @value.iteration +;;!! mode: command +;;! ^^^^^^^^^^^^^ +(matches + (_) @name.iteration.end.endOf @collectionKey.iteration.end.endOf @value.iteration.end.endOf + . +) @name.iteration.start.startOf @collectionKey.iteration.start.startOf @value.iteration.start.startOf + +;;!! hello: "world" +;;! ^^^^^^^^^^^^^^ +(declarations) @name.iteration @collectionKey.iteration @value.iteration + +;;!! hello: "world" +;;! ^^^^^^^ +;;!! settings(): +;;!! speech.debug = 1 +;;! ^^^^^^^^^^^^^^^^ +(block) @name.iteration @collectionKey.iteration @value.iteration + +( + (source_file) @command.iteration @statement.iteration + (#document-range! @command.iteration @statement.iteration) +) + +( + (source_file) @name.iteration @collectionKey.iteration @value.iteration + (#document-range! @name.iteration @collectionKey.iteration @value.iteration) +) ;;!! tag: user.foo ;;! {^^^^^^^^^^^^^ @@ -123,11 +127,6 @@ (#insertion-delimiter! @command "\n") ) -( - (source_file) @command.iteration @statement.iteration - (#document-range! @command.iteration @statement.iteration) -) - ;;!! key(enter) ;;! ^^^^^^^^^^ ;;!! edit.left() diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index 2b792cd352..5e0afe182a 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -423,10 +423,3 @@ (function_type "=>" @disqualifyDelimiter ) - -;;!! class Aaa { } -;;! ^ -(class_body - "{" @type.iteration.start.endOf - "}" @type.iteration.end.startOf -)