diff --git a/data/fixtures/scopes/c/name.iteration.block3.scope b/data/fixtures/scopes/c/name.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/c/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/c/name.iteration.block4.scope b/data/fixtures/scopes/c/name.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/c/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/c/statement.iteration.block3.scope b/data/fixtures/scopes/c/statement.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/c/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/c/statement.iteration.block4.scope b/data/fixtures/scopes/c/statement.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/c/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/c/statement.iteration.class.scope b/data/fixtures/scopes/c/statement.iteration.class.scope new file mode 100644 index 0000000000..91fb39ebc7 --- /dev/null +++ b/data/fixtures/scopes/c/statement.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/statement.iteration.class2.scope b/data/fixtures/scopes/c/statement.iteration.class2.scope new file mode 100644 index 0000000000..af4e4e8adf --- /dev/null +++ b/data/fixtures/scopes/c/statement.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/type.argument.formal.iteration.scope b/data/fixtures/scopes/c/type.argument.formal.iteration.scope index 457e904030..5c4994663a 100644 --- a/data/fixtures/scopes/c/type.argument.formal.iteration.scope +++ b/data/fixtures/scopes/c/type.argument.formal.iteration.scope @@ -1,7 +1,13 @@ void foo(int aaa, int bbb) {} --- -[Range] = -[Domain] = 0:9-0:25 +[#1 Range] = +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| void foo(int aaa, int bbb) {} + + +[#2 Range] = +[#2 Domain] = 0:9-0:25 >----------------< 0| void foo(int aaa, int bbb) {} diff --git a/data/fixtures/scopes/c/type.field.iteration.scope b/data/fixtures/scopes/c/type.field.iteration.scope deleted file mode 100644 index 70e202299c..0000000000 --- a/data/fixtures/scopes/c/type.field.iteration.scope +++ /dev/null @@ -1,7 +0,0 @@ -struct Foo { }; ---- - -[Range] = -[Domain] = 0:12-0:13 - >-< -0| struct Foo { }; diff --git a/data/fixtures/scopes/c/type.iteration.block2.scope b/data/fixtures/scopes/c/type.iteration.block2.scope new file mode 100644 index 0000000000..dd07df8311 --- /dev/null +++ b/data/fixtures/scopes/c/type.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/type.iteration.block3.scope b/data/fixtures/scopes/c/type.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/c/type.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/c/type.iteration.block4.scope b/data/fixtures/scopes/c/type.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/c/type.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/c/type.iteration.class.scope b/data/fixtures/scopes/c/type.iteration.class.scope new file mode 100644 index 0000000000..91fb39ebc7 --- /dev/null +++ b/data/fixtures/scopes/c/type.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/type.iteration.class2.scope b/data/fixtures/scopes/c/type.iteration.class2.scope new file mode 100644 index 0000000000..af4e4e8adf --- /dev/null +++ b/data/fixtures/scopes/c/type.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/type.iteration.document.scope b/data/fixtures/scopes/c/type.iteration.document.scope new file mode 100644 index 0000000000..3e0daecfa3 --- /dev/null +++ b/data/fixtures/scopes/c/type.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/c/value.iteration.block3.scope b/data/fixtures/scopes/c/value.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/c/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/c/value.iteration.block4.scope b/data/fixtures/scopes/c/value.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/c/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/cpp/statement.iteration.class.scope b/data/fixtures/scopes/cpp/statement.iteration.class.scope new file mode 100644 index 0000000000..b79d7b395c --- /dev/null +++ b/data/fixtures/scopes/cpp/statement.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/type.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/cpp/type.argument.formal.constructor.iteration.scope index d6b31aea6c..282891acb0 100644 --- a/data/fixtures/scopes/cpp/type.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/cpp/type.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 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| MyClass(int aaa, int bbb) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:12-1:28 +[#3 Range] = +[#3 Domain] = 1:12-1:28 >----------------< 1| MyClass(int aaa, int bbb) {} diff --git a/data/fixtures/scopes/cpp/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/cpp/type.argument.formal.method.iteration.scope index 1c4875f65e..a2f8959a5f 100644 --- a/data/fixtures/scopes/cpp/type.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/cpp/type.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 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| void foo(int aaa, int bbb) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:13-1:29 +[#3 Range] = +[#3 Domain] = 1:13-1:29 >----------------< 1| void foo(int aaa, int bbb) {} diff --git a/data/fixtures/scopes/cpp/type.iteration.class.scope b/data/fixtures/scopes/cpp/type.iteration.class.scope new file mode 100644 index 0000000000..b79d7b395c --- /dev/null +++ b/data/fixtures/scopes/cpp/type.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/type.typeArgument.iteration.scope b/data/fixtures/scopes/cpp/type.typeArgument.iteration.scope index fde8c6354e..d997ab6aa4 100644 --- a/data/fixtures/scopes/cpp/type.typeArgument.iteration.scope +++ b/data/fixtures/scopes/cpp/type.typeArgument.iteration.scope @@ -1,7 +1,13 @@ Map foo; --- -[Range] = -[Domain] = 0:4-0:15 +[#1 Range] = +[#1 Domain] = 0:0-0:21 + >---------------------< +0| Map foo; + + +[#2 Range] = +[#2 Domain] = 0:4-0:15 >-----------< 0| Map foo; diff --git a/data/fixtures/scopes/csharp/name.iteration.document.scope b/data/fixtures/scopes/csharp/name.iteration.document.scope index 482a9e9476..3e0daecfa3 100644 --- a/data/fixtures/scopes/csharp/name.iteration.document.scope +++ b/data/fixtures/scopes/csharp/name.iteration.document.scope @@ -1,5 +1,5 @@ -class MyClass {} +int foo; --- @@ -7,6 +7,6 @@ class MyClass {} [Domain] = 0:0-2:0 > 0| -1| class MyClass {} +1| int foo; 2| < diff --git a/data/fixtures/scopes/typescript.core/type.field.iteration.scope b/data/fixtures/scopes/csharp/statement.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/type.field.iteration.scope rename to data/fixtures/scopes/csharp/statement.iteration.class.scope diff --git a/data/fixtures/scopes/csharp/statement.iteration.document.scope b/data/fixtures/scopes/csharp/statement.iteration.document.scope index 482a9e9476..3e0daecfa3 100644 --- a/data/fixtures/scopes/csharp/statement.iteration.document.scope +++ b/data/fixtures/scopes/csharp/statement.iteration.document.scope @@ -1,5 +1,5 @@ -class MyClass {} +int foo; --- @@ -7,6 +7,6 @@ class MyClass {} [Domain] = 0:0-2:0 > 0| -1| class MyClass {} +1| int foo; 2| < diff --git a/data/fixtures/scopes/csharp/type.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/csharp/type.argument.formal.constructor.iteration.scope index 63f840500e..d34ccee9b7 100644 --- a/data/fixtures/scopes/csharp/type.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/csharp/type.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, int b) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| MyClass(int a, int b) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:12-1:24 +[#3 Range] = +[#3 Domain] = 1:12-1:24 >------------< 1| MyClass(int a, int b) {} diff --git a/data/fixtures/scopes/csharp/type.argument.formal.iteration.scope b/data/fixtures/scopes/csharp/type.argument.formal.iteration.scope index abc43026fe..d259181d93 100644 --- a/data/fixtures/scopes/csharp/type.argument.formal.iteration.scope +++ b/data/fixtures/scopes/csharp/type.argument.formal.iteration.scope @@ -1,7 +1,13 @@ void myFunk(String name, int value) {} --- -[Range] = -[Domain] = 0:12-0:34 +[#1 Range] = +[#1 Domain] = 0:0-0:38 + >--------------------------------------< +0| void myFunk(String name, int value) {} + + +[#2 Range] = +[#2 Domain] = 0:12-0:34 >----------------------< 0| void myFunk(String name, int value) {} diff --git a/data/fixtures/scopes/csharp/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/csharp/type.argument.formal.method.iteration.scope index b8d7f6461c..863db54f72 100644 --- a/data/fixtures/scopes/csharp/type.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/csharp/type.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, int b) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:15-2:0 > 0| class MyClass { 1| void funk(int a, int b) {} @@ -12,7 +21,7 @@ class MyClass { < -[#2 Range] = -[#2 Domain] = 1:14-1:26 +[#3 Range] = +[#3 Domain] = 1:14-1:26 >------------< 1| void funk(int a, int b) {} diff --git a/data/fixtures/scopes/csharp/type.field.iteration.scope b/data/fixtures/scopes/csharp/type.field.iteration.scope deleted file mode 100644 index 4eaba49f3c..0000000000 --- a/data/fixtures/scopes/csharp/type.field.iteration.scope +++ /dev/null @@ -1,7 +0,0 @@ -class MyClass { } ---- - -[Range] = -[Domain] = 0:15-0:16 - >-< -0| class MyClass { } diff --git a/data/fixtures/scopes/csharp/type.iteration.block.scope b/data/fixtures/scopes/csharp/type.iteration.block.scope new file mode 100644 index 0000000000..cf58c9ddb6 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.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/type.iteration.block2.scope b/data/fixtures/scopes/csharp/type.iteration.block2.scope new file mode 100644 index 0000000000..ebc8bdb16c --- /dev/null +++ b/data/fixtures/scopes/csharp/type.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/type.iteration.block3.scope b/data/fixtures/scopes/csharp/type.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/csharp/type.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/type.iteration.block4.scope b/data/fixtures/scopes/csharp/type.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.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/c/name.iteration.block.scope b/data/fixtures/scopes/csharp/type.iteration.class.scope similarity index 70% rename from data/fixtures/scopes/c/name.iteration.block.scope rename to data/fixtures/scopes/csharp/type.iteration.class.scope index 95df2cd3c4..d68d97881e 100644 --- a/data/fixtures/scopes/c/name.iteration.block.scope +++ b/data/fixtures/scopes/csharp/type.iteration.class.scope @@ -1,13 +1,13 @@ -if (true) { } +class Foo { } --- [#1 Range] = [#1 Domain] = 0:0-0:13 >-------------< -0| if (true) { } +0| class Foo { } [#2 Range] = [#2 Domain] = 0:11-0:12 >-< -0| if (true) { } +0| class Foo { } diff --git a/data/fixtures/scopes/csharp/type.iteration.document.scope b/data/fixtures/scopes/csharp/type.iteration.document.scope new file mode 100644 index 0000000000..3e0daecfa3 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.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/csharp/type.typeArgument.iteration.scope b/data/fixtures/scopes/csharp/type.typeArgument.iteration.scope index 68b192c991..2bdfd7bb95 100644 --- a/data/fixtures/scopes/csharp/type.typeArgument.iteration.scope +++ b/data/fixtures/scopes/csharp/type.typeArgument.iteration.scope @@ -1,7 +1,13 @@ Dictionary values; --- -[Range] = -[Domain] = 0:11-0:22 +[#1 Range] = +[#1 Domain] = 0:0-0:31 + >-------------------------------< +0| Dictionary values; + + +[#2 Range] = +[#2 Domain] = 0:11-0:22 >-----------< 0| Dictionary values; diff --git a/data/fixtures/scopes/csharp/value.iteration.document.scope b/data/fixtures/scopes/csharp/value.iteration.document.scope index 4da6d738ac..3e0daecfa3 100644 --- a/data/fixtures/scopes/csharp/value.iteration.document.scope +++ b/data/fixtures/scopes/csharp/value.iteration.document.scope @@ -1,18 +1,12 @@ -class Foo { } +int foo; --- -[#1 Range] = -[#1 Domain] = 0:0-2:0 +[Range] = +[Domain] = 0:0-2:0 > 0| -1| class Foo { } +1| int foo; 2| < - - -[#2 Range] = -[#2 Domain] = 1:11-1:12 - >-< -1| class Foo { } diff --git a/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope index 50d913086a..d49abc5a0b 100644 --- a/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/java/name.argument.formal.constructor.iteration.scope @@ -1,5 +1,5 @@ public class MyClass { - public MyClass(String name, int value) { } + public MyClass(String name, int value) {} } --- @@ -7,7 +7,7 @@ public class MyClass { [#1 Domain] = 0:0-2:1 >---------------------- 0| public class MyClass { -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} 2| } -< @@ -16,21 +16,12 @@ public class MyClass { [#2 Domain] = 0:22-2:0 > 0| public class MyClass { -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} 2| } < -[#3 Range] = 1:19-1:41 +[#3 Range] = +[#3 Domain] = 1:19-1:41 >----------------------< -1| public MyClass(String name, int value) { } - -[#3 Domain] = 1:18-1:42 - >------------------------< -1| public MyClass(String name, int value) { } - - -[#4 Range] = -[#4 Domain] = 1:44-1:45 - >-< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} diff --git a/data/fixtures/scopes/java/name.argument.formal.constructor.scope b/data/fixtures/scopes/java/name.argument.formal.constructor.scope index 50c40d9133..30b58135a3 100644 --- a/data/fixtures/scopes/java/name.argument.formal.constructor.scope +++ b/data/fixtures/scopes/java/name.argument.formal.constructor.scope @@ -1,5 +1,5 @@ public class MyClass { - public MyClass(String name, int value) { } + public MyClass(String name, int value) {} } --- @@ -22,7 +22,7 @@ public class MyClass { [#1 Domain] = 0:0-2:1 >---------------------- 0| public class MyClass { -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} 2| } -< @@ -32,52 +32,52 @@ public class MyClass { [#2 Content] = [#2 Removal] = 1:11-1:18 >-------< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#2 Leading delimiter] = 1:10-1:11 >-< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} -[#2 Domain] = 1:4-1:46 - >------------------------------------------< -1| public MyClass(String name, int value) { } +[#2 Domain] = 1:4-1:45 + >-----------------------------------------< +1| public MyClass(String name, int value) {} [#2 Insertion delimiter] = " " [#3 Content] = 1:26-1:30 >----< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#3 Removal] = 1:25-1:30 >-----< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#3 Leading delimiter] = 1:25-1:26 >-< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#3 Domain] = 1:19-1:30 >-----------< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#3 Insertion delimiter] = " " [#4 Content] = 1:36-1:41 >-----< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#4 Removal] = 1:35-1:41 >------< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#4 Leading delimiter] = 1:35-1:36 >-< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#4 Domain] = 1:32-1:41 >---------< -1| public MyClass(String name, int value) { } +1| public MyClass(String name, int value) {} [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope index 16fe113757..645f6793a2 100644 --- a/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/java/name.argument.formal.method.iteration.scope @@ -1,5 +1,5 @@ public class MyClass { - public void foo(String name, int value) { } + public void foo(String name, int value) {} } --- @@ -7,7 +7,7 @@ public class MyClass { [#1 Domain] = 0:0-2:1 >---------------------- 0| public class MyClass { -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} 2| } -< @@ -16,21 +16,12 @@ public class MyClass { [#2 Domain] = 0:22-2:0 > 0| public class MyClass { -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} 2| } < -[#3 Range] = 1:20-1:42 +[#3 Range] = +[#3 Domain] = 1:20-1:42 >----------------------< -1| public void foo(String name, int value) { } - -[#3 Domain] = 1:19-1:43 - >------------------------< -1| public void foo(String name, int value) { } - - -[#4 Range] = -[#4 Domain] = 1:45-1:46 - >-< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} diff --git a/data/fixtures/scopes/java/name.argument.formal.method.scope b/data/fixtures/scopes/java/name.argument.formal.method.scope index 512229ce6e..123d38ee89 100644 --- a/data/fixtures/scopes/java/name.argument.formal.method.scope +++ b/data/fixtures/scopes/java/name.argument.formal.method.scope @@ -1,5 +1,5 @@ public class MyClass { - public void foo(String name, int value) { } + public void foo(String name, int value) {} } --- @@ -22,7 +22,7 @@ public class MyClass { [#1 Domain] = 0:0-2:1 >---------------------- 0| public class MyClass { -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} 2| } -< @@ -32,52 +32,52 @@ public class MyClass { [#2 Content] = [#2 Removal] = 1:16-1:19 >---< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#2 Leading delimiter] = 1:15-1:16 >-< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} -[#2 Domain] = 1:4-1:47 - >-------------------------------------------< -1| public void foo(String name, int value) { } +[#2 Domain] = 1:4-1:46 + >------------------------------------------< +1| public void foo(String name, int value) {} [#2 Insertion delimiter] = " " [#3 Content] = 1:27-1:31 >----< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#3 Removal] = 1:26-1:31 >-----< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#3 Leading delimiter] = 1:26-1:27 >-< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#3 Domain] = 1:20-1:31 >-----------< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#3 Insertion delimiter] = " " [#4 Content] = 1:37-1:42 >-----< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#4 Removal] = 1:36-1:42 >------< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#4 Leading delimiter] = 1:36-1:37 >-< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#4 Domain] = 1:33-1:42 >---------< -1| public void foo(String name, int value) { } +1| public void foo(String name, int value) {} [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/statement.iteration.block.scope b/data/fixtures/scopes/java/statement.iteration.class.scope similarity index 70% rename from data/fixtures/scopes/c/statement.iteration.block.scope rename to data/fixtures/scopes/java/statement.iteration.class.scope index 95df2cd3c4..d68d97881e 100644 --- a/data/fixtures/scopes/c/statement.iteration.block.scope +++ b/data/fixtures/scopes/java/statement.iteration.class.scope @@ -1,13 +1,13 @@ -if (true) { } +class Foo { } --- [#1 Range] = [#1 Domain] = 0:0-0:13 >-------------< -0| if (true) { } +0| class Foo { } [#2 Range] = [#2 Domain] = 0:11-0:12 >-< -0| if (true) { } +0| class Foo { } diff --git a/data/fixtures/scopes/java/statement.iteration.class2.scope b/data/fixtures/scopes/java/statement.iteration.class2.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/statement.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/type.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/java/type.argument.formal.constructor.iteration.scope index 714362b4ef..fc1f29963c 100644 --- a/data/fixtures/scopes/java/type.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/java/type.argument.formal.constructor.iteration.scope @@ -4,7 +4,16 @@ public class MyClass { --- [#1 Range] = -[#1 Domain] = 0:22-2:0 +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public MyClass(String name, int age) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:22-2:0 > 0| public class MyClass { 1| public MyClass(String name, int age) {} @@ -12,10 +21,7 @@ public class MyClass { < -[#2 Range] = 1:19-1:39 +[#3 Range] = +[#3 Domain] = 1:19-1:39 >--------------------< 1| public MyClass(String name, int age) {} - -[#2 Domain] = 1:18-1:40 - >----------------------< -1| public MyClass(String name, int age) {} diff --git a/data/fixtures/scopes/java/type.argument.formal.constructor.scope b/data/fixtures/scopes/java/type.argument.formal.constructor.scope index d84500fc1b..ff576258e6 100644 --- a/data/fixtures/scopes/java/type.argument.formal.constructor.scope +++ b/data/fixtures/scopes/java/type.argument.formal.constructor.scope @@ -1,5 +1,5 @@ public class MyClass { - public MyClass(final int value) { } + public MyClass(final int value) {} } --- @@ -8,7 +8,7 @@ public class MyClass { [#1 Domain] = 0:0-2:1 >---------------------- 0| public class MyClass { -1| public MyClass(final int value) { } +1| public MyClass(final int value) {} 2| } -< @@ -17,22 +17,22 @@ public class MyClass { [#2 Content] = 1:25-1:28 >---< -1| public MyClass(final int value) { } +1| public MyClass(final int value) {} [#2 Removal] = 1:25-1:29 >----< -1| public MyClass(final int value) { } +1| public MyClass(final int value) {} [#2 Leading delimiter] = 1:24-1:25 >-< -1| public MyClass(final int value) { } +1| public MyClass(final int value) {} [#2 Trailing delimiter] = 1:28-1:29 >-< -1| public MyClass(final int value) { } +1| public MyClass(final int value) {} [#2 Domain] = 1:19-1:34 >---------------< -1| public MyClass(final int value) { } +1| public MyClass(final int value) {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/java/type.argument.formal.method.iteration.scope index ba89f570c1..4d7146a39e 100644 --- a/data/fixtures/scopes/java/type.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/java/type.argument.formal.method.iteration.scope @@ -4,7 +4,16 @@ public class MyClass { --- [#1 Range] = -[#1 Domain] = 0:22-2:0 +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public class MyClass { +1| public void foo(String name, int age) {} +2| } + -< + + +[#2 Range] = +[#2 Domain] = 0:22-2:0 > 0| public class MyClass { 1| public void foo(String name, int age) {} @@ -12,10 +21,7 @@ public class MyClass { < -[#2 Range] = 1:20-1:40 +[#3 Range] = +[#3 Domain] = 1:20-1:40 >--------------------< 1| public void foo(String name, int age) {} - -[#2 Domain] = 1:19-1:41 - >----------------------< -1| public void foo(String name, int age) {} diff --git a/data/fixtures/scopes/java/type.argument.formal.method.scope b/data/fixtures/scopes/java/type.argument.formal.method.scope index 2648209983..51cdda94c6 100644 --- a/data/fixtures/scopes/java/type.argument.formal.method.scope +++ b/data/fixtures/scopes/java/type.argument.formal.method.scope @@ -1,5 +1,5 @@ public class MyClass { - public void foo(final int value) { } + public void foo(final int value) {} } --- @@ -8,7 +8,7 @@ public class MyClass { [#1 Domain] = 0:0-2:1 >---------------------- 0| public class MyClass { -1| public void foo(final int value) { } +1| public void foo(final int value) {} 2| } -< @@ -17,45 +17,45 @@ public class MyClass { [#2 Content] = 1:11-1:15 >----< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#2 Removal] = 1:11-1:16 >-----< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#2 Leading delimiter] = 1:10-1:11 >-< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#2 Trailing delimiter] = 1:15-1:16 >-< -1| public void foo(final int value) { } +1| public void foo(final int value) {} -[#2 Domain] = 1:4-1:40 - >------------------------------------< -1| public void foo(final int value) { } +[#2 Domain] = 1:4-1:39 + >-----------------------------------< +1| public void foo(final int value) {} [#2 Insertion delimiter] = " " [#3 Content] = 1:26-1:29 >---< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#3 Removal] = 1:26-1:30 >----< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#3 Leading delimiter] = 1:25-1:26 >-< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#3 Trailing delimiter] = 1:29-1:30 >-< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#3 Domain] = 1:20-1:35 >---------------< -1| public void foo(final int value) { } +1| public void foo(final int value) {} [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.field.iteration.scope b/data/fixtures/scopes/java/type.field.iteration.scope deleted file mode 100644 index 1aa65a64ac..0000000000 --- a/data/fixtures/scopes/java/type.field.iteration.scope +++ /dev/null @@ -1,18 +0,0 @@ -class MyClass { - Map foo; -} ---- - -[#1 Range] = -[#1 Domain] = 0:15-2:0 - > -0| class MyClass { -1| Map foo; -2| } - < - - -[#2 Range] = -[#2 Domain] = 1:8-1:16 - >--------< -1| Map foo; diff --git a/data/fixtures/scopes/java/type.iteration.block.scope b/data/fixtures/scopes/java/type.iteration.block.scope new file mode 100644 index 0000000000..4d4bdd63b9 --- /dev/null +++ b/data/fixtures/scopes/java/type.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/type.iteration.block2.scope b/data/fixtures/scopes/java/type.iteration.block2.scope new file mode 100644 index 0000000000..dd07df8311 --- /dev/null +++ b/data/fixtures/scopes/java/type.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/type.iteration.block3.scope b/data/fixtures/scopes/java/type.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/java/type.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/type.iteration.block4.scope b/data/fixtures/scopes/java/type.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/java/type.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/c/value.iteration.block.scope b/data/fixtures/scopes/java/type.iteration.class.scope similarity index 70% rename from data/fixtures/scopes/c/value.iteration.block.scope rename to data/fixtures/scopes/java/type.iteration.class.scope index 95df2cd3c4..d68d97881e 100644 --- a/data/fixtures/scopes/c/value.iteration.block.scope +++ b/data/fixtures/scopes/java/type.iteration.class.scope @@ -1,13 +1,13 @@ -if (true) { } +class Foo { } --- [#1 Range] = [#1 Domain] = 0:0-0:13 >-------------< -0| if (true) { } +0| class Foo { } [#2 Range] = [#2 Domain] = 0:11-0:12 >-< -0| if (true) { } +0| class Foo { } diff --git a/data/fixtures/scopes/java/type.iteration.class2.scope b/data/fixtures/scopes/java/type.iteration.class2.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/type.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/type.iteration.document.scope b/data/fixtures/scopes/java/type.iteration.document.scope new file mode 100644 index 0000000000..3e0daecfa3 --- /dev/null +++ b/data/fixtures/scopes/java/type.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/java/type.typeArgument.iteration.scope b/data/fixtures/scopes/java/type.typeArgument.iteration.scope index f51d7acf21..1928d94e7c 100644 --- a/data/fixtures/scopes/java/type.typeArgument.iteration.scope +++ b/data/fixtures/scopes/java/type.typeArgument.iteration.scope @@ -1,7 +1,13 @@ Map foo; --- -[Range] = -[Domain] = 0:4-0:12 +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| Map foo; + + +[#2 Range] = +[#2 Domain] = 0:4-0:12 >--------< 0| Map foo; diff --git a/data/fixtures/scopes/javascript.core/statement.iteration.class.scope b/data/fixtures/scopes/javascript.core/statement.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement.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/python/name.argument.actual.iteration.scope b/data/fixtures/scopes/python/name.argument.actual.iteration.scope index f944e40b4b..e62b3cf13d 100644 --- a/data/fixtures/scopes/python/name.argument.actual.iteration.scope +++ b/data/fixtures/scopes/python/name.argument.actual.iteration.scope @@ -7,10 +7,7 @@ aaa(bbb=0, ccc=1) 0| aaa(bbb=0, ccc=1) -[#2 Range] = 0:4-0:16 +[#2 Range] = +[#2 Domain] = 0:4-0:16 >------------< 0| aaa(bbb=0, ccc=1) - -[#2 Domain] = 0:3-0:17 - >--------------< -0| aaa(bbb=0, ccc=1) diff --git a/data/fixtures/scopes/python/statement.iteration.class.scope b/data/fixtures/scopes/python/statement.iteration.class.scope new file mode 100644 index 0000000000..6a16802260 --- /dev/null +++ b/data/fixtures/scopes/python/statement.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/type.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/python/type.argument.formal.constructor.iteration.scope index a4a11adb23..0f9c24d9f4 100644 --- a/data/fixtures/scopes/python/type.argument.formal.constructor.iteration.scope +++ b/data/fixtures/scopes/python/type.argument.formal.constructor.iteration.scope @@ -4,20 +4,29 @@ class MyClass: --- [#1 Range] = -[#1 Domain] = 1:4-2:12 - >--------------------------- +[#1 Domain] = 0:0-2:12 + >-------------- +0| class MyClass: 1| def __init__(self, a: int): 2| pass ------------< [#2 Range] = -[#2 Domain] = 1:17-1:29 - >------------< +[#2 Domain] = 1:4-2:12 + >--------------------------- 1| def __init__(self, a: int): +2| pass + ------------< [#3 Range] = -[#3 Domain] = 2:8-2:12 +[#3 Domain] = 1:17-1:29 + >------------< +1| def __init__(self, a: int): + + +[#4 Range] = +[#4 Domain] = 2:8-2:12 >----< 2| pass diff --git a/data/fixtures/scopes/python/type.argument.formal.iteration.scope b/data/fixtures/scopes/python/type.argument.formal.iteration.scope index eb330f978c..258edf1d33 100644 --- a/data/fixtures/scopes/python/type.argument.formal.iteration.scope +++ b/data/fixtures/scopes/python/type.argument.formal.iteration.scope @@ -3,12 +3,20 @@ def funk(a: int): --- [#1 Range] = -[#1 Domain] = 0:9-0:15 - >------< +[#1 Domain] = 0:0-1:8 + >----------------- 0| def funk(a: int): +1| pass + --------< [#2 Range] = -[#2 Domain] = 1:4-1:8 +[#2 Domain] = 0:9-0:15 + >------< +0| def funk(a: int): + + +[#3 Range] = +[#3 Domain] = 1:4-1:8 >----< 1| pass diff --git a/data/fixtures/scopes/python/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/python/type.argument.formal.method.iteration.scope index 72a40dceda..d4e87dd90c 100644 --- a/data/fixtures/scopes/python/type.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/python/type.argument.formal.method.iteration.scope @@ -4,20 +4,29 @@ class MyClass: --- [#1 Range] = -[#1 Domain] = 1:4-2:12 - >----------------- +[#1 Domain] = 0:0-2:12 + >-------------- +0| class MyClass: 1| def funk(a: int): 2| pass ------------< [#2 Range] = -[#2 Domain] = 1:13-1:19 - >------< +[#2 Domain] = 1:4-2:12 + >----------------- 1| def funk(a: int): +2| pass + ------------< [#3 Range] = -[#3 Domain] = 2:8-2:12 +[#3 Domain] = 1:13-1:19 + >------< +1| def funk(a: int): + + +[#4 Range] = +[#4 Domain] = 2:8-2:12 >----< 2| pass diff --git a/data/fixtures/scopes/python/type.field.iteration.scope b/data/fixtures/scopes/python/type.field.iteration.scope deleted file mode 100644 index d6006c7166..0000000000 --- a/data/fixtures/scopes/python/type.field.iteration.scope +++ /dev/null @@ -1,8 +0,0 @@ -class MyClass: - a: int ---- - -[Range] = -[Domain] = 1:4-1:10 - >------< -1| a: int diff --git a/data/fixtures/scopes/python/type.iteration.block.scope b/data/fixtures/scopes/python/type.iteration.block.scope new file mode 100644 index 0000000000..ec2e6429b2 --- /dev/null +++ b/data/fixtures/scopes/python/type.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/type.iteration.block2.scope b/data/fixtures/scopes/python/type.iteration.block2.scope new file mode 100644 index 0000000000..d22d90cda3 --- /dev/null +++ b/data/fixtures/scopes/python/type.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/type.iteration.block3.scope b/data/fixtures/scopes/python/type.iteration.block3.scope new file mode 100644 index 0000000000..382f662f8d --- /dev/null +++ b/data/fixtures/scopes/python/type.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/type.iteration.block4.scope b/data/fixtures/scopes/python/type.iteration.block4.scope new file mode 100644 index 0000000000..98a8f15c8f --- /dev/null +++ b/data/fixtures/scopes/python/type.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/type.iteration.class.scope b/data/fixtures/scopes/python/type.iteration.class.scope new file mode 100644 index 0000000000..6a16802260 --- /dev/null +++ b/data/fixtures/scopes/python/type.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/type.iteration.document.scope b/data/fixtures/scopes/python/type.iteration.document.scope new file mode 100644 index 0000000000..10eeeb6737 --- /dev/null +++ b/data/fixtures/scopes/python/type.iteration.document.scope @@ -0,0 +1,12 @@ + +foo + +--- + +[Range] = +[Domain] = 0:0-2:0 + > +0| +1| foo +2| + < diff --git a/data/fixtures/scopes/python/type.typeArgument.iteration.scope b/data/fixtures/scopes/python/type.typeArgument.iteration.scope index 58ac26d611..855e3ce1bd 100644 --- a/data/fixtures/scopes/python/type.typeArgument.iteration.scope +++ b/data/fixtures/scopes/python/type.typeArgument.iteration.scope @@ -1,7 +1,13 @@ value: map[str, int] --- -[Range] = -[Domain] = 0:11-0:19 +[#1 Range] = +[#1 Domain] = 0:0-0:20 + >--------------------< +0| value: map[str, int] + + +[#2 Range] = +[#2 Domain] = 0:11-0:19 >--------< 0| value: map[str, int] diff --git a/data/fixtures/scopes/python/value.argument.actual.iteration.scope b/data/fixtures/scopes/python/value.argument.actual.iteration.scope index f944e40b4b..e62b3cf13d 100644 --- a/data/fixtures/scopes/python/value.argument.actual.iteration.scope +++ b/data/fixtures/scopes/python/value.argument.actual.iteration.scope @@ -7,10 +7,7 @@ aaa(bbb=0, ccc=1) 0| aaa(bbb=0, ccc=1) -[#2 Range] = 0:4-0:16 +[#2 Range] = +[#2 Domain] = 0:4-0:16 >------------< 0| aaa(bbb=0, ccc=1) - -[#2 Domain] = 0:3-0:17 - >--------------< -0| aaa(bbb=0, ccc=1) diff --git a/data/fixtures/scopes/typescript.core/type.iteration.block.scope b/data/fixtures/scopes/typescript.core/type.iteration.block.scope new file mode 100644 index 0000000000..cf58c9ddb6 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.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/typescript.core/type.iteration.block2.scope b/data/fixtures/scopes/typescript.core/type.iteration.block2.scope new file mode 100644 index 0000000000..631a35c951 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.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/typescript.core/type.iteration.block3.scope b/data/fixtures/scopes/typescript.core/type.iteration.block3.scope new file mode 100644 index 0000000000..0a78aceb4c --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.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/typescript.core/type.iteration.block4.scope b/data/fixtures/scopes/typescript.core/type.iteration.block4.scope new file mode 100644 index 0000000000..e38a055e01 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.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/typescript.core/type.iteration.class.scope b/data/fixtures/scopes/typescript.core/type.iteration.class.scope new file mode 100644 index 0000000000..d68d97881e --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.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/typescript.core/type.iteration.document.scope b/data/fixtures/scopes/typescript.core/type.iteration.document.scope new file mode 100644 index 0000000000..cf1e2c36ea --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.iteration.document.scope @@ -0,0 +1,12 @@ + +let foo; + +--- + +[Range] = +[Domain] = 0:0-2:0 + > +0| +1| let foo; +2| + < diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index dbb135abb2..83c701e737 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -12,6 +12,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { statement: supported, "statement.class": supported, "statement.iteration.document": supported, + "statement.iteration.class": supported, "statement.iteration.block": supported, class: supported, @@ -74,11 +75,11 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.function": supported, "name.class": supported, "name.field": supported, + "name.argument.formal": supported, + "name.argument.formal.iteration": supported, "name.iteration.block": supported, "name.iteration.class": supported, "name.iteration.document": supported, - "name.argument.formal": supported, - "name.argument.formal.iteration": supported, "value.assignment": supported, "value.variable": supported, @@ -91,11 +92,13 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal": supported, "type.argument.formal.iteration": supported, "type.field": supported, - "type.field.iteration": supported, "type.enum": supported, "type.cast": supported, "type.class": supported, "type.return": supported, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.iteration.document": supported, "interior.class": supported, "interior.function": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 20b004ce90..032ba1c351 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -68,11 +68,11 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.field": supported, "name.foreach": supported, "name.function": supported, + "name.method": supported, + "name.variable": supported, "name.iteration.block": supported, "name.iteration.class": supported, "name.iteration.document": supported, - "name.method": supported, - "name.variable": supported, "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, @@ -103,13 +103,15 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "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, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.iteration.document": supported, "key.mapPair": supported, "key.mapPair.iteration": supported, @@ -156,6 +158,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { statement: supported, "statement.class": supported, "statement.iteration.block": supported, + "statement.iteration.class": supported, "statement.iteration.document": supported, "string.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index b2d2925b9b..bcfa197536 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -171,6 +171,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { section: notApplicable, startTag: notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.class": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -188,7 +189,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": notApplicable, "type.class": notApplicable, "type.enum": notApplicable, - "type.field.iteration": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, @@ -198,6 +198,9 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.actual": notApplicable, "value.argument.formal.constructor.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 2160d6228d..77482b5036 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -141,6 +141,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, "statement.class": notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, "textFragment.comment.line": notApplicable, @@ -155,7 +156,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": notApplicable, "type.class": notApplicable, "type.enum": notApplicable, - "type.field.iteration": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, @@ -165,6 +165,9 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.actual": notApplicable, "value.argument.formal.constructor.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index e4343ed47e..dd90c3e0bc 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -85,6 +85,21 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "functionName.method": supported, "functionName.method.iteration.class": supported, + ifStatement: supported, + statement: supported, + "statement.class": supported, + "statement.iteration.block": supported, + "statement.iteration.class": supported, + "statement.iteration.document": supported, + + "string.singleLine": supported, + "string.multiLine": supported, + + "textFragment.comment.block": supported, + "textFragment.comment.line": supported, + "textFragment.string.singleLine": supported, + "textFragment.string.multiLine": supported, + "name.argument.formal.constructor": supported, "name.argument.formal.constructor.iteration": supported, "name.argument.formal.method": supported, @@ -101,19 +116,16 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.block": supported, "name.resource": supported, - ifStatement: supported, - statement: supported, - "statement.class": supported, - "statement.iteration.block": supported, - "statement.iteration.document": supported, - - "string.singleLine": supported, - "string.multiLine": supported, - - "textFragment.comment.block": supported, - "textFragment.comment.line": supported, - "textFragment.string.singleLine": supported, - "textFragment.string.multiLine": supported, + "value.assignment": supported, + "value.foreach": supported, + "value.field": supported, + "value.return": supported, + "value.return.lambda": supported, + "value.variable": supported, + "value.resource": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, "type.argument.formal.constructor": supported, "type.argument.formal.method": supported, @@ -121,7 +133,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": supported, "type.foreach": supported, "type.field": supported, - "type.field.iteration": supported, "type.return": supported, "type.variable": supported, "type.typeArgument": supported, @@ -131,17 +142,9 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.class": supported, "type.enum": supported, "type.interface": supported, - - "value.assignment": supported, - "value.foreach": supported, - "value.field": supported, - "value.return": supported, - "value.return.lambda": supported, - "value.variable": supported, - "value.resource": supported, - "value.iteration.block": supported, - "value.iteration.class": supported, - "value.iteration.document": supported, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.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 a493d18f53..9219c2b186 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -23,9 +23,10 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, + "statement.class": supported, "statement.iteration.document": supported, + "statement.iteration.class": supported, "statement.iteration.block": supported, - "statement.class": supported, class: supported, "class.iteration.document": supported, @@ -256,7 +257,6 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.alias": notApplicable, "type.cast": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.enum": notApplicable, @@ -264,6 +264,9 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.variable": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.typeAlias": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 6550bb6f1e..aaed01ff58 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -164,6 +164,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { statement: notApplicable, "statement.class": notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -181,15 +182,17 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.variable": notApplicable, + "type.return": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, - "type.return": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.formal": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index fabc415f80..3091947945 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -158,6 +158,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { statement: notApplicable, "statement.class": notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, "string.singleLine": notApplicable, @@ -178,15 +179,17 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.variable": notApplicable, + "type.return": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, - "type.return": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.formal": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index c1ac6b9f17..2d289e1e48 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -60,11 +60,13 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal": supported, "type.class": supported, "type.field": supported, - "type.field.iteration": supported, "type.return": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.variable": supported, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.iteration.document": supported, anonymousFunction: supported, namedFunction: supported, @@ -176,6 +178,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { statement: supported, "statement.class": supported, "statement.iteration.block": supported, + "statement.iteration.class": supported, "statement.iteration.document": supported, functionCall: supported, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index 9771532caa..ddf6671e9d 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -98,12 +98,12 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.return": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, - "type.return": notApplicable, + "type.iteration.class": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.variable": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index fa61439a70..7162985e74 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -161,6 +161,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { startTag: notApplicable, "statement.class": notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -179,15 +180,17 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.variable": notApplicable, + "type.return": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, - "type.return": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.formal": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 144dad861a..1b17ed781b 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -93,6 +93,12 @@ export const scopeSupportFacetInfos: Record< scopeType: "statement", isIteration: true, }, + "statement.iteration.class": { + description: + "Iteration scope for type in a class / interface; should be entire class / interface body", + scopeType: "statement", + isIteration: true, + }, "statement.iteration.block": { description: "Iteration scope for statements. Statement blocks(body of functions/if statements/for loops/etc).", @@ -823,12 +829,6 @@ export const scopeSupportFacetInfos: Record< description: "Type of field in a class / interface", scopeType: "type", }, - "type.field.iteration": { - description: - "Iteration scope for type of field in a class / interface; should be entire class / interface body", - scopeType: "type", - isIteration: true, - }, "type.foreach": { description: "Type of variable in a for each loop", scopeType: "type", @@ -873,6 +873,23 @@ export const scopeSupportFacetInfos: Record< scopeType: "type", isIteration: true, }, + "type.iteration.block": { + description: + "Iteration scope for types. Statement blocks(body of functions/if statements/for loops/etc).", + scopeType: "type", + isIteration: true, + }, + "type.iteration.class": { + description: + "Iteration scope for type in a class / interface; should be entire class / interface body", + scopeType: "type", + isIteration: true, + }, + "type.iteration.document": { + description: "Iteration scope for a type. This is the entire document.", + scopeType: "type", + isIteration: true, + }, "interior.element": { description: "The interior/children of a XML element", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 8b4e2b9cc8..adcac37621 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -3,6 +3,11 @@ import { type ScopeType } from "../types/command/PartialTargetDescriptor.types"; export const scopeSupportFacets = [ "command", + "environment", + "notebookCell", + "regularExpression", + "switchStatementSubject", + "fieldAccess", "element", "tags", @@ -10,22 +15,22 @@ export const scopeSupportFacets = [ "endTag", "attribute", - "environment", - "section", "section.iteration.document", "section.iteration.parent", + "selector", + "unit", + "list", "map", + "ifStatement", - "regularExpression", - "switchStatementSubject", - "fieldAccess", "statement", "statement.class", "statement.iteration.document", + "statement.iteration.class", "statement.iteration.block", "class", @@ -144,9 +149,6 @@ 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", @@ -157,6 +159,9 @@ export const scopeSupportFacets = [ "name.argument.formal.method.iteration", "name.argument.formal.constructor", "name.argument.formal.constructor.iteration", + "name.iteration.block", + "name.iteration.class", + "name.iteration.document", "key.attribute", "key.mapPair", @@ -173,10 +178,7 @@ 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", @@ -187,27 +189,32 @@ export const scopeSupportFacets = [ "value.argument.formal.method.iteration", "value.argument.formal.constructor", "value.argument.formal.constructor.iteration", + "value.iteration.block", + "value.iteration.class", + "value.iteration.document", "type.variable", - "type.argument.formal", - "type.argument.formal.iteration", - "type.argument.formal.method", - "type.argument.formal.method.iteration", - "type.argument.formal.constructor", - "type.argument.formal.constructor.iteration", "type.return", "type.field", - "type.field.iteration", "type.foreach", "type.interface", "type.enum", "type.alias", "type.cast", "type.class", - "type.typeArgument", - "type.typeArgument.iteration", "type.resource", "type.resource.iteration", + "type.typeArgument", + "type.typeArgument.iteration", + "type.argument.formal", + "type.argument.formal.iteration", + "type.argument.formal.method", + "type.argument.formal.method.iteration", + "type.argument.formal.constructor", + "type.argument.formal.constructor.iteration", + "type.iteration.block", + "type.iteration.class", + "type.iteration.document", "interior.class", "interior.function", @@ -230,10 +237,6 @@ export const scopeSupportFacets = [ "interior.resource", "interior.namespace", "interior.static", - - "notebookCell", - "selector", - "unit", ] as const; export interface ScopeSupportFacetInfo { diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index ce33412da9..72817336a8 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -175,6 +175,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, startTag: notApplicable, "statement.class": notApplicable, + "statement.iteration.class": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, "textFragment.comment.block": notApplicable, @@ -190,15 +191,17 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.return": notApplicable, + "type.variable": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.formal": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 31785b93e5..721032b36f 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -16,13 +16,15 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.alias": supported, "type.cast": 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, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.iteration.document": supported, "value.typeAlias": supported, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index e646d7b07b..27ecfb9596 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -160,6 +160,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { statement: notApplicable, "statement.class": notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -176,15 +177,17 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.return": notApplicable, + "type.variable": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.formal": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 7edd745ec7..87ef865b72 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -168,6 +168,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { statement: notApplicable, "statement.class": notApplicable, "statement.iteration.block": notApplicable, + "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, @@ -184,15 +185,17 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.class": notApplicable, "type.enum": notApplicable, "type.field": notApplicable, - "type.field.iteration": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.variable": notApplicable, + "type.return": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, - "type.return": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.formal": notApplicable, diff --git a/queries/c.scm b/queries/c.scm index 09c1f4f43e..d98a24cef1 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -42,19 +42,33 @@ ) ( - (translation_unit) @name.iteration @value.iteration - (#document-range! @name.iteration @value.iteration) + (translation_unit) @name.iteration @value.iteration @type.iteration + (#document-range! @name.iteration @value.iteration @type.iteration) +) + +;;!! struct Foo { }; +;;! ^ +;;!! union Foo { }; +;;! ^ +(field_declaration_list + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf ) (field_declaration_list - "{" @type.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf - "}" @type.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf ) ;; Body of statements (compound_statement - "{" @statement.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf - "}" @statement.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf +) + +(compound_statement + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf ) ( @@ -259,8 +273,8 @@ ) @argumentList.domain @argumentOrParameter.iteration.domain (parameter_list - "(" @type.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf - ")" @type.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf + "(" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + ")" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf ) ;;!! foo(aaa, bbb); diff --git a/queries/csharp.scm b/queries/csharp.scm index 57336cd62f..2b0833e330 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -59,8 +59,8 @@ ) ( - (compilation_unit) @name.iteration @value.iteration - (#document-range! @name.iteration @value.iteration) + (compilation_unit) @name.iteration @value.iteration @type.iteration + (#document-range! @name.iteration @value.iteration @type.iteration) ) ;;!! { } diff --git a/queries/java.scm b/queries/java.scm index 45d27f909d..e6d86e9a09 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -54,8 +54,8 @@ ) ( - (program) @name.iteration @value.iteration - (#document-range! @name.iteration @value.iteration) + (program) @name.iteration @value.iteration @type.iteration + (#document-range! @name.iteration @value.iteration @type.iteration) ) ;;!! class MyClass { } @@ -331,7 +331,7 @@ (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; ;;! ^^^^^^^^^^^^ diff --git a/queries/python.scm b/queries/python.scm index d346acea4a..3ffaba8969 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -261,8 +261,8 @@ ) (with_statement - (with_clause) @value.iteration @name.iteration -) @value.iteration.domain @name.iteration.domain + (with_clause) @name.iteration @value.iteration +) @name.iteration.domain @value.iteration.domain ;;!! lambda str: len(str) > 0 ;;! ^^^^^^^^^^^^ @@ -357,9 +357,9 @@ ( (module (_) @_statement - ) @value.iteration @name.iteration + ) @name.iteration @value.iteration @type.iteration (#not-type? @_statement "with_statement") - (#document-range! @value.iteration @name.iteration) + (#document-range! @name.iteration @value.iteration @type.iteration) ) ( @@ -378,8 +378,8 @@ ;;! ***** ;;!! c = 2 ;;! *****> -(block) @statement.iteration @value.iteration @name.iteration -(block) @type.iteration +(block) @name.iteration @value.iteration @type.iteration +(block) @statement.iteration ;;!! {"a": 1, "b": 2, "c": 3} ;;! ********************** @@ -740,7 +740,7 @@ (argument_list "(" @name.iteration.start.endOf @value.iteration.start.endOf ")" @name.iteration.end.startOf @value.iteration.end.startOf -) @name.iteration.domain @value.iteration.domain +) operators: [ "<" @@ -748,12 +748,14 @@ operators: [ ">" ">=" ] @disqualifyDelimiter + operator: [ "<<" "<<=" ">>" ">>=" ] @disqualifyDelimiter + (function_definition "->" @disqualifyDelimiter )