diff --git a/data/fixtures/scopes/c/name.field.scope b/data/fixtures/scopes/c/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/c/name.field.scope rename to data/fixtures/scopes/c/name.field.class.scope diff --git a/data/fixtures/scopes/c/name.field2.scope b/data/fixtures/scopes/c/name.field.class2.scope similarity index 100% rename from data/fixtures/scopes/c/name.field2.scope rename to data/fixtures/scopes/c/name.field.class2.scope diff --git a/data/fixtures/scopes/c/name.field3.scope b/data/fixtures/scopes/c/name.field.class3.scope similarity index 100% rename from data/fixtures/scopes/c/name.field3.scope rename to data/fixtures/scopes/c/name.field.class3.scope diff --git a/data/fixtures/scopes/c/statement.class.scope b/data/fixtures/scopes/c/statement.class.scope index 74ab361834..f6680edf50 100644 --- a/data/fixtures/scopes/c/statement.class.scope +++ b/data/fixtures/scopes/c/statement.class.scope @@ -1,48 +1,48 @@ -struct aaa { int bbb; }; -union bbb { int ccc; }; -enum ccc { ddd, eee }; +struct aaa {}; +union bbb {}; +enum ccc {}; -typedef struct { int fff; } ggg; -typedef union { int hhh; } iii; -typedef enum { jjj, kkk } lll; +typedef struct {} ddd; +typedef union {} eee; +typedef enum {} fff; --- [#1 Content] = -[#1 Domain] = 0:0-0:24 - >------------------------< -0| struct aaa { int bbb; }; +[#1 Domain] = 0:0-0:14 + >--------------< +0| struct aaa {}; [#1 Removal] = 0:0-1:0 - >------------------------ -0| struct aaa { int bbb; }; -1| union bbb { int ccc; }; + >-------------- +0| struct aaa {}; +1| union bbb {}; < [#1 Insertion delimiter] = "\n" [#2 Content] = -[#2 Domain] = 1:0-1:23 - >-----------------------< -1| union bbb { int ccc; }; +[#2 Domain] = 1:0-1:13 + >-------------< +1| union bbb {}; [#2 Removal] = 1:0-2:0 - >----------------------- -1| union bbb { int ccc; }; -2| enum ccc { ddd, eee }; + >------------- +1| union bbb {}; +2| enum ccc {}; < [#2 Insertion delimiter] = "\n" [#3 Content] = -[#3 Domain] = 2:0-2:22 - >----------------------< -2| enum ccc { ddd, eee }; +[#3 Domain] = 2:0-2:12 + >------------< +2| enum ccc {}; [#3 Removal] = 2:0-3:0 - >---------------------- -2| enum ccc { ddd, eee }; + >------------ +2| enum ccc {}; 3| < @@ -50,42 +50,42 @@ typedef enum { jjj, kkk } lll; [#4 Content] = -[#4 Domain] = 4:0-4:32 - >--------------------------------< -4| typedef struct { int fff; } ggg; +[#4 Domain] = 4:0-4:22 + >----------------------< +4| typedef struct {} ddd; [#4 Removal] = 4:0-5:0 - >-------------------------------- -4| typedef struct { int fff; } ggg; -5| typedef union { int hhh; } iii; + >---------------------- +4| typedef struct {} ddd; +5| typedef union {} eee; < [#4 Insertion delimiter] = "\n" [#5 Content] = -[#5 Domain] = 5:0-5:31 - >-------------------------------< -5| typedef union { int hhh; } iii; +[#5 Domain] = 5:0-5:21 + >---------------------< +5| typedef union {} eee; [#5 Removal] = 5:0-6:0 - >------------------------------- -5| typedef union { int hhh; } iii; -6| typedef enum { jjj, kkk } lll; + >--------------------- +5| typedef union {} eee; +6| typedef enum {} fff; < [#5 Insertion delimiter] = "\n" [#6 Content] = -[#6 Domain] = 6:0-6:30 - >------------------------------< -6| typedef enum { jjj, kkk } lll; - -[#6 Removal] = 5:31-6:30 - > -5| typedef union { int hhh; } iii; -6| typedef enum { jjj, kkk } lll; - ------------------------------< +[#6 Domain] = 6:0-6:20 + >--------------------< +6| typedef enum {} fff; + +[#6 Removal] = 5:21-6:20 + > +5| typedef union {} eee; +6| typedef enum {} fff; + --------------------< [#6 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement.field.class.scope b/data/fixtures/scopes/c/statement.field.class.scope new file mode 100644 index 0000000000..e57c6f1c0a --- /dev/null +++ b/data/fixtures/scopes/c/statement.field.class.scope @@ -0,0 +1,33 @@ +struct foo { + int bar; +}; +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:2 + >------------ +0| struct foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| }; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement.field.class2.scope b/data/fixtures/scopes/c/statement.field.class2.scope new file mode 100644 index 0000000000..5d66283a5d --- /dev/null +++ b/data/fixtures/scopes/c/statement.field.class2.scope @@ -0,0 +1,33 @@ +union foo { + int bar; +}; +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:2 + >----------- +0| union foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| }; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/type.field.class.scope b/data/fixtures/scopes/c/type.field.class.scope new file mode 100644 index 0000000000..dbd73b7fe3 --- /dev/null +++ b/data/fixtures/scopes/c/type.field.class.scope @@ -0,0 +1,38 @@ +struct foo { + int bar; +}; +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:2 + >------------ +0| struct foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/type.field.scope b/data/fixtures/scopes/c/type.field.class2.scope similarity index 53% rename from data/fixtures/scopes/cpp/type.field.scope rename to data/fixtures/scopes/c/type.field.class2.scope index 69c762d264..15bacc8a01 100644 --- a/data/fixtures/scopes/cpp/type.field.scope +++ b/data/fixtures/scopes/c/type.field.class2.scope @@ -1,38 +1,38 @@ -class Foo { - int aaa = 2; -} +union foo { + int bar; +}; --- [#1 Content] = [#1 Removal] = -[#1 Domain] = 0:0-2:1 +[#1 Domain] = 0:0-2:2 >----------- -0| class Foo { -1| int aaa = 2; -2| } - -< +0| union foo { +1| int bar; +2| }; + --< [#1 Insertion delimiter] = " " [#2 Content] = 1:4-1:7 >---< -1| int aaa = 2; +1| int bar; [#2 Removal] = 1:4-1:8 >----< -1| int aaa = 2; +1| int bar; [#2 Leading delimiter] = 1:0-1:4 >----< -1| int aaa = 2; +1| int bar; [#2 Trailing delimiter] = 1:7-1:8 >-< -1| int aaa = 2; +1| int bar; -[#2 Domain] = 1:4-1:16 - >------------< -1| int aaa = 2; +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/type.field.scope b/data/fixtures/scopes/c/type.field.scope deleted file mode 100644 index 825a4cde7b..0000000000 --- a/data/fixtures/scopes/c/type.field.scope +++ /dev/null @@ -1,33 +0,0 @@ -struct aaa { int bbb; }; ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-0:24 - >------------------------< -0| struct aaa { int bbb; }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 0:13-0:16 - >---< -0| struct aaa { int bbb; }; - -[#2 Removal] = 0:13-0:17 - >----< -0| struct aaa { int bbb; }; - -[#2 Leading delimiter] = 0:12-0:13 - >-< -0| struct aaa { int bbb; }; - -[#2 Trailing delimiter] = 0:16-0:17 - >-< -0| struct aaa { int bbb; }; - -[#2 Domain] = 0:13-0:21 - >--------< -0| struct aaa { int bbb; }; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/type.field2.scope b/data/fixtures/scopes/c/type.field2.scope deleted file mode 100644 index 87c3f37f68..0000000000 --- a/data/fixtures/scopes/c/type.field2.scope +++ /dev/null @@ -1,33 +0,0 @@ -union aaa { int bbb; }; ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| union aaa { int bbb; }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 0:12-0:15 - >---< -0| union aaa { int bbb; }; - -[#2 Removal] = 0:12-0:16 - >----< -0| union aaa { int bbb; }; - -[#2 Leading delimiter] = 0:11-0:12 - >-< -0| union aaa { int bbb; }; - -[#2 Trailing delimiter] = 0:15-0:16 - >-< -0| union aaa { int bbb; }; - -[#2 Domain] = 0:12-0:20 - >--------< -0| union aaa { int bbb; }; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name.field.class.scope b/data/fixtures/scopes/cpp/name.field.class.scope new file mode 100644 index 0000000000..91f93b5cc5 --- /dev/null +++ b/data/fixtures/scopes/cpp/name.field.class.scope @@ -0,0 +1,73 @@ +class Foo { + int bar; + int baz = 1; +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| class Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { + +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 1; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:8-2:11 + >---< +2| int baz = 1; + +[#3 Removal] = 2:8-2:12 + >----< +2| int baz = 1; + +[#3 Leading delimiter] = 2:7-2:8 + >-< +2| int baz = 1; + +[#3 Trailing delimiter] = 2:11-2:12 + >-< +2| int baz = 1; + +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 1; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name.field.scope b/data/fixtures/scopes/cpp/name.field.scope deleted file mode 100644 index ffc1fc0f7e..0000000000 --- a/data/fixtures/scopes/cpp/name.field.scope +++ /dev/null @@ -1,52 +0,0 @@ -class Foo { - int aaa = 2; -} ---- - -[#1 Content] = 0:6-0:9 - >---< -0| class Foo { - -[#1 Removal] = 0:6-0:10 - >----< -0| class Foo { - -[#1 Leading delimiter] = 0:5-0:6 - >-< -0| class Foo { - -[#1 Trailing delimiter] = 0:9-0:10 - >-< -0| class Foo { - -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| int aaa = 2; -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:8-1:11 - >---< -1| int aaa = 2; - -[#2 Removal] = 1:8-1:12 - >----< -1| int aaa = 2; - -[#2 Leading delimiter] = 1:7-1:8 - >-< -1| int aaa = 2; - -[#2 Trailing delimiter] = 1:11-1:12 - >-< -1| int aaa = 2; - -[#2 Domain] = 1:4-1:16 - >------------< -1| int aaa = 2; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/statement.class.scope b/data/fixtures/scopes/cpp/statement.class.scope index ee2f153e94..91e4c3fdb8 100644 --- a/data/fixtures/scopes/cpp/statement.class.scope +++ b/data/fixtures/scopes/cpp/statement.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" - - -[#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" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement.class2.scope b/data/fixtures/scopes/cpp/statement.class2.scope new file mode 100644 index 0000000000..dfe19a24fb --- /dev/null +++ b/data/fixtures/scopes/cpp/statement.class2.scope @@ -0,0 +1,10 @@ +enum class Foo {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| enum class Foo {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/type.field.class.scope b/data/fixtures/scopes/cpp/type.field.class.scope new file mode 100644 index 0000000000..f38bc25a02 --- /dev/null +++ b/data/fixtures/scopes/cpp/type.field.class.scope @@ -0,0 +1,63 @@ +class Foo { + int bar; + int baz = 1; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 1; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:4-2:7 + >---< +2| int baz = 1; + +[#3 Removal] = 2:4-2:8 + >----< +2| int baz = 1; + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 1; + +[#3 Trailing delimiter] = 2:7-2:8 + >-< +2| int baz = 1; + +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 1; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/value.field.scope b/data/fixtures/scopes/cpp/value.field.class.scope similarity index 70% rename from data/fixtures/scopes/cpp/value.field.scope rename to data/fixtures/scopes/cpp/value.field.class.scope index feff9f2520..b012818782 100644 --- a/data/fixtures/scopes/cpp/value.field.scope +++ b/data/fixtures/scopes/cpp/value.field.class.scope @@ -1,22 +1,22 @@ class Foo { - int aaa = 2; + int bar = 1; } --- [Content] = 1:14-1:15 >-< -1| int aaa = 2; +1| int bar = 1; [Removal] = 1:11-1:15 >----< -1| int aaa = 2; +1| int bar = 1; [Leading delimiter] = 1:11-1:14 >---< -1| int aaa = 2; +1| int bar = 1; [Domain] = 1:4-1:16 >------------< -1| int aaa = 2; +1| int bar = 1; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior.interface.scope b/data/fixtures/scopes/csharp/interior.interface.scope new file mode 100644 index 0000000000..e213945b2e --- /dev/null +++ b/data/fixtures/scopes/csharp/interior.interface.scope @@ -0,0 +1,25 @@ +interface IFoo { } +--- + +[#1 Content] = +[#1 Removal] = 0:16-0:17 + >-< +0| interface IFoo { } + +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:16-0:17 + >-< +0| interface IFoo { } + +[#2 Domain] = 0:15-0:18 + >---< +0| interface IFoo { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.class.scope b/data/fixtures/scopes/csharp/name.class.scope index 004c73ac7b..211086562c 100644 --- a/data/fixtures/scopes/csharp/name.class.scope +++ b/data/fixtures/scopes/csharp/name.class.scope @@ -1,24 +1,24 @@ -class MyClass {} +class Foo {} --- -[Content] = 0:6-0:13 - >-------< -0| class MyClass {} +[Content] = 0:6-0:9 + >---< +0| class Foo {} -[Removal] = 0:6-0:14 - >--------< -0| class MyClass {} +[Removal] = 0:6-0:10 + >----< +0| class Foo {} [Leading delimiter] = 0:5-0:6 >-< -0| class MyClass {} +0| class Foo {} -[Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass {} +[Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo {} -[Domain] = 0:0-0:16 - >----------------< -0| class MyClass {} +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.field.class.scope b/data/fixtures/scopes/csharp/name.field.class.scope new file mode 100644 index 0000000000..4573c4536d --- /dev/null +++ b/data/fixtures/scopes/csharp/name.field.class.scope @@ -0,0 +1,73 @@ +class Foo { + int bar; + int baz = 0; +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| class Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { + +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:8-2:11 + >---< +2| int baz = 0; + +[#3 Removal] = 2:8-2:12 + >----< +2| int baz = 0; + +[#3 Leading delimiter] = 2:7-2:8 + >-< +2| int baz = 0; + +[#3 Trailing delimiter] = 2:11-2:12 + >-< +2| int baz = 0; + +[#3 Domain] = 2:4-2:15 + >-----------< +2| int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.field.interface.scope b/data/fixtures/scopes/csharp/name.field.interface.scope new file mode 100644 index 0000000000..2bb7bdefc7 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.field.interface.scope @@ -0,0 +1,48 @@ +interface IFoo { + int bar; +} +--- + +[#1 Content] = 0:10-0:14 + >----< +0| interface IFoo { + +[#1 Removal] = 0:10-0:15 + >-----< +0| interface IFoo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface IFoo { + +[#1 Trailing delimiter] = 0:14-0:15 + >-< +0| interface IFoo { + +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.field.scope b/data/fixtures/scopes/csharp/name.field.scope deleted file mode 100644 index 1dea8fe9b3..0000000000 --- a/data/fixtures/scopes/csharp/name.field.scope +++ /dev/null @@ -1,48 +0,0 @@ -class MyClass { - int value; -} ---- - -[#1 Content] = 0:6-0:13 - >-------< -0| class MyClass { - -[#1 Removal] = 0:6-0:14 - >--------< -0| class MyClass { - -[#1 Leading delimiter] = 0:5-0:6 - >-< -0| class MyClass { - -[#1 Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass { - -[#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| int value; -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:8-1:13 - >-----< -1| int value; - -[#2 Removal] = 1:7-1:13 - >------< -1| int value; - -[#2 Leading delimiter] = 1:7-1:8 - >-< -1| int value; - -[#2 Domain] = 1:4-1:13 - >---------< -1| int value; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.interface.scope b/data/fixtures/scopes/csharp/name.interface.scope new file mode 100644 index 0000000000..61aab8b7ce --- /dev/null +++ b/data/fixtures/scopes/csharp/name.interface.scope @@ -0,0 +1,24 @@ +interface IFoo {} +--- + +[Content] = 0:10-0:14 + >----< +0| interface IFoo {} + +[Removal] = 0:10-0:15 + >-----< +0| interface IFoo {} + +[Leading delimiter] = 0:9-0:10 + >-< +0| interface IFoo {} + +[Trailing delimiter] = 0:14-0:15 + >-< +0| interface IFoo {} + +[Domain] = 0:0-0:17 + >-----------------< +0| interface IFoo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.iteration.interface.scope b/data/fixtures/scopes/csharp/name.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/data/fixtures/scopes/csharp/statement.class.scope b/data/fixtures/scopes/csharp/statement.class.scope index bcfb80fe89..a6008d311f 100644 --- a/data/fixtures/scopes/csharp/statement.class.scope +++ b/data/fixtures/scopes/csharp/statement.class.scope @@ -1,10 +1,10 @@ -class MyClass { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.field.class.scope b/data/fixtures/scopes/csharp/statement.field.class.scope new file mode 100644 index 0000000000..d14e13f7f6 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.field.class.scope @@ -0,0 +1,53 @@ +class Foo { + int bar; + int baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| int baz = 0; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 0; + +[#3 Removal] = 2:0-3:0 + >---------------- +2| int baz = 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.field.interface.scope b/data/fixtures/scopes/csharp/statement.field.interface.scope new file mode 100644 index 0000000000..d3b4ba7f67 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.field.interface.scope @@ -0,0 +1,33 @@ +interface IFoo { + int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| int bar; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.interface.scope b/data/fixtures/scopes/csharp/statement.interface.scope new file mode 100644 index 0000000000..72a42868ea --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.interface.scope @@ -0,0 +1,10 @@ +interface IFoo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| interface IFoo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.iteration.interface.scope b/data/fixtures/scopes/csharp/statement.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/data/fixtures/scopes/csharp/type.class.scope b/data/fixtures/scopes/csharp/type.class.scope index 696dd5c641..79c274ccc6 100644 --- a/data/fixtures/scopes/csharp/type.class.scope +++ b/data/fixtures/scopes/csharp/type.class.scope @@ -1,10 +1,10 @@ -class MyClass { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.field.class.scope b/data/fixtures/scopes/csharp/type.field.class.scope new file mode 100644 index 0000000000..d163e580a8 --- /dev/null +++ b/data/fixtures/scopes/csharp/type.field.class.scope @@ -0,0 +1,63 @@ +class Foo { + int bar; + int baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:4-2:7 + >---< +2| int baz = 0; + +[#3 Removal] = 2:4-2:8 + >----< +2| int baz = 0; + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 0; + +[#3 Trailing delimiter] = 2:7-2:8 + >-< +2| int baz = 0; + +[#3 Domain] = 2:4-2:15 + >-----------< +2| int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.field.scope b/data/fixtures/scopes/csharp/type.field.interface.scope similarity index 57% rename from data/fixtures/scopes/csharp/type.field.scope rename to data/fixtures/scopes/csharp/type.field.interface.scope index 6228c94197..2181ad2cec 100644 --- a/data/fixtures/scopes/csharp/type.field.scope +++ b/data/fixtures/scopes/csharp/type.field.interface.scope @@ -1,14 +1,14 @@ -class MyClass { - int value; +interface IFoo { + int bar; } --- [#1 Content] = [#1 Removal] = [#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| int value; + >---------------- +0| interface IFoo { +1| int bar; 2| } -< @@ -17,22 +17,22 @@ class MyClass { [#2 Content] = 1:4-1:7 >---< -1| int value; +1| int bar; [#2 Removal] = 1:4-1:8 >----< -1| int value; +1| int bar; [#2 Leading delimiter] = 1:0-1:4 >----< -1| int value; +1| int bar; [#2 Trailing delimiter] = 1:7-1:8 >-< -1| int value; +1| int bar; -[#2 Domain] = 1:4-1:13 - >---------< -1| int value; +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.interface.scope b/data/fixtures/scopes/csharp/type.interface.scope index fcc6af440a..e2787b7fde 100644 --- a/data/fixtures/scopes/csharp/type.interface.scope +++ b/data/fixtures/scopes/csharp/type.interface.scope @@ -1,10 +1,10 @@ -interface IClass { } +interface IFoo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:20 - >--------------------< -0| interface IClass { } +[Domain] = 0:0-0:17 + >-----------------< +0| interface IFoo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.iteration.interface.scope b/data/fixtures/scopes/csharp/type.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/type.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/data/fixtures/scopes/csharp/value.field.class.scope b/data/fixtures/scopes/csharp/value.field.class.scope new file mode 100644 index 0000000000..667f96450a --- /dev/null +++ b/data/fixtures/scopes/csharp/value.field.class.scope @@ -0,0 +1,22 @@ +class Foo { + int bar = 0; +} +--- + +[Content] = 1:14-1:15 + >-< +1| int bar = 0; + +[Removal] = 1:11-1:15 + >----< +1| int bar = 0; + +[Leading delimiter] = 1:11-1:14 + >---< +1| int bar = 0; + +[Domain] = 1:4-1:15 + >-----------< +1| int bar = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.field.scope b/data/fixtures/scopes/csharp/value.field.scope deleted file mode 100644 index 80a7d73d2f..0000000000 --- a/data/fixtures/scopes/csharp/value.field.scope +++ /dev/null @@ -1,22 +0,0 @@ -class MyClass { - int value = 2; -} ---- - -[Content] = 1:16-1:17 - >-< -1| int value = 2; - -[Removal] = 1:13-1:17 - >----< -1| int value = 2; - -[Leading delimiter] = 1:13-1:16 - >---< -1| int value = 2; - -[Domain] = 1:4-1:17 - >-------------< -1| int value = 2; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.class.scope b/data/fixtures/scopes/java/interior.class.scope index 5390112f29..48ed5df4de 100644 --- a/data/fixtures/scopes/java/interior.class.scope +++ b/data/fixtures/scopes/java/interior.class.scope @@ -1,25 +1,25 @@ -class Foo { } +public class Foo { } --- [#1 Content] = -[#1 Removal] = 0:11-0:12 - >-< -0| class Foo { } +[#1 Removal] = 0:18-0:19 + >-< +0| public class Foo { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } +[#1 Domain] = 0:0-0:20 + >--------------------< +0| public class Foo { } [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:11-0:12 - >-< -0| class Foo { } +[#2 Removal] = 0:18-0:19 + >-< +0| public class Foo { } -[#2 Domain] = 0:10-0:13 - >---< -0| class Foo { } +[#2 Domain] = 0:17-0:20 + >---< +0| public class Foo { } [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.class2.scope b/data/fixtures/scopes/java/interior.class2.scope deleted file mode 100644 index 48ed5df4de..0000000000 --- a/data/fixtures/scopes/java/interior.class2.scope +++ /dev/null @@ -1,25 +0,0 @@ -public class Foo { } ---- - -[#1 Content] = -[#1 Removal] = 0:18-0:19 - >-< -0| public class Foo { } - -[#1 Domain] = 0:0-0:20 - >--------------------< -0| public class Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:18-0:19 - >-< -0| public class Foo { } - -[#2 Domain] = 0:17-0:20 - >---< -0| public class Foo { } - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.interface.scope b/data/fixtures/scopes/java/interior.interface.scope new file mode 100644 index 0000000000..cf483fb76d --- /dev/null +++ b/data/fixtures/scopes/java/interior.interface.scope @@ -0,0 +1,25 @@ +public interface Foo { } +--- + +[#1 Content] = +[#1 Removal] = 0:22-0:23 + >-< +0| public interface Foo { } + +[#1 Domain] = 0:0-0:24 + >------------------------< +0| public interface Foo { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:22-0:23 + >-< +0| public interface Foo { } + +[#2 Domain] = 0:21-0:24 + >---< +0| public interface Foo { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.class.scope b/data/fixtures/scopes/java/name.class.scope index dfc56cf188..793da2dfad 100644 --- a/data/fixtures/scopes/java/name.class.scope +++ b/data/fixtures/scopes/java/name.class.scope @@ -1,24 +1,24 @@ -public class MyClass { } +public class Foo {} --- -[Content] = 0:13-0:20 - >-------< -0| public class MyClass { } +[Content] = 0:13-0:16 + >---< +0| public class Foo {} -[Removal] = 0:13-0:21 - >--------< -0| public class MyClass { } +[Removal] = 0:13-0:17 + >----< +0| public class Foo {} [Leading delimiter] = 0:12-0:13 >-< -0| public class MyClass { } +0| public class Foo {} -[Trailing delimiter] = 0:20-0:21 - >-< -0| public class MyClass { } +[Trailing delimiter] = 0:16-0:17 + >-< +0| public class Foo {} -[Domain] = 0:0-0:24 - >------------------------< -0| public class MyClass { } +[Domain] = 0:0-0:19 + >-------------------< +0| public class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.field.class.scope b/data/fixtures/scopes/java/name.field.class.scope new file mode 100644 index 0000000000..2c2c5942d5 --- /dev/null +++ b/data/fixtures/scopes/java/name.field.class.scope @@ -0,0 +1,69 @@ +public class Foo { + private int bar; + private int baz = 0; +} +--- + +[#1 Content] = 0:13-0:16 + >---< +0| public class Foo { + +[#1 Removal] = 0:13-0:17 + >----< +0| public class Foo { + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| public class Foo { + +[#1 Trailing delimiter] = 0:16-0:17 + >-< +0| public class Foo { + +[#1 Domain] = 0:0-3:1 + >------------------ +0| public class Foo { +1| private int bar; +2| private int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:16-1:19 + >---< +1| private int bar; + +[#2 Removal] = 1:15-1:19 + >----< +1| private int bar; + +[#2 Leading delimiter] = 1:15-1:16 + >-< +1| private int bar; + +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:16-2:19 + >---< +2| private int baz = 0; + +[#3 Removal] = 2:16-2:22 + >------< +2| private int baz = 0; + +[#3 Trailing delimiter] = 2:19-2:22 + >---< +2| private int baz = 0; + +[#3 Domain] = 2:4-2:24 + >--------------------< +2| private int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.field.interface.scope b/data/fixtures/scopes/java/name.field.interface.scope new file mode 100644 index 0000000000..5aa2e06bca --- /dev/null +++ b/data/fixtures/scopes/java/name.field.interface.scope @@ -0,0 +1,48 @@ +public interface Foo { + private int bar; +} +--- + +[#1 Content] = 0:17-0:20 + >---< +0| public interface Foo { + +[#1 Removal] = 0:17-0:21 + >----< +0| public interface Foo { + +[#1 Leading delimiter] = 0:16-0:17 + >-< +0| public interface Foo { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public interface Foo { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public interface Foo { +1| private int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:16-1:19 + >---< +1| private int bar; + +[#2 Removal] = 1:15-1:19 + >----< +1| private int bar; + +[#2 Leading delimiter] = 1:15-1:16 + >-< +1| private int bar; + +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.field.scope b/data/fixtures/scopes/java/name.field.scope deleted file mode 100644 index bd3fdd13ad..0000000000 --- a/data/fixtures/scopes/java/name.field.scope +++ /dev/null @@ -1,48 +0,0 @@ -public class MyClass { - private int value; -} ---- - -[#1 Content] = 0:13-0:20 - >-------< -0| public class MyClass { - -[#1 Removal] = 0:13-0:21 - >--------< -0| public class MyClass { - -[#1 Leading delimiter] = 0:12-0:13 - >-< -0| public class MyClass { - -[#1 Trailing delimiter] = 0:20-0:21 - >-< -0| public class MyClass { - -[#1 Domain] = 0:0-2:1 - >---------------------- -0| public class MyClass { -1| private int value; -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:16-1:21 - >-----< -1| private int value; - -[#2 Removal] = 1:15-1:21 - >------< -1| private int value; - -[#2 Leading delimiter] = 1:15-1:16 - >-< -1| private int value; - -[#2 Domain] = 1:4-1:22 - >------------------< -1| private int value; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.interface.scope b/data/fixtures/scopes/java/name.interface.scope new file mode 100644 index 0000000000..7f3680e3d4 --- /dev/null +++ b/data/fixtures/scopes/java/name.interface.scope @@ -0,0 +1,24 @@ +public interface Foo {} +--- + +[Content] = 0:17-0:20 + >---< +0| public interface Foo {} + +[Removal] = 0:17-0:21 + >----< +0| public interface Foo {} + +[Leading delimiter] = 0:16-0:17 + >-< +0| public interface Foo {} + +[Trailing delimiter] = 0:20-0:21 + >-< +0| public interface Foo {} + +[Domain] = 0:0-0:23 + >-----------------------< +0| public interface Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.iteration.class2.scope b/data/fixtures/scopes/java/name.iteration.interface.scope similarity index 100% rename from data/fixtures/scopes/java/name.iteration.class2.scope rename to data/fixtures/scopes/java/name.iteration.interface.scope diff --git a/data/fixtures/scopes/java/statement.class.scope b/data/fixtures/scopes/java/statement.class.scope index 5153070300..d2c5cc8cda 100644 --- a/data/fixtures/scopes/java/statement.class.scope +++ b/data/fixtures/scopes/java/statement.class.scope @@ -1,10 +1,10 @@ -public class MyClass { } +public class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:24 - >------------------------< -0| public class MyClass { } +[Domain] = 0:0-0:19 + >-------------------< +0| public class Foo {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.class2.scope b/data/fixtures/scopes/java/statement.class2.scope new file mode 100644 index 0000000000..a6008d311f --- /dev/null +++ b/data/fixtures/scopes/java/statement.class2.scope @@ -0,0 +1,10 @@ +class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.field.class.scope b/data/fixtures/scopes/java/statement.field.class.scope new file mode 100644 index 0000000000..6b11a71b2d --- /dev/null +++ b/data/fixtures/scopes/java/statement.field.class.scope @@ -0,0 +1,53 @@ +public class Foo { + private int bar; + private int baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >------------------ +0| public class Foo { +1| private int bar; +2| private int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Removal] = 1:0-2:0 + >-------------------- +1| private int bar; +2| private int baz = 0; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| private int bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:24 + >--------------------< +2| private int baz = 0; + +[#3 Removal] = 2:0-3:0 + >------------------------ +2| private int baz = 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| private int baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.field.interface.scope b/data/fixtures/scopes/java/statement.field.interface.scope new file mode 100644 index 0000000000..6def0d0717 --- /dev/null +++ b/data/fixtures/scopes/java/statement.field.interface.scope @@ -0,0 +1,33 @@ +public interface Foo { + private int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public interface Foo { +1| private int bar; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Removal] = 1:0-2:0 + >-------------------- +1| private int bar; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| private int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.interface.scope b/data/fixtures/scopes/java/statement.interface.scope new file mode 100644 index 0000000000..7bee312543 --- /dev/null +++ b/data/fixtures/scopes/java/statement.interface.scope @@ -0,0 +1,10 @@ +public interface Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:23 + >-----------------------< +0| public interface Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.interface2.scope b/data/fixtures/scopes/java/statement.interface2.scope new file mode 100644 index 0000000000..f114e8b3c6 --- /dev/null +++ b/data/fixtures/scopes/java/statement.interface2.scope @@ -0,0 +1,10 @@ +interface Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| interface Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.iteration.interface.scope b/data/fixtures/scopes/java/statement.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/statement.iteration.interface.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.field.class.scope b/data/fixtures/scopes/java/type.field.class.scope new file mode 100644 index 0000000000..528fd810c8 --- /dev/null +++ b/data/fixtures/scopes/java/type.field.class.scope @@ -0,0 +1,63 @@ +class Foo { + int bar; + int baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:4-2:7 + >---< +2| int baz = 0; + +[#3 Removal] = 2:4-2:8 + >----< +2| int baz = 0; + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 0; + +[#3 Trailing delimiter] = 2:7-2:8 + >-< +2| int baz = 0; + +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.field.interface.scope b/data/fixtures/scopes/java/type.field.interface.scope new file mode 100644 index 0000000000..3aad6f9030 --- /dev/null +++ b/data/fixtures/scopes/java/type.field.interface.scope @@ -0,0 +1,38 @@ +public interface Foo { + private int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public interface Foo { +1| private int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:12-1:15 + >---< +1| private int bar; + +[#2 Removal] = 1:12-1:16 + >----< +1| private int bar; + +[#2 Leading delimiter] = 1:11-1:12 + >-< +1| private int bar; + +[#2 Trailing delimiter] = 1:15-1:16 + >-< +1| private int bar; + +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.field.scope b/data/fixtures/scopes/java/type.field.scope deleted file mode 100644 index a8097eaca7..0000000000 --- a/data/fixtures/scopes/java/type.field.scope +++ /dev/null @@ -1,70 +0,0 @@ -class MyClass { - Map foo; -} ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| Map foo; -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:17 - >-------------< -1| Map foo; - -[#2 Removal] = 1:4-1:18 - >--------------< -1| Map foo; - -[#2 Leading delimiter] = 1:0-1:4 - >----< -1| Map foo; - -[#2 Trailing delimiter] = 1:17-1:18 - >-< -1| Map foo; - -[#2 Domain] = 1:4-1:22 - >------------------< -1| Map foo; - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Domain] = 1:8-1:11 - >---< -1| Map foo; - -[#3 Removal] = 1:8-1:13 - >-----< -1| Map foo; - -[#3 Trailing delimiter] = 1:11-1:13 - >--< -1| Map foo; - -[#3 Insertion delimiter] = ", " - - -[#4 Content] = -[#4 Domain] = 1:13-1:16 - >---< -1| Map foo; - -[#4 Removal] = 1:11-1:16 - >-----< -1| Map foo; - -[#4 Leading delimiter] = 1:11-1:13 - >--< -1| Map foo; - -[#4 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/type.iteration.interface.scope b/data/fixtures/scopes/java/type.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/type.iteration.interface.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.field.scope b/data/fixtures/scopes/java/value.field.class.scope similarity index 94% rename from data/fixtures/scopes/java/value.field.scope rename to data/fixtures/scopes/java/value.field.class.scope index d6449ef022..5bc27b44b0 100644 --- a/data/fixtures/scopes/java/value.field.scope +++ b/data/fixtures/scopes/java/value.field.class.scope @@ -1,4 +1,4 @@ -public class MyClass { +public class Foo { private int value = 123; } --- diff --git a/data/fixtures/scopes/javascript.core/class.scope b/data/fixtures/scopes/javascript.core/class.scope index e6a25b8f55..ffbda12f63 100644 --- a/data/fixtures/scopes/javascript.core/class.scope +++ b/data/fixtures/scopes/javascript.core/class.scope @@ -1,10 +1,10 @@ -class MyClass { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/class2.scope b/data/fixtures/scopes/javascript.core/class2.scope index cb0026603b..47e52ec710 100644 --- a/data/fixtures/scopes/javascript.core/class2.scope +++ b/data/fixtures/scopes/javascript.core/class2.scope @@ -1,10 +1,10 @@ -export default class MyClass { } +export default class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:32 - >--------------------------------< -0| export default class MyClass { } +[Domain] = 0:0-0:27 + >---------------------------< +0| export default class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/class3.scope b/data/fixtures/scopes/javascript.core/class3.scope index aa5deaa1e1..6589c550c4 100644 --- a/data/fixtures/scopes/javascript.core/class3.scope +++ b/data/fixtures/scopes/javascript.core/class3.scope @@ -1,10 +1,10 @@ -export class MyClass { } +export class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:24 - >------------------------< -0| export class MyClass { } +[Domain] = 0:0-0:19 + >-------------------< +0| export class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/name.class.scope b/data/fixtures/scopes/javascript.core/name.class.scope index 428df96465..211086562c 100644 --- a/data/fixtures/scopes/javascript.core/name.class.scope +++ b/data/fixtures/scopes/javascript.core/name.class.scope @@ -1,29 +1,24 @@ -class MyClass { - -} +class Foo {} --- -[Content] = 0:6-0:13 - >-------< -0| class MyClass { +[Content] = 0:6-0:9 + >---< +0| class Foo {} -[Removal] = 0:6-0:14 - >--------< -0| class MyClass { +[Removal] = 0:6-0:10 + >----< +0| class Foo {} [Leading delimiter] = 0:5-0:6 >-< -0| class MyClass { +0| class Foo {} -[Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass { +[Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo {} -[Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| -2| } - -< +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name.field.class.scope b/data/fixtures/scopes/javascript.core/name.field.class.scope new file mode 100644 index 0000000000..081d51fe83 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name.field.class.scope @@ -0,0 +1,69 @@ +class Foo { + bar; + baz = 0; +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| class Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { + +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| bar; +2| baz = 0; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:2-1:5 + >---< +1| bar; + +[#2 Removal] = 1:0-1:5 + >-----< +1| bar; + +[#2 Leading delimiter] = 1:0-1:2 + >--< +1| bar; + +[#2 Domain] = 1:2-1:6 + >----< +1| bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:2-2:5 + >---< +2| baz = 0; + +[#3 Removal] = 2:2-2:8 + >------< +2| baz = 0; + +[#3 Trailing delimiter] = 2:5-2:8 + >---< +2| baz = 0; + +[#3 Domain] = 2:2-2:10 + >--------< +2| baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name.field.scope b/data/fixtures/scopes/javascript.core/name.field.scope deleted file mode 100644 index c913e7d6ec..0000000000 --- a/data/fixtures/scopes/javascript.core/name.field.scope +++ /dev/null @@ -1,48 +0,0 @@ -class MyClass { - value = 0; -} ---- - -[#1 Content] = 0:6-0:13 - >-------< -0| class MyClass { - -[#1 Removal] = 0:6-0:14 - >--------< -0| class MyClass { - -[#1 Leading delimiter] = 0:5-0:6 - >-< -0| class MyClass { - -[#1 Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass { - -[#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| value = 0; -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:2-1:7 - >-----< -1| value = 0; - -[#2 Removal] = 1:2-1:10 - >--------< -1| value = 0; - -[#2 Trailing delimiter] = 1:7-1:10 - >---< -1| value = 0; - -[#2 Domain] = 1:2-1:12 - >----------< -1| value = 0; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/statement.field.class.scope b/data/fixtures/scopes/javascript.core/statement.field.class.scope new file mode 100644 index 0000000000..c60f838a11 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement.field.class.scope @@ -0,0 +1,53 @@ +class Foo { + bar; + baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| bar; +2| baz = 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:2-1:6 + >----< +1| bar; + +[#2 Removal] = 1:0-2:0 + >------ +1| bar; +2| baz = 0; + < + +[#2 Leading delimiter] = 1:0-1:2 + >--< +1| bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:2-2:10 + >--------< +2| baz = 0; + +[#3 Removal] = 2:0-3:0 + >---------- +2| baz = 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:2 + >--< +2| baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/value.field.class.scope b/data/fixtures/scopes/javascript.core/value.field.class.scope new file mode 100644 index 0000000000..f10f3be28c --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.field.class.scope @@ -0,0 +1,22 @@ +class Foo { + bar = 0; +} +--- + +[Content] = 1:8-1:9 + >-< +1| bar = 0; + +[Removal] = 1:5-1:9 + >----< +1| bar = 0; + +[Leading delimiter] = 1:5-1:8 + >---< +1| bar = 0; + +[Domain] = 1:2-1:10 + >--------< +1| bar = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name.field.class.scope b/data/fixtures/scopes/php/name.field.class.scope new file mode 100644 index 0000000000..119b07a120 --- /dev/null +++ b/data/fixtures/scopes/php/name.field.class.scope @@ -0,0 +1,49 @@ +---< +1| class Foo { + +[#1 Removal] = 1:6-1:10 + >----< +1| class Foo { + +[#1 Leading delimiter] = 1:5-1:6 + >-< +1| class Foo { + +[#1 Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo { + +[#1 Domain] = 1:0-3:1 + >----------- +1| class Foo { +2| public string $bar; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:18-2:22 + >----< +2| public string $bar; + +[#2 Removal] = 2:17-2:22 + >-----< +2| public string $bar; + +[#2 Leading delimiter] = 2:17-2:18 + >-< +2| public string $bar; + +[#2 Domain] = 2:4-2:23 + >-------------------< +2| public string $bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name.field.scope b/data/fixtures/scopes/php/name.field.scope deleted file mode 100644 index 643d006731..0000000000 --- a/data/fixtures/scopes/php/name.field.scope +++ /dev/null @@ -1,49 +0,0 @@ --------< -1| class MyClass { - -[#1 Removal] = 1:6-1:14 - >--------< -1| class MyClass { - -[#1 Leading delimiter] = 1:5-1:6 - >-< -1| class MyClass { - -[#1 Trailing delimiter] = 1:13-1:14 - >-< -1| class MyClass { - -[#1 Domain] = 1:0-3:1 - >--------------- -1| class MyClass { -2| public string $value; -3| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 2:18-2:24 - >------< -2| public string $value; - -[#2 Removal] = 2:17-2:24 - >-------< -2| public string $value; - -[#2 Leading delimiter] = 2:17-2:18 - >-< -2| public string $value; - -[#2 Domain] = 2:4-2:25 - >---------------------< -2| public string $value; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type.field.scope b/data/fixtures/scopes/php/type.field.class.scope similarity index 50% rename from data/fixtures/scopes/php/type.field.scope rename to data/fixtures/scopes/php/type.field.class.scope index 9876e5c167..1a87b90e8f 100644 --- a/data/fixtures/scopes/php/type.field.scope +++ b/data/fixtures/scopes/php/type.field.class.scope @@ -1,27 +1,27 @@ ------< -2| public string $value; +2| public string $bar; [Removal] = 2:11-2:18 >-------< -2| public string $value; +2| public string $bar; [Leading delimiter] = 2:10-2:11 >-< -2| public string $value; +2| public string $bar; [Trailing delimiter] = 2:17-2:18 >-< -2| public string $value; +2| public string $bar; -[Domain] = 2:4-2:25 - >---------------------< -2| public string $value; +[Domain] = 2:4-2:23 + >-------------------< +2| public string $bar; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/class.scope b/data/fixtures/scopes/python/class.scope index 4463b9d47c..450a9fd782 100644 --- a/data/fixtures/scopes/python/class.scope +++ b/data/fixtures/scopes/python/class.scope @@ -1,12 +1,12 @@ -class MyClass: +class Foo: pass --- [Content] = [Removal] = [Domain] = 0:0-1:8 - >-------------- -0| class MyClass: + >---------- +0| class Foo: 1| pass --------< diff --git a/data/fixtures/scopes/python/class2.scope b/data/fixtures/scopes/python/class2.scope index ebf4a4762e..956e5e38d6 100644 --- a/data/fixtures/scopes/python/class2.scope +++ b/data/fixtures/scopes/python/class2.scope @@ -1,5 +1,5 @@ @value -class MyClass: +class Foo: pass --- @@ -8,7 +8,7 @@ class MyClass: [Domain] = 0:0-2:8 >------ 0| @value -1| class MyClass: +1| class Foo: 2| pass --------< diff --git a/data/fixtures/scopes/python/name.field.scope b/data/fixtures/scopes/python/name.field.class.scope similarity index 55% rename from data/fixtures/scopes/python/name.field.scope rename to data/fixtures/scopes/python/name.field.class.scope index c217c14462..96f44f2c5c 100644 --- a/data/fixtures/scopes/python/name.field.scope +++ b/data/fixtures/scopes/python/name.field.class.scope @@ -1,5 +1,5 @@ class Foo: - name: str + bar: int --- [#1 Content] = 0:6-0:9 @@ -14,29 +14,29 @@ class Foo: >-< 0| class Foo: -[#1 Domain] = 0:0-1:13 +[#1 Domain] = 0:0-1:12 >---------- 0| class Foo: -1| name: str - -------------< +1| bar: int + ------------< [#1 Insertion delimiter] = " " -[#2 Content] = 1:4-1:8 - >----< -1| name: str +[#2 Content] = 1:4-1:7 + >---< +1| bar: int -[#2 Removal] = 1:0-1:8 - >--------< -1| name: str +[#2 Removal] = 1:0-1:7 + >-------< +1| bar: int [#2 Leading delimiter] = 1:0-1:4 >----< -1| name: str +1| bar: int -[#2 Domain] = 1:4-1:13 - >---------< -1| name: str +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: int [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/statement.field.class.scope b/data/fixtures/scopes/python/statement.field.class.scope new file mode 100644 index 0000000000..4889b6538a --- /dev/null +++ b/data/fixtures/scopes/python/statement.field.class.scope @@ -0,0 +1,51 @@ +class Foo: + bar: int + baz = 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:11 + >---------- +0| class Foo: +1| bar: int +2| baz = 0 + -----------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: int + +[#2 Removal] = 1:0-2:0 + >------------ +1| bar: int +2| baz = 0 + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: int + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:11 + >-------< +2| baz = 0 + +[#3 Removal] = 1:12-2:11 + > +1| bar: int +2| baz = 0 + -----------< + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| baz = 0 + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/type.field.class.scope b/data/fixtures/scopes/python/type.field.class.scope new file mode 100644 index 0000000000..61915292ae --- /dev/null +++ b/data/fixtures/scopes/python/type.field.class.scope @@ -0,0 +1,32 @@ +class Foo: + bar: int +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:12 + >---------- +0| class Foo: +1| bar: int + ------------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:9-1:12 + >---< +1| bar: int + +[#2 Removal] = 1:7-1:12 + >-----< +1| bar: int + +[#2 Leading delimiter] = 1:7-1:9 + >--< +1| bar: int + +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: int + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/type.field.scope b/data/fixtures/scopes/python/type.field.scope deleted file mode 100644 index 48e383dc7c..0000000000 --- a/data/fixtures/scopes/python/type.field.scope +++ /dev/null @@ -1,32 +0,0 @@ -class MyClass: - a: int ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-1:10 - >-------------- -0| class MyClass: -1| a: int - ----------< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:7-1:10 - >---< -1| a: int - -[#2 Removal] = 1:5-1:10 - >-----< -1| a: int - -[#2 Leading delimiter] = 1:5-1:7 - >--< -1| a: int - -[#2 Domain] = 1:4-1:10 - >------< -1| a: int - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/value.field.scope b/data/fixtures/scopes/python/value.field.class.scope similarity index 54% rename from data/fixtures/scopes/javascript.core/value.field.scope rename to data/fixtures/scopes/python/value.field.class.scope index 3c396b9d74..809eab2a5c 100644 --- a/data/fixtures/scopes/javascript.core/value.field.scope +++ b/data/fixtures/scopes/python/value.field.class.scope @@ -1,22 +1,21 @@ -class MyClass { - value = 0; -} +class Foo: + bar = 0 --- [Content] = 1:10-1:11 >-< -1| value = 0; +1| bar = 0 [Removal] = 1:7-1:11 >----< -1| value = 0; +1| bar = 0 [Leading delimiter] = 1:7-1:10 >---< -1| value = 0; +1| bar = 0 -[Domain] = 1:2-1:12 - >----------< -1| value = 0; +[Domain] = 1:4-1:11 + >-------< +1| bar = 0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/value.field.scope b/data/fixtures/scopes/python/value.field.scope deleted file mode 100644 index 559b6c771f..0000000000 --- a/data/fixtures/scopes/python/value.field.scope +++ /dev/null @@ -1,21 +0,0 @@ -class Foo: - value = 123 ---- - -[Content] = 1:12-1:15 - >---< -1| value = 123 - -[Removal] = 1:9-1:15 - >------< -1| value = 123 - -[Leading delimiter] = 1:9-1:12 - >---< -1| value = 123 - -[Domain] = 1:4-1:15 - >-----------< -1| value = 123 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.field.scope b/data/fixtures/scopes/talon/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/talon/name.field.scope rename to data/fixtures/scopes/talon/name.field.class.scope diff --git a/data/fixtures/scopes/talon/value.field.scope b/data/fixtures/scopes/talon/value.field.class.scope similarity index 100% rename from data/fixtures/scopes/talon/value.field.scope rename to data/fixtures/scopes/talon/value.field.class.scope diff --git a/data/fixtures/scopes/typescript.core/interior.interface.scope b/data/fixtures/scopes/typescript.core/interior.interface.scope new file mode 100644 index 0000000000..f79024c7de --- /dev/null +++ b/data/fixtures/scopes/typescript.core/interior.interface.scope @@ -0,0 +1,25 @@ +interface Foo { } +--- + +[#1 Content] = +[#1 Removal] = 0:15-0:16 + >-< +0| interface Foo { } + +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:15-0:16 + >-< +0| interface Foo { } + +[#2 Domain] = 0:14-0:17 + >---< +0| interface Foo { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name.field.scope b/data/fixtures/scopes/typescript.core/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/name.field.scope rename to data/fixtures/scopes/typescript.core/name.field.class.scope diff --git a/data/fixtures/scopes/typescript.core/name.field.interface.scope b/data/fixtures/scopes/typescript.core/name.field.interface.scope new file mode 100644 index 0000000000..e92982ddcc --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.field.interface.scope @@ -0,0 +1,48 @@ +interface Foo { + bar: number; +} +--- + +[#1 Content] = 0:10-0:13 + >---< +0| interface Foo { + +[#1 Removal] = 0:10-0:14 + >----< +0| interface Foo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar: number; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar: number; + +[#2 Removal] = 1:0-1:7 + >-------< +1| bar: number; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: number; + +[#2 Domain] = 1:4-1:15 + >-----------< +1| bar: number; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name.interface.scope b/data/fixtures/scopes/typescript.core/name.interface.scope new file mode 100644 index 0000000000..52074b01f0 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.interface.scope @@ -0,0 +1,24 @@ +interface Foo {} +--- + +[Content] = 0:10-0:13 + >---< +0| interface Foo {} + +[Removal] = 0:10-0:14 + >----< +0| interface Foo {} + +[Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo {} + +[Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo {} + +[Domain] = 0:0-0:16 + >----------------< +0| interface Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name.iteration.interface.scope b/data/fixtures/scopes/typescript.core/name.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.iteration.interface.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/statement.field.interface.scope b/data/fixtures/scopes/typescript.core/statement.field.interface.scope new file mode 100644 index 0000000000..a16dcae09b --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement.field.interface.scope @@ -0,0 +1,33 @@ +interface Foo { + bar: number; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar: number; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:16 + >------------< +1| bar: number; + +[#2 Removal] = 1:0-2:0 + >---------------- +1| bar: number; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: number; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/typescript.core/statement.interface.scope b/data/fixtures/scopes/typescript.core/statement.interface.scope new file mode 100644 index 0000000000..f114e8b3c6 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement.interface.scope @@ -0,0 +1,10 @@ +interface Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| interface Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/typescript.core/statement.iteration.interface.scope b/data/fixtures/scopes/typescript.core/statement.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement.iteration.interface.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.field.scope b/data/fixtures/scopes/typescript.core/type.field.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/type.field.scope rename to data/fixtures/scopes/typescript.core/type.field.class.scope diff --git a/data/fixtures/scopes/typescript.core/type.field.interface.scope b/data/fixtures/scopes/typescript.core/type.field.interface.scope new file mode 100644 index 0000000000..b9341860f6 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.field.interface.scope @@ -0,0 +1,34 @@ +interface Foo { + bar: number; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar: number; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:9-1:15 + >------< +1| bar: number; + +[#2 Removal] = 1:7-1:15 + >--------< +1| bar: number; + +[#2 Leading delimiter] = 1:7-1:9 + >--< +1| bar: number; + +[#2 Domain] = 1:4-1:16 + >------------< +1| bar: number; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.iteration.interface.scope b/data/fixtures/scopes/typescript.core/type.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.iteration.interface.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/value.field.scope b/data/fixtures/scopes/typescript.core/value.field.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/value.field.scope rename to data/fixtures/scopes/typescript.core/value.field.class.scope diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index d5d40c66ff..577de97e92 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -11,6 +11,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.field.class": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.block": supported, @@ -79,7 +80,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.variable": supported, "name.function": supported, "name.class": supported, - "name.field": supported, + "name.field.class": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, "name.iteration.block": supported, @@ -96,7 +97,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "type.variable": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, - "type.field": supported, + "type.field.class": supported, "type.enum": supported, "type.cast": supported, "type.class": supported, @@ -190,12 +191,23 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "branch.try.iteration": notApplicable, "interior.try": notApplicable, + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, + // Miscellaneous "key.attribute": notApplicable, - "type.interface": notApplicable, "value.attribute": notApplicable, "value.yield": notApplicable, - "value.field": notApplicable, + "value.field.class": notApplicable, "interior.static": notApplicable, "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 2fffcdc879..ae77d7a157 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -66,7 +66,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, "value.foreach": supported, - "value.field": supported, + "value.field.class": supported, "type.argument.formal.method": supported, "type.argument.formal.method.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index a356c8121d..d6f3b5db2e 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -66,14 +66,17 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": supported, "name.assignment": supported, "name.class": supported, + "name.interface": supported, "name.constructor": supported, - "name.field": supported, + "name.field.class": supported, + "name.field.interface": supported, "name.foreach": supported, "name.function": supported, "name.method": supported, "name.variable": supported, "name.iteration.block": supported, "name.iteration.class": supported, + "name.iteration.interface": supported, "name.iteration.document": supported, "value.argument.formal.constructor": supported, @@ -83,7 +86,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": supported, "value.argument.formal": supported, "value.assignment": supported, - "value.field": supported, + "value.field.class": supported, "value.foreach": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, @@ -103,9 +106,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": supported, "type.cast": supported, "type.class": supported, - "type.foreach": supported, - "type.field": supported, "type.interface": supported, + "type.foreach": supported, + "type.field.class": supported, + "type.field.interface": supported, "type.enum": supported, "type.return": supported, "type.variable": supported, @@ -113,6 +117,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": supported, "type.iteration.block": supported, "type.iteration.class": supported, + "type.iteration.interface": supported, "type.iteration.document": supported, "key.mapPair": supported, @@ -166,8 +171,12 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.interface": supported, + "statement.field.class": supported, + "statement.field.interface": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, + "statement.iteration.interface": supported, "statement.iteration.document": supported, "string.singleLine": supported, @@ -179,6 +188,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.block": supported, "interior.class": supported, + "interior.interface": supported, "interior.function": supported, "interior.constructor": supported, "interior.method": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 1f19ea7e0d..339918ad98 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -40,7 +40,41 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { selector: supported, unit: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, @@ -93,12 +127,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try.iteration": notApplicable, "branch.try": notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - class: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, - className: notApplicable, command: notApplicable, "comment.line": notApplicable, "condition.doWhile": notApplicable, @@ -117,12 +145,10 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "functionName.constructor": notApplicable, "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, - "functionName.method.iteration.class": notApplicable, "functionName.method": notApplicable, functionName: notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -154,10 +180,8 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": notApplicable, "name.assignment.pattern": notApplicable, "name.assignment": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.method": notApplicable, @@ -165,11 +189,9 @@ 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, - "namedFunction.method.iteration.class": notApplicable, "namedFunction.method": notApplicable, namedFunction: notApplicable, notebookCell: notApplicable, @@ -180,8 +202,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { section: notApplicable, startTag: notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, - "statement.class": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, @@ -196,11 +216,8 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, "type.return": notApplicable, @@ -208,7 +225,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "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, @@ -220,7 +236,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.resource.iteration": notApplicable, "value.resource": notApplicable, @@ -231,6 +246,5 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "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 47252f9149..0452c44915 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -18,7 +18,41 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { startTag: supported, tags: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, "argument.actual.constructor.iteration": notApplicable, "argument.actual.constructor.singleLine": notApplicable, @@ -74,10 +108,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try.iteration": notApplicable, "branch.try": notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, "collectionItem.unenclosed": notApplicable, "comment.line": notApplicable, @@ -93,10 +123,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.constructor": notApplicable, "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, - "functionName.method.iteration.class": notApplicable, "functionName.method": notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -127,13 +155,10 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": notApplicable, "name.assignment.pattern": notApplicable, "name.assignment": notApplicable, - "name.class": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "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, @@ -144,13 +169,10 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.constructor": notApplicable, "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, - "namedFunction.method.iteration.class": notApplicable, "namedFunction.method": notApplicable, "section.iteration.document": notApplicable, "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, @@ -163,11 +185,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, "type.return": notApplicable, @@ -175,7 +194,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "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, @@ -186,7 +204,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": notApplicable, "value.argument.formal": notApplicable, "value.assignment": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair.iteration": notApplicable, "value.mapPair": notApplicable, @@ -199,11 +216,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, anonymousFunction: notApplicable, - class: notApplicable, - className: notApplicable, command: notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index e7eba600b3..e9bb8dcdde 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -96,8 +96,12 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.interface": supported, + "statement.field.class": supported, + "statement.field.interface": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, + "statement.iteration.interface": supported, "statement.iteration.document": supported, "string.singleLine": supported, @@ -114,19 +118,22 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": supported, "name.assignment": supported, "name.class": supported, + "name.interface": supported, "name.constructor": supported, - "name.field": supported, + "name.field.class": supported, + "name.field.interface": supported, "name.foreach": supported, "name.method": supported, "name.variable": supported, "name.iteration.document": supported, "name.iteration.class": supported, + "name.iteration.interface": supported, "name.iteration.block": supported, "name.resource": supported, "value.assignment": supported, "value.foreach": supported, - "value.field": supported, + "value.field.class": supported, "value.return": supported, "value.return.lambda": supported, "value.variable": supported, @@ -140,7 +147,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": supported, "type.argument.formal.method.iteration": supported, "type.foreach": supported, - "type.field": supported, + "type.field.class": supported, + "type.field.interface": supported, "type.return": supported, "type.variable": supported, "type.typeArgument": supported, @@ -152,9 +160,11 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.interface": supported, "type.iteration.block": supported, "type.iteration.class": supported, + "type.iteration.interface": supported, "type.iteration.document": supported, "interior.class": supported, + "interior.interface": supported, "interior.constructor": supported, "interior.method": supported, "interior.if": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index aead4b7ea0..dce30ca35d 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -24,6 +24,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { statement: supported, "statement.class": supported, + "statement.field.class": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.block": supported, @@ -137,7 +138,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.method": supported, "name.constructor": supported, "name.class": supported, - "name.field": supported, + "name.field.class": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.block": supported, @@ -159,7 +160,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.foreach": supported, "value.return": supported, "value.return.lambda": supported, - "value.field": supported, + "value.field.class": supported, "value.yield": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -254,9 +255,10 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { ...javascriptCoreScopeSupport, ...javascriptJsxScopeSupport, - // Types are defined here because we don't want typescript to import them and + // These are defined here because we don't want typescript to import them and // accidentally forget to add support for them. + // Type "type.argument.formal": notApplicable, "type.argument.formal.iteration": notApplicable, "type.argument.formal.method": notApplicable, @@ -265,7 +267,8 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": notApplicable, "type.alias": notApplicable, "type.cast": notApplicable, - "type.field": notApplicable, + "type.field.class": notApplicable, + "type.field.interface": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.enum": notApplicable, @@ -275,7 +278,16 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.class": notApplicable, + "type.iteration.interface": notApplicable, "type.iteration.document": notApplicable, - "value.typeAlias": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 3d52245d80..32af13777e 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -21,7 +21,41 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -79,12 +113,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, command: notApplicable, @@ -109,10 +137,8 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -143,14 +169,11 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -162,7 +185,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -171,9 +193,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, startTag: notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -188,11 +208,8 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, @@ -200,7 +217,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -212,7 +228,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.resource": notApplicable, "value.resource.iteration": notApplicable, @@ -223,7 +238,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "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 2eae77e952..95f275abe6 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -17,7 +17,41 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed": supported, list: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -75,12 +109,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, command: notApplicable, "comment.line": notApplicable, @@ -105,9 +133,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -141,14 +167,11 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -160,14 +183,11 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, startTag: notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, "string.singleLine": notApplicable, @@ -185,11 +205,8 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, @@ -197,7 +214,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -209,7 +225,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, @@ -222,7 +237,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "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/php.ts b/packages/common/src/scopeSupportFacets/php.ts index b04ef918ff..8806c9e1a9 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -43,11 +43,11 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal": supported, "type.argument.formal.iteration": supported, "type.cast": supported, - "type.field": supported, + "type.field.class": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, - "name.field": supported, + "name.field.class": supported, disqualifyDelimiter: supported, }; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index e188ed751d..c560d38cd5 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -19,7 +19,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment.pattern": supported, "name.class": supported, "name.constructor": supported, - "name.field": supported, + "name.field.class": supported, "name.function": supported, "name.iteration.block": supported, "name.iteration.class": supported, @@ -41,7 +41,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, "value.assignment": supported, - "value.field": supported, + "value.field.class": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, "value.return": supported, @@ -59,7 +59,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": supported, "type.argument.formal": supported, "type.class": supported, - "type.field": supported, + "type.field.class": supported, "type.return": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, @@ -185,6 +185,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.field.class": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, "statement.iteration.document": supported, @@ -244,6 +245,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, "type.resource.iteration": notApplicable, "type.resource": notApplicable, "value.typeAlias": notApplicable, @@ -261,6 +264,15 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "comment.block": notApplicable, "textFragment.comment.block": notApplicable, + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "interior.static": notApplicable, environment: notApplicable, regularExpression: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index d39df1a3c4..d068d34bb8 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -58,7 +58,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "interior.try": unsupported, "key.attribute": unsupported, "name.class": unsupported, - "name.field": unsupported, + "name.field.class": unsupported, "name.foreach": unsupported, "name.function": unsupported, "name.method": unsupported, @@ -99,7 +99,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": notApplicable, "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, + "type.field.class": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.return": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 1c618d56f9..5b8b19c01f 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -23,7 +23,41 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.constructor.singleLine": notApplicable, @@ -75,12 +109,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, command: notApplicable, "comment.block": notApplicable, "condition.doWhile": notApplicable, @@ -104,10 +132,8 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -141,14 +167,11 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -160,7 +183,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -168,9 +190,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, startTag: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -186,11 +206,8 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, @@ -198,7 +215,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -210,7 +226,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, @@ -223,7 +238,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "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 c1ed99cc9b..fff5e1db83 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -88,14 +88,30 @@ export const scopeSupportFacetInfos: Record< description: "A class declaration", scopeType: "statement", }, + "statement.interface": { + description: "A interface declaration", + scopeType: "statement", + }, + "statement.field.class": { + description: "A field declaration in a class", + scopeType: "statement", + }, + "statement.field.interface": { + description: "A field declaration in a interface", + scopeType: "statement", + }, "statement.iteration.document": { description: "Iteration scope for statements. The entire document.", scopeType: "statement", isIteration: true, }, "statement.iteration.class": { - description: - "Iteration scope for type in a class / interface; should be entire class / interface body", + description: "Iteration scope for types; class body", + scopeType: "statement", + isIteration: true, + }, + "statement.iteration.interface": { + description: "Iteration scope for types; interface body", scopeType: "statement", isIteration: true, }, @@ -631,12 +647,20 @@ export const scopeSupportFacetInfos: Record< description: "Name of a class", scopeType: "name", }, + "name.interface": { + description: "Name of a interface", + scopeType: "name", + }, "name.namespace": { description: "Name of a namespace", scopeType: "name", }, - "name.field": { - description: "Name (LHS) of a field in a class / interface", + "name.field.class": { + description: "Name (LHS) of a field in a class", + scopeType: "name", + }, + "name.field.interface": { + description: "Name (LHS) of a field in a interface", scopeType: "name", }, "name.iteration.block": { @@ -650,6 +674,11 @@ export const scopeSupportFacetInfos: Record< scopeType: "name", isIteration: true, }, + "name.iteration.interface": { + description: "Iteration scope for names: interface body", + scopeType: "name", + isIteration: true, + }, "name.iteration.document": { description: "Iteration scope for names: the entire document", scopeType: "name", @@ -760,8 +789,8 @@ export const scopeSupportFacetInfos: Record< description: "Implicit return value from a lambda", scopeType: "value", }, - "value.field": { - description: "Value (RHS) of a field in a class / interface", + "value.field.class": { + description: "Value (RHS) of a field in a class", scopeType: "value", }, "value.yield": { @@ -877,16 +906,16 @@ export const scopeSupportFacetInfos: Record< description: "Type of return value in a function declaration", scopeType: "type", }, - "type.field": { - description: "Type of field in a class / interface", + "type.field.class": { + description: "Type of field in a class", scopeType: "type", }, - "type.foreach": { - description: "Type of variable in a for each loop", + "type.field.interface": { + description: "Type of field in a interface", scopeType: "type", }, - "type.interface": { - description: "An interface declaration", + "type.foreach": { + description: "Type of variable in a for each loop", scopeType: "type", }, "type.enum": { @@ -897,6 +926,10 @@ export const scopeSupportFacetInfos: Record< description: "A class declaration", scopeType: "type", }, + "type.interface": { + description: "An interface declaration", + scopeType: "type", + }, "type.alias": { description: "A type alias declaration", scopeType: "type", @@ -932,13 +965,17 @@ export const scopeSupportFacetInfos: Record< isIteration: true, }, "type.iteration.class": { - description: - "Iteration scope for type in a class / interface; should be entire class / interface body", + description: "Iteration scope for types; class body", + scopeType: "type", + isIteration: true, + }, + "type.iteration.interface": { + description: "Iteration scope for types; interface body", scopeType: "type", isIteration: true, }, "type.iteration.document": { - description: "Iteration scope for a type. This is the entire document.", + description: "Iteration scope for types; entire document.", scopeType: "type", isIteration: true, }, @@ -959,6 +996,10 @@ export const scopeSupportFacetInfos: Record< description: "The body of a class", scopeType: { type: "interior" }, }, + "interior.interface": { + description: "The body of a interface", + scopeType: { type: "interior" }, + }, "interior.function": { description: "The body of a function declaration", scopeType: { type: "interior" }, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 15c72ab7fe..af55910dcd 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -29,8 +29,12 @@ export const scopeSupportFacets = [ "statement", "statement.class", + "statement.interface", + "statement.field.class", + "statement.field.interface", "statement.iteration.document", "statement.iteration.class", + "statement.iteration.interface", "statement.iteration.block", "class", @@ -156,8 +160,10 @@ export const scopeSupportFacets = [ "name.method", "name.constructor", "name.class", + "name.interface", "name.namespace", - "name.field", + "name.field.class", + "name.field.interface", "name.resource", "name.resource.iteration", "name.argument.actual", @@ -170,6 +176,7 @@ export const scopeSupportFacets = [ "name.argument.formal.constructor.iteration", "name.iteration.block", "name.iteration.class", + "name.iteration.interface", "name.iteration.document", "key.attribute", @@ -185,7 +192,7 @@ export const scopeSupportFacets = [ "value.foreach", "value.return", "value.return.lambda", - "value.field", + "value.field.class", "value.yield", "value.typeAlias", "value.resource", @@ -204,13 +211,14 @@ export const scopeSupportFacets = [ "type.variable", "type.return", - "type.field", + "type.field.class", + "type.field.interface", "type.foreach", - "type.interface", "type.enum", "type.alias", "type.cast", "type.class", + "type.interface", "type.resource", "type.resource.iteration", "type.typeArgument", @@ -223,9 +231,11 @@ export const scopeSupportFacets = [ "type.argument.formal.constructor.iteration", "type.iteration.block", "type.iteration.class", + "type.iteration.interface", "type.iteration.document", "interior.class", + "interior.interface", "interior.function", "interior.constructor", "interior.method", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index bb413db6df..4ab0022d00 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -17,7 +17,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": supported, "name.assignment": supported, - "name.field": supported, "name.variable": supported, "name.iteration.block": supported, "name.iteration.document": supported, @@ -26,7 +25,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "statement.iteration.document": supported, "value.assignment": supported, - "value.field": supported, "value.variable": supported, "value.iteration.block": supported, "value.iteration.document": supported, @@ -39,11 +37,47 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, - // Unsupported + // Talon files doesn't actually have classes, but we are incorrectly using this facet for the command + "name.field.class": supported, + "value.field.class": supported, + + /* UNSUPPORTED */ fieldAccess: unsupported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, @@ -95,12 +129,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, "comment.block": notApplicable, @@ -124,10 +152,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -160,12 +186,10 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method": notApplicable, "name.argument.formal.method.iteration": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, - "name.iteration.class": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, "name.resource.iteration": notApplicable, @@ -175,7 +199,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -183,8 +206,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, startTag: notApplicable, - "statement.class": notApplicable, - "statement.iteration.class": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, "textFragment.comment.block": notApplicable, @@ -197,11 +218,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.return": notApplicable, "type.variable": notApplicable, "type.typeArgument": notApplicable, @@ -209,7 +227,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "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, @@ -230,7 +247,6 @@ 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/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 721032b36f..0d7ad37ed7 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -15,7 +15,8 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": supported, "type.alias": supported, "type.cast": supported, - "type.field": supported, + "type.field.class": supported, + "type.field.interface": supported, "type.interface": supported, "type.enum": supported, "type.return": supported, @@ -24,10 +25,19 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": supported, "type.iteration.block": supported, "type.iteration.class": supported, + "type.iteration.interface": supported, "type.iteration.document": supported, "value.typeAlias": supported, + "interior.interface": supported, + "name.interface": supported, + "name.field.interface": supported, + "name.iteration.interface": supported, + "statement.interface": supported, + "statement.field.interface": supported, + "statement.iteration.interface": supported, + /* NOT APPLICABLE */ // Element and tags diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 4fdb4637bb..3aef6098ef 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -18,7 +18,41 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { startTag: supported, tags: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -75,12 +109,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, command: notApplicable, @@ -104,10 +132,8 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -140,14 +166,11 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -159,7 +182,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -167,9 +189,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -183,11 +203,8 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.return": notApplicable, "type.variable": notApplicable, "type.resource": notApplicable, @@ -195,7 +212,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -206,7 +222,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, @@ -219,7 +234,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "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 00b2a1444f..bb71dbdd75 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -27,7 +27,41 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.string.singleLine": supported, "textFragment.comment.line": supported, - // Not applicable + /* NOT APPLICABLE */ + + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -85,12 +119,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, command: notApplicable, "comment.block": notApplicable, "condition.doWhile": notApplicable, @@ -113,10 +141,8 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -147,14 +173,11 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -166,7 +189,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -175,9 +197,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, startTag: notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, @@ -191,11 +211,8 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, @@ -203,7 +220,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -215,7 +231,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.resource": notApplicable, "value.resource.iteration": notApplicable, @@ -226,7 +241,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "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/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts index 7e063938be..0c9a7fad62 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts @@ -98,7 +98,7 @@ async function testLanguageSupport(languageId: string, testedFacets: string[]) { (testedFacet) => !supportedFacets.includes(testedFacet), ); if (unsupportedFacets.length > 0) { - const values = uniq(unsupportedFacets).join(", "); + const values = uniq(unsupportedFacets).sort().join(", "); assert.fail( `Facets [${values}] are tested but not listed in getLanguageScopeSupport`, ); @@ -109,7 +109,7 @@ async function testLanguageSupport(languageId: string, testedFacets: string[]) { (supportedFacet) => !testedFacets.includes(supportedFacet), ); if (untestedFacets.length > 0) { - const values = untestedFacets.join(", "); + const values = untestedFacets.sort().join(", "); assert.fail(`Missing test for scope support facets [${values}]`); } } diff --git a/queries/c.scm b/queries/c.scm index 74a4c91727..23c1b17e94 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -167,13 +167,13 @@ declarator: (_ !declarator ) @name -) @_.domain +) @statement @name.domain (field_declaration declarator: (_ declarator: (_) @name ) -) @_.domain +) @statement @name.domain (initializer_list) @list diff --git a/queries/csharp.scm b/queries/csharp.scm index 06a94e11d1..fd692f2dd3 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -217,6 +217,22 @@ ) ) +;;!! interface IFoo {} +;;! ^^^^^^^^^^^^^^^^^ +(interface_declaration + body: (_ + "{" @interior.start.endOf + "}" @interior.end.startOf + ) +) @type @interior.domain + +(interface_declaration + body: (_ + "{" @statement.iteration.start.endOf @name.iteration.start.endOf @type.iteration.start.endOf + "}" @statement.iteration.end.startOf @name.iteration.end.startOf @type.iteration.end.startOf + ) +) + ;;!! "Hello world" ( (string_literal) @string @textFragment @@ -475,11 +491,7 @@ ) @_.domain ;;!! enum Foo {} -;;!! interface IFoo {} -[ - (enum_declaration) - (interface_declaration) -] @type +(enum_declaration) @type ;; Dictionary values; ;;! ^^^^^^ ^^^ diff --git a/queries/java.scm b/queries/java.scm index 733a1b0cf8..28a4ea3fc6 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -31,6 +31,7 @@ (method_declaration) (constructor_declaration) (field_declaration) + (constant_declaration) ;; exceptions ;; ";", @@ -40,15 +41,23 @@ ;; (if_statement) ] @statement -[ - (class_declaration) - (interface_declaration) - (enum_declaration) -] @type +;;!! enum Foo {} +;;! ^^^^^^^^^^^ +(enum_declaration) @type +;;!! class Foo {} +;;! ^^^^^^^^^^^^ +;;! ^^^ (class_declaration name: (_) @name @className -) @class @_.domain +) @class @type @_.domain + +;;!! interface Foo {} +;;! ^^^^^^^^^^^^^^^^ +;;! ^^^ +(interface_declaration + name: (_) @name +) @type @_.domain ( (program) @class.iteration @className.iteration @statement.iteration @@ -410,7 +419,7 @@ value: (_) @value ) @branch @_.domain -;;!! int value = 1; +;;!! int value = 0; ;;! ^ ;;! xxxx ;;! -------------- @@ -421,13 +430,28 @@ ) ) @_.domain +;;!! int value = 0; +;;! ^^^ +;;! ^^^^^ +;;! ^ (field_declaration + type: (_) @type (variable_declarator name: (_) @name @value.leading.endOf value: (_)? @value @name.trailing.startOf ) ) @_.domain +;;!! int value; +;;! ^^^ +;;! ^^^^^ +(constant_declaration + type: (_) @type + (variable_declarator + name: (_) @name + ) +) @_.domain + ;;!! int foo, bar; ;;! ^^^ ^^^ ( @@ -499,13 +523,6 @@ (#not-type? @value block) ) @_.domain -;;!! Map foo; -;;! ^^^^^^^^^^^^^ -;;! ------------------ -(field_declaration - type: (_) @type -) @_.domain - ;;!! Map foo; ;;! ^^^ ^^^ (type_arguments diff --git a/queries/javascript.scm b/queries/javascript.scm index 5bcc15ce60..979093a68c 100644 --- a/queries/javascript.scm +++ b/queries/javascript.scm @@ -26,9 +26,9 @@ ) (arrow_function) ] - ) @namedFunction.start @functionName.domain.start + ) @statement.start @namedFunction.start @functionName.domain.start . - ";"? @namedFunction.end @functionName.domain.end + ";"? @statement.end @namedFunction.end @functionName.domain.end ) (_ @@ -37,9 +37,9 @@ (field_definition property: (_) @name @value.leading.endOf value: (_)? @value @name.trailing.startOf - ) @_.domain.start + ) @statement.start @_.domain.start . - ";"? @_.domain.end + ";"? @statement.end @_.domain.end ) ;;!! foo(name) {}