diff --git a/data/fixtures/scopes/c/className/className.iteration.document.scope b/data/fixtures/scopes/c/className/className.iteration.document.scope deleted file mode 100644 index e749942fd0..0000000000 --- a/data/fixtures/scopes/c/className/className.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -struct Foo {}; - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| struct Foo {}; -2| - < diff --git a/data/fixtures/scopes/c/className/className.scope b/data/fixtures/scopes/c/className/className.scope deleted file mode 100644 index d576a567fe..0000000000 --- a/data/fixtures/scopes/c/className/className.scope +++ /dev/null @@ -1,24 +0,0 @@ -struct Foo {}; ---- - -[Content] = 0:7-0:10 - >---< -0| struct Foo {}; - -[Removal] = 0:7-0:11 - >----< -0| struct Foo {}; - -[Leading delimiter] = 0:6-0:7 - >-< -0| struct Foo {}; - -[Trailing delimiter] = 0:10-0:11 - >-< -0| struct Foo {}; - -[Domain] = 0:0-0:14 - >--------------< -0| struct Foo {}; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/className/className2.scope b/data/fixtures/scopes/c/className/className2.scope deleted file mode 100644 index 5e439659ee..0000000000 --- a/data/fixtures/scopes/c/className/className2.scope +++ /dev/null @@ -1,24 +0,0 @@ -union Foo {}; ---- - -[Content] = 0:6-0:9 - >---< -0| union Foo {}; - -[Removal] = 0:6-0:10 - >----< -0| union Foo {}; - -[Leading delimiter] = 0:5-0:6 - >-< -0| union Foo {}; - -[Trailing delimiter] = 0:9-0:10 - >-< -0| union Foo {}; - -[Domain] = 0:0-0:13 - >-------------< -0| union Foo {}; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/className/className3.scope b/data/fixtures/scopes/c/className/className3.scope deleted file mode 100644 index cde4791988..0000000000 --- a/data/fixtures/scopes/c/className/className3.scope +++ /dev/null @@ -1,24 +0,0 @@ -enum Foo {}; ---- - -[Content] = 0:5-0:8 - >---< -0| enum Foo {}; - -[Removal] = 0:5-0:9 - >----< -0| enum Foo {}; - -[Leading delimiter] = 0:4-0:5 - >-< -0| enum Foo {}; - -[Trailing delimiter] = 0:8-0:9 - >-< -0| enum Foo {}; - -[Domain] = 0:0-0:12 - >------------< -0| enum Foo {}; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/className/className4.scope b/data/fixtures/scopes/c/className/className4.scope deleted file mode 100644 index ff33e6325b..0000000000 --- a/data/fixtures/scopes/c/className/className4.scope +++ /dev/null @@ -1,20 +0,0 @@ -typedef struct {} Foo; ---- - -[Content] = 0:18-0:21 - >---< -0| typedef struct {} Foo; - -[Removal] = 0:17-0:21 - >----< -0| typedef struct {} Foo; - -[Leading delimiter] = 0:17-0:18 - >-< -0| typedef struct {} Foo; - -[Domain] = 0:0-0:22 - >----------------------< -0| typedef struct {} Foo; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/className/className5.scope b/data/fixtures/scopes/c/className/className5.scope deleted file mode 100644 index 881793c827..0000000000 --- a/data/fixtures/scopes/c/className/className5.scope +++ /dev/null @@ -1,20 +0,0 @@ -typedef union {} Foo; ---- - -[Content] = 0:17-0:20 - >---< -0| typedef union {} Foo; - -[Removal] = 0:16-0:20 - >----< -0| typedef union {} Foo; - -[Leading delimiter] = 0:16-0:17 - >-< -0| typedef union {} Foo; - -[Domain] = 0:0-0:21 - >---------------------< -0| typedef union {} Foo; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/className/className6.scope b/data/fixtures/scopes/c/className/className6.scope deleted file mode 100644 index bc6aa501ba..0000000000 --- a/data/fixtures/scopes/c/className/className6.scope +++ /dev/null @@ -1,20 +0,0 @@ -typedef enum {} Foo; ---- - -[Content] = 0:16-0:19 - >---< -0| typedef enum {} Foo; - -[Removal] = 0:15-0:19 - >----< -0| typedef enum {} Foo; - -[Leading delimiter] = 0:15-0:16 - >-< -0| typedef enum {} Foo; - -[Domain] = 0:0-0:20 - >--------------------< -0| typedef enum {} Foo; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/functionName/functionName.iteration.document.scope b/data/fixtures/scopes/c/functionName/functionName.iteration.document.scope deleted file mode 100644 index 3196afd2bb..0000000000 --- a/data/fixtures/scopes/c/functionName/functionName.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -void foo() {} - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| void foo() {} -2| - < diff --git a/data/fixtures/scopes/c/functionName/functionName.scope b/data/fixtures/scopes/c/functionName/functionName.scope deleted file mode 100644 index 502edc21b0..0000000000 --- a/data/fixtures/scopes/c/functionName/functionName.scope +++ /dev/null @@ -1,13 +0,0 @@ -void C::funcName() {} ---- - -[Content] = -[Removal] = 0:8-0:16 - >--------< -0| void C::funcName() {} - -[Domain] = 0:0-0:21 - >---------------------< -0| void C::funcName() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/functionName/functionName2.scope b/data/fixtures/scopes/c/functionName/functionName2.scope deleted file mode 100644 index 9e40ba4f95..0000000000 --- a/data/fixtures/scopes/c/functionName/functionName2.scope +++ /dev/null @@ -1,13 +0,0 @@ -void C::funcName(); ---- - -[Content] = -[Removal] = 0:8-0:16 - >--------< -0| void C::funcName(); - -[Domain] = 0:0-0:19 - >-------------------< -0| void C::funcName(); - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/functionName/functionName3.scope b/data/fixtures/scopes/c/functionName/functionName3.scope deleted file mode 100644 index d4efab616e..0000000000 --- a/data/fixtures/scopes/c/functionName/functionName3.scope +++ /dev/null @@ -1,17 +0,0 @@ -void aaa() {} ---- - -[Content] = -[Removal] = 0:5-0:8 - >---< -0| void aaa() {} - -[Leading delimiter] = 0:4-0:5 - >-< -0| void aaa() {} - -[Domain] = 0:0-0:13 - >-------------< -0| void aaa() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/functionName/functionName4.scope b/data/fixtures/scopes/c/functionName/functionName4.scope deleted file mode 100644 index 09d348b493..0000000000 --- a/data/fixtures/scopes/c/functionName/functionName4.scope +++ /dev/null @@ -1,17 +0,0 @@ -void aaa(); ---- - -[Content] = -[Removal] = 0:5-0:8 - >---< -0| void aaa(); - -[Leading delimiter] = 0:4-0:5 - >-< -0| void aaa(); - -[Domain] = 0:0-0:11 - >-----------< -0| void aaa(); - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/className.scope b/data/fixtures/scopes/cpp/className.scope deleted file mode 100644 index d7fe067187..0000000000 --- a/data/fixtures/scopes/cpp/className.scope +++ /dev/null @@ -1,24 +0,0 @@ -class Foo {}; ---- - -[Content] = 0:6-0:9 - >---< -0| class Foo {}; - -[Removal] = 0:6-0:10 - >----< -0| class Foo {}; - -[Leading delimiter] = 0:5-0:6 - >-< -0| class Foo {}; - -[Trailing delimiter] = 0:9-0:10 - >-< -0| class Foo {}; - -[Domain] = 0:0-0:13 - >-------------< -0| class Foo {}; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/className2.scope b/data/fixtures/scopes/cpp/className2.scope deleted file mode 100644 index 472693da6f..0000000000 --- a/data/fixtures/scopes/cpp/className2.scope +++ /dev/null @@ -1,20 +0,0 @@ -void Foo::bar() {} ---- - -[Content] = 0:5-0:8 - >---< -0| void Foo::bar() {} - -[Removal] = 0:4-0:8 - >----< -0| void Foo::bar() {} - -[Leading delimiter] = 0:4-0:5 - >-< -0| void Foo::bar() {} - -[Domain] = 0:0-0:18 - >------------------< -0| void Foo::bar() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/functionName.constructor.scope b/data/fixtures/scopes/cpp/functionName.constructor.scope deleted file mode 100644 index 1ce29e9861..0000000000 --- a/data/fixtures/scopes/cpp/functionName.constructor.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Foo { - Foo() {} -} ---- - -[Content] = -[Removal] = 1:4-1:7 - >---< -1| Foo() {} - -[Leading delimiter] = 1:0-1:4 - >----< -1| Foo() {} - -[Domain] = 1:4-1:12 - >--------< -1| Foo() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/functionName.constructor2.scope b/data/fixtures/scopes/cpp/functionName.constructor2.scope deleted file mode 100644 index 847488aca9..0000000000 --- a/data/fixtures/scopes/cpp/functionName.constructor2.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Foo { - ~Foo() {} -} ---- - -[Content] = -[Removal] = 1:4-1:8 - >----< -1| ~Foo() {} - -[Leading delimiter] = 1:0-1:4 - >----< -1| ~Foo() {} - -[Domain] = 1:4-1:13 - >---------< -1| ~Foo() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/functionName.method.iteration.class.scope b/data/fixtures/scopes/cpp/functionName.method.iteration.class.scope deleted file mode 100644 index a3ec5f3456..0000000000 --- a/data/fixtures/scopes/cpp/functionName.method.iteration.class.scope +++ /dev/null @@ -1,13 +0,0 @@ -class Foo { } ---- - -[#1 Content] = -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - - -[#2 Content] = -[#2 Domain] = 0:11-0:12 - >-< -0| class Foo { } diff --git a/data/fixtures/scopes/cpp/functionName.method.scope b/data/fixtures/scopes/cpp/functionName.method.scope deleted file mode 100644 index 4988ae8bf1..0000000000 --- a/data/fixtures/scopes/cpp/functionName.method.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Foo { - void bar() {} -} ---- - -[Content] = -[Removal] = 1:9-1:12 - >---< -1| void bar() {} - -[Leading delimiter] = 1:8-1:9 - >-< -1| void bar() {} - -[Domain] = 1:4-1:17 - >-------------< -1| void bar() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.class2.scope b/data/fixtures/scopes/cpp/name/name.class2.scope new file mode 100644 index 0000000000..3f34e8cda7 --- /dev/null +++ b/data/fixtures/scopes/cpp/name/name.class2.scope @@ -0,0 +1,13 @@ +void Foo::bar() {} +--- + +[Content] = +[Removal] = 0:10-0:13 + >---< +0| void Foo::bar() {} + +[Domain] = 0:0-0:18 + >------------------< +0| void Foo::bar() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/className.iteration.block.scope b/data/fixtures/scopes/csharp/className.iteration.block.scope deleted file mode 100644 index b2423a8bd5..0000000000 --- a/data/fixtures/scopes/csharp/className.iteration.block.scope +++ /dev/null @@ -1,27 +0,0 @@ -public class Foo { - public class Bar { } -} ---- - -[#1 Content] = -[#1 Domain] = 0:0-2:1 - >------------------ -0| public class Foo { -1| public class Bar { } -2| } - -< - - -[#2 Content] = -[#2 Domain] = 0:18-2:0 - > -0| public class Foo { -1| public class Bar { } -2| } - < - - -[#3 Content] = -[#3 Domain] = 1:20-1:21 - >-< -1| public class Bar { } diff --git a/data/fixtures/scopes/csharp/className.iteration.document.scope b/data/fixtures/scopes/csharp/className.iteration.document.scope deleted file mode 100644 index 813bb62ea9..0000000000 --- a/data/fixtures/scopes/csharp/className.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -class Foo {} - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| class Foo {} -2| - < diff --git a/data/fixtures/scopes/csharp/functionName/functionName.constructor.scope b/data/fixtures/scopes/csharp/functionName/functionName.constructor.scope deleted file mode 100644 index 7f560bc3d2..0000000000 --- a/data/fixtures/scopes/csharp/functionName/functionName.constructor.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Program { - public Program() { } -} ---- - -[Content] = -[Removal] = 1:11-1:18 - >-------< -1| public Program() { } - -[Leading delimiter] = 1:10-1:11 - >-< -1| public Program() { } - -[Domain] = 1:4-1:24 - >--------------------< -1| public Program() { } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/functionName/functionName.iteration.document.scope b/data/fixtures/scopes/csharp/functionName/functionName.iteration.document.scope deleted file mode 100644 index 76639112c1..0000000000 --- a/data/fixtures/scopes/csharp/functionName/functionName.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -void Foo() { } - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| void Foo() { } -2| - < diff --git a/data/fixtures/scopes/csharp/functionName/functionName.method.iteration.class.scope b/data/fixtures/scopes/csharp/functionName/functionName.method.iteration.class.scope deleted file mode 100644 index a3ec5f3456..0000000000 --- a/data/fixtures/scopes/csharp/functionName/functionName.method.iteration.class.scope +++ /dev/null @@ -1,13 +0,0 @@ -class Foo { } ---- - -[#1 Content] = -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - - -[#2 Content] = -[#2 Domain] = 0:11-0:12 - >-< -0| class Foo { } diff --git a/data/fixtures/scopes/csharp/functionName/functionName.method.scope b/data/fixtures/scopes/csharp/functionName/functionName.method.scope deleted file mode 100644 index a67bdcb86b..0000000000 --- a/data/fixtures/scopes/csharp/functionName/functionName.method.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Program { - public void foo() { } -} ---- - -[Content] = -[Removal] = 1:16-1:19 - >---< -1| public void foo() { } - -[Leading delimiter] = 1:15-1:16 - >-< -1| public void foo() { } - -[Domain] = 1:4-1:25 - >---------------------< -1| public void foo() { } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/functionName/functionName.scope b/data/fixtures/scopes/csharp/functionName/functionName.scope deleted file mode 100644 index 155015bf27..0000000000 --- a/data/fixtures/scopes/csharp/functionName/functionName.scope +++ /dev/null @@ -1,17 +0,0 @@ -void Foo() { } ---- - -[Content] = -[Removal] = 0:5-0:8 - >---< -0| void Foo() { } - -[Leading delimiter] = 0:4-0:5 - >-< -0| void Foo() { } - -[Domain] = 0:0-0:14 - >--------------< -0| void Foo() { } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/dart/className.scope b/data/fixtures/scopes/dart/name.class.scope similarity index 100% rename from data/fixtures/scopes/dart/className.scope rename to data/fixtures/scopes/dart/name.class.scope diff --git a/data/fixtures/scopes/java/className.iteration.block.scope b/data/fixtures/scopes/java/className.iteration.block.scope deleted file mode 100644 index a3ec5f3456..0000000000 --- a/data/fixtures/scopes/java/className.iteration.block.scope +++ /dev/null @@ -1,13 +0,0 @@ -class Foo { } ---- - -[#1 Content] = -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - - -[#2 Content] = -[#2 Domain] = 0:11-0:12 - >-< -0| class Foo { } diff --git a/data/fixtures/scopes/java/className.iteration.document.scope b/data/fixtures/scopes/java/className.iteration.document.scope deleted file mode 100644 index 813bb62ea9..0000000000 --- a/data/fixtures/scopes/java/className.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -class Foo {} - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| class Foo {} -2| - < diff --git a/data/fixtures/scopes/java/className.scope b/data/fixtures/scopes/java/className.scope deleted file mode 100644 index 793da2dfad..0000000000 --- a/data/fixtures/scopes/java/className.scope +++ /dev/null @@ -1,24 +0,0 @@ -public class Foo {} ---- - -[Content] = 0:13-0:16 - >---< -0| public class Foo {} - -[Removal] = 0:13-0:17 - >----< -0| public class Foo {} - -[Leading delimiter] = 0:12-0:13 - >-< -0| public class Foo {} - -[Trailing delimiter] = 0:16-0:17 - >-< -0| public class Foo {} - -[Domain] = 0:0-0:19 - >-------------------< -0| public class Foo {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionName.constructor.scope b/data/fixtures/scopes/java/functionName.constructor.scope deleted file mode 100644 index e07a251942..0000000000 --- a/data/fixtures/scopes/java/functionName.constructor.scope +++ /dev/null @@ -1,19 +0,0 @@ -public class Foo { - public Foo() {} -} ---- - -[Content] = -[Removal] = 1:11-1:14 - >---< -1| public Foo() {} - -[Leading delimiter] = 1:10-1:11 - >-< -1| public Foo() {} - -[Domain] = 1:4-1:19 - >---------------< -1| public Foo() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/functionName.method.iteration.class.scope b/data/fixtures/scopes/java/functionName.method.iteration.class.scope deleted file mode 100644 index aaf1f0f34f..0000000000 --- a/data/fixtures/scopes/java/functionName.method.iteration.class.scope +++ /dev/null @@ -1,7 +0,0 @@ -class Foo { } ---- - -[Content] = -[Domain] = 0:11-0:12 - >-< -0| class Foo { } diff --git a/data/fixtures/scopes/java/functionName.method.scope b/data/fixtures/scopes/java/functionName.method.scope deleted file mode 100644 index bb09eca963..0000000000 --- a/data/fixtures/scopes/java/functionName.method.scope +++ /dev/null @@ -1,19 +0,0 @@ -public class Foo { - public void bar() {} -} ---- - -[Content] = -[Removal] = 1:16-1:19 - >---< -1| public void bar() {} - -[Leading delimiter] = 1:15-1:16 - >-< -1| public void bar() {} - -[Domain] = 1:4-1:24 - >--------------------< -1| public void bar() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.class2.scope b/data/fixtures/scopes/java/name/name.class2.scope new file mode 100644 index 0000000000..37cc86d056 --- /dev/null +++ b/data/fixtures/scopes/java/name/name.class2.scope @@ -0,0 +1,27 @@ +@bar +public class Foo {} +--- + +[Content] = 1:13-1:16 + >---< +1| public class Foo {} + +[Removal] = 1:13-1:17 + >----< +1| public class Foo {} + +[Leading delimiter] = 1:12-1:13 + >-< +1| public class Foo {} + +[Trailing delimiter] = 1:16-1:17 + >-< +1| public class Foo {} + +[Domain] = 0:0-1:19 + >---- +0| @bar +1| public class Foo {} + -------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.constructor2.scope b/data/fixtures/scopes/java/name/name.constructor2.scope new file mode 100644 index 0000000000..06bd6b05a0 --- /dev/null +++ b/data/fixtures/scopes/java/name/name.constructor2.scope @@ -0,0 +1,49 @@ +public class Foo { + @bar + public Foo() {} +} +--- + +[#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| @bar +2| public Foo() {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:11-2:14 + >---< +2| public Foo() {} + +[#2 Leading delimiter] = 2:10-2:11 + >-< +2| public Foo() {} + +[#2 Domain] = 1:4-2:19 + >---- +1| @bar +2| public Foo() {} + -------------------< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.method2.scope b/data/fixtures/scopes/java/name/name.method2.scope new file mode 100644 index 0000000000..84b4e78150 --- /dev/null +++ b/data/fixtures/scopes/java/name/name.method2.scope @@ -0,0 +1,49 @@ +public class Foo { + @baz + public void bar() {} +} +--- + +[#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| @baz +2| public void bar() {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:16-2:19 + >---< +2| public void bar() {} + +[#2 Leading delimiter] = 2:15-2:16 + >-< +2| public void bar() {} + +[#2 Domain] = 1:4-2:24 + >---- +1| @baz +2| public void bar() {} + ------------------------< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/anonymousFunction2.scope b/data/fixtures/scopes/javascript.core/anonymousFunction2.scope index 6ff2c1d6c3..1b11b2846e 100644 --- a/data/fixtures/scopes/javascript.core/anonymousFunction2.scope +++ b/data/fixtures/scopes/javascript.core/anonymousFunction2.scope @@ -1,10 +1,10 @@ -() => {} +function *() {} --- [Content] = [Removal] = -[Domain] = 0:0-0:8 - >--------< -0| () => {} +[Domain] = 0:0-0:15 + >---------------< +0| function *() {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/anonymousFunction3.scope b/data/fixtures/scopes/javascript.core/anonymousFunction3.scope index 5556d41df0..6ff2c1d6c3 100644 --- a/data/fixtures/scopes/javascript.core/anonymousFunction3.scope +++ b/data/fixtures/scopes/javascript.core/anonymousFunction3.scope @@ -1,10 +1,10 @@ -() => 0 +() => {} --- [Content] = [Removal] = -[Domain] = 0:0-0:7 - >-------< -0| () => 0 +[Domain] = 0:0-0:8 + >--------< +0| () => {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/anonymousFunction4.scope b/data/fixtures/scopes/javascript.core/anonymousFunction4.scope new file mode 100644 index 0000000000..5556d41df0 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/anonymousFunction4.scope @@ -0,0 +1,10 @@ +() => 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:7 + >-------< +0| () => 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/class2.scope b/data/fixtures/scopes/javascript.core/class2.scope index 47e52ec710..6589c550c4 100644 --- a/data/fixtures/scopes/javascript.core/class2.scope +++ b/data/fixtures/scopes/javascript.core/class2.scope @@ -1,10 +1,10 @@ -export default class Foo {} +export class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:27 - >---------------------------< -0| export default class Foo {} +[Domain] = 0:0-0:19 + >-------------------< +0| export 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 6589c550c4..b73b26f0f0 100644 --- a/data/fixtures/scopes/javascript.core/class3.scope +++ b/data/fixtures/scopes/javascript.core/class3.scope @@ -1,10 +1,13 @@ -export class Foo {} +@bar +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:19 - >-------------------< -0| export class Foo {} +[Domain] = 0:0-1:12 + >---- +0| @bar +1| class Foo {} + ------------< [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/className.iteration.document.scope b/data/fixtures/scopes/javascript.core/className.iteration.document.scope deleted file mode 100644 index 813bb62ea9..0000000000 --- a/data/fixtures/scopes/javascript.core/className.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -class Foo {} - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| class Foo {} -2| - < diff --git a/data/fixtures/scopes/javascript.core/className.scope b/data/fixtures/scopes/javascript.core/className.scope deleted file mode 100644 index 211086562c..0000000000 --- a/data/fixtures/scopes/javascript.core/className.scope +++ /dev/null @@ -1,24 +0,0 @@ -class Foo {} ---- - -[Content] = 0:6-0:9 - >---< -0| class Foo {} - -[Removal] = 0:6-0:10 - >----< -0| class Foo {} - -[Leading delimiter] = 0:5-0:6 - >-< -0| class Foo {} - -[Trailing delimiter] = 0:9-0:10 - >-< -0| class Foo {} - -[Domain] = 0:0-0:12 - >------------< -0| class Foo {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName.constructor.scope b/data/fixtures/scopes/javascript.core/functionName/functionName.constructor.scope deleted file mode 100644 index d06c62fae0..0000000000 --- a/data/fixtures/scopes/javascript.core/functionName/functionName.constructor.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Foo { - constructor() { } -} ---- - -[Content] = -[Removal] = 1:2-1:13 - >-----------< -1| constructor() { } - -[Leading delimiter] = 1:0-1:2 - >--< -1| constructor() { } - -[Domain] = 1:2-1:19 - >-----------------< -1| constructor() { } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName.iteration.document.scope b/data/fixtures/scopes/javascript.core/functionName/functionName.iteration.document.scope deleted file mode 100644 index 79172806b9..0000000000 --- a/data/fixtures/scopes/javascript.core/functionName/functionName.iteration.document.scope +++ /dev/null @@ -1,12 +0,0 @@ - -function foo() {} - ---- - -[Content] = -[Domain] = 0:0-2:0 - > -0| -1| function foo() {} -2| - < diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName.method.iteration.class.scope b/data/fixtures/scopes/javascript.core/functionName/functionName.method.iteration.class.scope deleted file mode 100644 index a3ec5f3456..0000000000 --- a/data/fixtures/scopes/javascript.core/functionName/functionName.method.iteration.class.scope +++ /dev/null @@ -1,13 +0,0 @@ -class Foo { } ---- - -[#1 Content] = -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - - -[#2 Content] = -[#2 Domain] = 0:11-0:12 - >-< -0| class Foo { } diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName.method.scope b/data/fixtures/scopes/javascript.core/functionName/functionName.method.scope deleted file mode 100644 index d29784f2a7..0000000000 --- a/data/fixtures/scopes/javascript.core/functionName/functionName.method.scope +++ /dev/null @@ -1,19 +0,0 @@ -class Foo { - bar() {} -} ---- - -[Content] = -[Removal] = 1:2-1:5 - >---< -1| bar() {} - -[Leading delimiter] = 1:0-1:2 - >--< -1| bar() {} - -[Domain] = 1:2-1:10 - >--------< -1| bar() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName2.scope b/data/fixtures/scopes/javascript.core/functionName/functionName2.scope deleted file mode 100644 index 5feebc9e95..0000000000 --- a/data/fixtures/scopes/javascript.core/functionName/functionName2.scope +++ /dev/null @@ -1,20 +0,0 @@ -map = { funk: () => { } } ---- - -[Content] = 0:8-0:12 - >----< -0| map = { funk: () => { } } - -[Removal] = 0:7-0:12 - >-----< -0| map = { funk: () => { } } - -[Leading delimiter] = 0:7-0:8 - >-< -0| map = { funk: () => { } } - -[Domain] = 0:8-0:23 - >---------------< -0| map = { funk: () => { } } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName3.scope b/data/fixtures/scopes/javascript.core/functionName/functionName3.scope deleted file mode 100644 index b3da95fd14..0000000000 --- a/data/fixtures/scopes/javascript.core/functionName/functionName3.scope +++ /dev/null @@ -1,20 +0,0 @@ -map = { funk: function() { } } ---- - -[Content] = 0:8-0:12 - >----< -0| map = { funk: function() { } } - -[Removal] = 0:7-0:12 - >-----< -0| map = { funk: function() { } } - -[Leading delimiter] = 0:7-0:8 - >-< -0| map = { funk: function() { } } - -[Domain] = 0:8-0:28 - >--------------------< -0| map = { funk: function() { } } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/className.scope b/data/fixtures/scopes/javascript.core/name/name.class2.scope similarity index 66% rename from data/fixtures/scopes/csharp/className.scope rename to data/fixtures/scopes/javascript.core/name/name.class2.scope index 793da2dfad..7fa37b198c 100644 --- a/data/fixtures/scopes/csharp/className.scope +++ b/data/fixtures/scopes/javascript.core/name/name.class2.scope @@ -1,24 +1,24 @@ -public class Foo {} +export class Foo {} --- [Content] = 0:13-0:16 >---< -0| public class Foo {} +0| export class Foo {} [Removal] = 0:13-0:17 >----< -0| public class Foo {} +0| export class Foo {} [Leading delimiter] = 0:12-0:13 >-< -0| public class Foo {} +0| export class Foo {} [Trailing delimiter] = 0:16-0:17 >-< -0| public class Foo {} +0| export class Foo {} [Domain] = 0:0-0:19 >-------------------< -0| public class Foo {} +0| export class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.class3.scope b/data/fixtures/scopes/javascript.core/name/name.class3.scope new file mode 100644 index 0000000000..3b8c95fe9a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.class3.scope @@ -0,0 +1,27 @@ +@bar +class Foo {} +--- + +[Content] = 1:6-1:9 + >---< +1| class Foo {} + +[Removal] = 1:6-1:10 + >----< +1| class Foo {} + +[Leading delimiter] = 1:5-1:6 + >-< +1| class Foo {} + +[Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo {} + +[Domain] = 0:0-1:12 + >---- +0| @bar +1| class Foo {} + ------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.field.class2.scope b/data/fixtures/scopes/javascript.core/name/name.field.class2.scope new file mode 100644 index 0000000000..3edbee9a79 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.field.class2.scope @@ -0,0 +1,52 @@ +class Foo { + @baz + bar = 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| @baz +2| bar = 0; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:2-2:5 + >---< +2| bar = 0; + +[#2 Removal] = 2:2-2:8 + >------< +2| bar = 0; + +[#2 Trailing delimiter] = 2:5-2:8 + >---< +2| bar = 0; + +[#2 Domain] = 1:2-2:10 + >---- +1| @baz +2| bar = 0; + ----------< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function10.scope b/data/fixtures/scopes/javascript.core/name/name.function10.scope new file mode 100644 index 0000000000..ea33c653b5 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function10.scope @@ -0,0 +1,20 @@ +export const foo = () => {}; +--- + +[Content] = 0:13-0:16 + >---< +0| export const foo = () => {}; + +[Removal] = 0:13-0:19 + >------< +0| export const foo = () => {}; + +[Trailing delimiter] = 0:16-0:19 + >---< +0| export const foo = () => {}; + +[Domain] = 0:0-0:28 + >----------------------------< +0| export const foo = () => {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function11.scope b/data/fixtures/scopes/javascript.core/name/name.function11.scope new file mode 100644 index 0000000000..2df93cd0e2 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function11.scope @@ -0,0 +1,40 @@ +const foo = function bar() {}; +--- + +[#1 Content] = 0:6-0:9 + >---< +0| const foo = function bar() {}; + +[#1 Removal] = 0:0-0:12 + >------------< +0| const foo = function bar() {}; + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| const foo = function bar() {}; + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = function bar() {}; + +[#1 Domain] = 0:0-0:30 + >------------------------------< +0| const foo = function bar() {}; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:21-0:24 + >---< +0| const foo = function bar() {}; + +[#2 Leading delimiter] = 0:20-0:21 + >-< +0| const foo = function bar() {}; + +[#2 Domain] = 0:12-0:29 + >-----------------< +0| const foo = function bar() {}; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function12.scope b/data/fixtures/scopes/javascript.core/name/name.function12.scope new file mode 100644 index 0000000000..e714ebf651 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function12.scope @@ -0,0 +1,36 @@ +const foo = function *bar() {}; +--- + +[#1 Content] = 0:6-0:9 + >---< +0| const foo = function *bar() {}; + +[#1 Removal] = 0:0-0:12 + >------------< +0| const foo = function *bar() {}; + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| const foo = function *bar() {}; + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = function *bar() {}; + +[#1 Domain] = 0:0-0:31 + >-------------------------------< +0| const foo = function *bar() {}; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:22-0:25 + >---< +0| const foo = function *bar() {}; + +[#2 Domain] = 0:12-0:30 + >------------------< +0| const foo = function *bar() {}; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function2.scope b/data/fixtures/scopes/javascript.core/name/name.function2.scope new file mode 100644 index 0000000000..97b940c441 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function2.scope @@ -0,0 +1,13 @@ +function *foo() {} +--- + +[Content] = +[Removal] = 0:10-0:13 + >---< +0| function *foo() {} + +[Domain] = 0:0-0:18 + >------------------< +0| function *foo() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function3.scope b/data/fixtures/scopes/javascript.core/name/name.function3.scope new file mode 100644 index 0000000000..4757e906e3 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function3.scope @@ -0,0 +1,24 @@ +const foo = function() {}; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo = function() {}; + +[Removal] = 0:0-0:12 + >------------< +0| const foo = function() {}; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo = function() {}; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = function() {}; + +[Domain] = 0:0-0:26 + >--------------------------< +0| const foo = function() {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function4.scope b/data/fixtures/scopes/javascript.core/name/name.function4.scope new file mode 100644 index 0000000000..a91c1c6571 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function4.scope @@ -0,0 +1,24 @@ +const foo = function *() {}; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo = function *() {}; + +[Removal] = 0:0-0:12 + >------------< +0| const foo = function *() {}; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo = function *() {}; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = function *() {}; + +[Domain] = 0:0-0:28 + >----------------------------< +0| const foo = function *() {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function5.scope b/data/fixtures/scopes/javascript.core/name/name.function5.scope new file mode 100644 index 0000000000..29f0dd8cdd --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function5.scope @@ -0,0 +1,24 @@ +const foo = () => {}; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo = () => {}; + +[Removal] = 0:0-0:12 + >------------< +0| const foo = () => {}; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo = () => {}; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = () => {}; + +[Domain] = 0:0-0:21 + >---------------------< +0| const foo = () => {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function6.scope b/data/fixtures/scopes/javascript.core/name/name.function6.scope new file mode 100644 index 0000000000..db5fffdd91 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function6.scope @@ -0,0 +1,17 @@ +export function foo() {} +--- + +[Content] = +[Removal] = 0:16-0:19 + >---< +0| export function foo() {} + +[Leading delimiter] = 0:15-0:16 + >-< +0| export function foo() {} + +[Domain] = 0:0-0:24 + >------------------------< +0| export function foo() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function7.scope b/data/fixtures/scopes/javascript.core/name/name.function7.scope new file mode 100644 index 0000000000..82d0a05acc --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function7.scope @@ -0,0 +1,13 @@ +export function *foo() {} +--- + +[Content] = +[Removal] = 0:17-0:20 + >---< +0| export function *foo() {} + +[Domain] = 0:0-0:25 + >-------------------------< +0| export function *foo() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function8.scope b/data/fixtures/scopes/javascript.core/name/name.function8.scope new file mode 100644 index 0000000000..f2e840fe8f --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function8.scope @@ -0,0 +1,20 @@ +export const foo = function() {}; +--- + +[Content] = 0:13-0:16 + >---< +0| export const foo = function() {}; + +[Removal] = 0:13-0:19 + >------< +0| export const foo = function() {}; + +[Trailing delimiter] = 0:16-0:19 + >---< +0| export const foo = function() {}; + +[Domain] = 0:0-0:33 + >---------------------------------< +0| export const foo = function() {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.function9.scope b/data/fixtures/scopes/javascript.core/name/name.function9.scope new file mode 100644 index 0000000000..edca0b10dc --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.function9.scope @@ -0,0 +1,20 @@ +export const foo = function *() {}; +--- + +[Content] = 0:13-0:16 + >---< +0| export const foo = function *() {}; + +[Removal] = 0:13-0:19 + >------< +0| export const foo = function *() {}; + +[Trailing delimiter] = 0:16-0:19 + >---< +0| export const foo = function *() {}; + +[Domain] = 0:0-0:35 + >-----------------------------------< +0| export const foo = function *() {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method.scope b/data/fixtures/scopes/javascript.core/name/name.method.scope index 2a89f29b57..7c5640f57e 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method.scope @@ -1,5 +1,5 @@ class Foo { - bar() {} + bar() {} } --- @@ -22,7 +22,7 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| bar() {} +1| bar() {} 2| } -< @@ -30,16 +30,16 @@ class Foo { [#2 Content] = -[#2 Removal] = 1:2-1:5 - >---< -1| bar() {} +[#2 Removal] = 1:4-1:7 + >---< +1| bar() {} -[#2 Leading delimiter] = 1:0-1:2 - >--< -1| bar() {} +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar() {} -[#2 Domain] = 1:2-1:10 - >--------< -1| bar() {} +[#2 Domain] = 1:4-1:12 + >--------< +1| bar() {} [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method2.scope b/data/fixtures/scopes/javascript.core/name/name.method2.scope new file mode 100644 index 0000000000..c70d6c2bb1 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method2.scope @@ -0,0 +1,49 @@ +class Foo { + @baz + bar() {} +} +--- + +[#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| @baz +2| bar() {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:4-2:7 + >---< +2| bar() {} + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| bar() {} + +[#2 Domain] = 1:4-2:12 + >---- +1| @baz +2| bar() {} + ------------< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method3.scope b/data/fixtures/scopes/javascript.core/name/name.method3.scope new file mode 100644 index 0000000000..9bcbbaf703 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method3.scope @@ -0,0 +1,48 @@ +class Foo { + bar = () => {} +} +--- + +[#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| bar = () => {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar = () => {} + +[#2 Removal] = 1:4-1:10 + >------< +1| bar = () => {} + +[#2 Trailing delimiter] = 1:7-1:10 + >---< +1| bar = () => {} + +[#2 Domain] = 1:4-1:18 + >--------------< +1| bar = () => {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method4.scope b/data/fixtures/scopes/javascript.core/name/name.method4.scope new file mode 100644 index 0000000000..2c13166d2f --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method4.scope @@ -0,0 +1,52 @@ +class Foo { + @baz + bar = () => {} +} +--- + +[#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| @baz +2| bar = () => {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:4-2:7 + >---< +2| bar = () => {} + +[#2 Removal] = 2:4-2:10 + >------< +2| bar = () => {} + +[#2 Trailing delimiter] = 2:7-2:10 + >---< +2| bar = () => {} + +[#2 Domain] = 1:4-2:18 + >---- +1| @baz +2| bar = () => {} + ------------------< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method5.scope b/data/fixtures/scopes/javascript.core/name/name.method5.scope new file mode 100644 index 0000000000..ee154f2ff1 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method5.scope @@ -0,0 +1,45 @@ +const foo = { + bar() {} +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| const foo = { + +[#1 Removal] = 0:0-0:12 + >------------< +0| const foo = { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| const foo = { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = { + +[#1 Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar() {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:7 + >---< +1| bar() {} + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar() {} + +[#2 Domain] = 1:4-1:12 + >--------< +1| bar() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method6.scope b/data/fixtures/scopes/javascript.core/name/name.method6.scope new file mode 100644 index 0000000000..e8f60f21e9 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method6.scope @@ -0,0 +1,48 @@ +const foo = { + bar: function() {} +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| const foo = { + +[#1 Removal] = 0:0-0:12 + >------------< +0| const foo = { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| const foo = { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = { + +[#1 Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar: function() {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar: function() {} + +[#2 Removal] = 1:4-1:9 + >-----< +1| bar: function() {} + +[#2 Trailing delimiter] = 1:7-1:9 + >--< +1| bar: function() {} + +[#2 Domain] = 1:4-1:22 + >------------------< +1| bar: function() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method7.scope b/data/fixtures/scopes/javascript.core/name/name.method7.scope new file mode 100644 index 0000000000..73fab4f338 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method7.scope @@ -0,0 +1,48 @@ +const foo = { + bar: function *() {} +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| const foo = { + +[#1 Removal] = 0:0-0:12 + >------------< +0| const foo = { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| const foo = { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = { + +[#1 Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar: function *() {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar: function *() {} + +[#2 Removal] = 1:4-1:9 + >-----< +1| bar: function *() {} + +[#2 Trailing delimiter] = 1:7-1:9 + >--< +1| bar: function *() {} + +[#2 Domain] = 1:4-1:24 + >--------------------< +1| bar: function *() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method8.scope b/data/fixtures/scopes/javascript.core/name/name.method8.scope new file mode 100644 index 0000000000..dd1369ea13 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.method8.scope @@ -0,0 +1,48 @@ +const foo = { + bar: () => {} +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| const foo = { + +[#1 Removal] = 0:0-0:12 + >------------< +0| const foo = { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| const foo = { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = { + +[#1 Domain] = 0:0-2:1 + >------------- +0| const foo = { +1| bar: () => {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar: () => {} + +[#2 Removal] = 1:4-1:9 + >-----< +1| bar: () => {} + +[#2 Trailing delimiter] = 1:7-1:9 + >--< +1| bar: () => {} + +[#2 Domain] = 1:4-1:17 + >-------------< +1| bar: () => {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method.scope index 5c901cbaf6..4652918f42 100644 --- a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method.scope +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method.scope @@ -1,21 +1,21 @@ class Foo { - bar() {} + bar() {} } --- [Content] = -[Domain] = 1:2-1:10 - >--------< -1| bar() {} +[Domain] = 1:4-1:12 + >--------< +1| bar() {} [Removal] = 1:0-2:0 - >---------- -1| bar() {} + >------------ +1| bar() {} 2| } < -[Leading delimiter] = 1:0-1:2 - >--< -1| bar() {} +[Leading delimiter] = 1:0-1:4 + >----< +1| bar() {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope new file mode 100644 index 0000000000..50878c3485 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope @@ -0,0 +1,25 @@ +class Foo { + @baz + bar() {} +} +--- + +[Content] = +[Domain] = 1:4-2:12 + >---- +1| @baz +2| bar() {} + ------------< + +[Removal] = 1:0-3:0 + >-------- +1| @baz +2| bar() {} +3| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| @baz + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method3.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method3.scope new file mode 100644 index 0000000000..52f19ed0b2 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method3.scope @@ -0,0 +1,21 @@ +class Foo { + bar = () => {} +} +--- + +[Content] = +[Domain] = 1:4-1:18 + >--------------< +1| bar = () => {} + +[Removal] = 1:0-2:0 + >------------------ +1| bar = () => {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| bar = () => {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope new file mode 100644 index 0000000000..5ac9812e1b --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope @@ -0,0 +1,25 @@ +class Foo { + @baz + bar = () => {} +} +--- + +[Content] = +[Domain] = 1:4-2:18 + >---- +1| @baz +2| bar = () => {} + ------------------< + +[Removal] = 1:0-3:0 + >-------- +1| @baz +2| bar = () => {} +3| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| @baz + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method5.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method5.scope new file mode 100644 index 0000000000..d724842cb2 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method5.scope @@ -0,0 +1,21 @@ +const foo = { + bar() {} +} +--- + +[Content] = +[Domain] = 1:4-1:12 + >--------< +1| bar() {} + +[Removal] = 1:0-2:0 + >------------ +1| bar() {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| bar() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method6.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method6.scope new file mode 100644 index 0000000000..c4be8f9a94 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method6.scope @@ -0,0 +1,21 @@ +const foo = { + bar: function() {} +} +--- + +[Content] = +[Domain] = 1:4-1:22 + >------------------< +1| bar: function() {} + +[Removal] = 1:0-2:0 + >---------------------- +1| bar: function() {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| bar: function() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method7.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method7.scope new file mode 100644 index 0000000000..fe281016ce --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method7.scope @@ -0,0 +1,21 @@ +const foo = { + bar: function *() {} +} +--- + +[Content] = +[Domain] = 1:4-1:24 + >--------------------< +1| bar: function *() {} + +[Removal] = 1:0-2:0 + >------------------------ +1| bar: function *() {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| bar: function *() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method8.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method8.scope new file mode 100644 index 0000000000..3eea40e93d --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method8.scope @@ -0,0 +1,21 @@ +const foo = { + bar: () => {} +} +--- + +[Content] = +[Domain] = 1:4-1:17 + >-------------< +1| bar: () => {} + +[Removal] = 1:0-2:0 + >----------------- +1| bar: () => {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| bar: () => {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction10.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction10.scope new file mode 100644 index 0000000000..8d5b6758af --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction10.scope @@ -0,0 +1,10 @@ +export const foo = () => {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| export const foo = () => {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction11.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction11.scope new file mode 100644 index 0000000000..3016a127c3 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction11.scope @@ -0,0 +1,10 @@ +export default function() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| export default function() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction12.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction12.scope new file mode 100644 index 0000000000..74cd790c3c --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction12.scope @@ -0,0 +1,10 @@ +export default function *() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:30 + >------------------------------< +0| export default function *() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction13.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction13.scope new file mode 100644 index 0000000000..91c8fcd285 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction13.scope @@ -0,0 +1,10 @@ +export default () => {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:24 + >------------------------< +0| export default () => {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction14.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction14.scope new file mode 100644 index 0000000000..b9c0bfec80 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction14.scope @@ -0,0 +1,17 @@ +const foo = function bar() {}; +--- + +[Content] = +[Domain] = 0:12-0:29 + >-----------------< +0| const foo = function bar() {}; + +[Removal] = 0:11-0:29 + >------------------< +0| const foo = function bar() {}; + +[Leading delimiter] = 0:11-0:12 + >-< +0| const foo = function bar() {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction15.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction15.scope new file mode 100644 index 0000000000..2e1d3433c9 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction15.scope @@ -0,0 +1,17 @@ +const foo = function *bar() {}; +--- + +[Content] = +[Domain] = 0:12-0:30 + >------------------< +0| const foo = function *bar() {}; + +[Removal] = 0:11-0:30 + >-------------------< +0| const foo = function *bar() {}; + +[Leading delimiter] = 0:11-0:12 + >-< +0| const foo = function *bar() {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction2.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction2.scope index dd8614aeee..ebe4808acd 100644 --- a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction2.scope +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction2.scope @@ -1,10 +1,10 @@ -const foo = function() {} +function *foo() {} --- [Content] = [Removal] = -[Domain] = 0:0-0:25 - >-------------------------< -0| const foo = function() {} +[Domain] = 0:0-0:18 + >------------------< +0| function *foo() {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction3.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction3.scope new file mode 100644 index 0000000000..c6d6b1aa1a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction3.scope @@ -0,0 +1,10 @@ +const foo = function() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:26 + >--------------------------< +0| const foo = function() {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction4.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction4.scope new file mode 100644 index 0000000000..6a175c3a51 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction4.scope @@ -0,0 +1,10 @@ +const foo = function *() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| const foo = function *() {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction5.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction5.scope new file mode 100644 index 0000000000..3afd5be96a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction5.scope @@ -0,0 +1,10 @@ +const foo = () => {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| const foo = () => {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction6.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction6.scope new file mode 100644 index 0000000000..aacfb78ce8 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction6.scope @@ -0,0 +1,10 @@ +export function foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:24 + >------------------------< +0| export function foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction7.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction7.scope new file mode 100644 index 0000000000..8d60af49ec --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction7.scope @@ -0,0 +1,10 @@ +export function *foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:25 + >-------------------------< +0| export function *foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction8.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction8.scope new file mode 100644 index 0000000000..4c9f2bc0d2 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction8.scope @@ -0,0 +1,10 @@ +export const foo = function() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:33 + >---------------------------------< +0| export const foo = function() {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction9.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction9.scope new file mode 100644 index 0000000000..e99d638d90 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction9.scope @@ -0,0 +1,10 @@ +export const foo = function *() {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:35 + >-----------------------------------< +0| export const foo = function *() {}; + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.class.scope b/data/fixtures/scopes/javascript.core/statement/statement.class.scope index 8449ae4834..a6008d311f 100644 --- a/data/fixtures/scopes/javascript.core/statement/statement.class.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.class.scope @@ -1,10 +1,10 @@ -class Foo { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:13 - >-------------< -0| class Foo { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.class2.scope b/data/fixtures/scopes/javascript.core/statement/statement.class2.scope new file mode 100644 index 0000000000..60bfb2c8c9 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.class2.scope @@ -0,0 +1,10 @@ +export class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| export class Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.class3.scope b/data/fixtures/scopes/javascript.core/statement/statement.class3.scope new file mode 100644 index 0000000000..2676bb1634 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.class3.scope @@ -0,0 +1,13 @@ +@bar +class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:12 + >---- +0| @bar +1| class Foo {} + ------------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/className.iteration.document.scope b/data/fixtures/scopes/python/className.iteration.document.scope deleted file mode 100644 index 23774e47c6..0000000000 --- a/data/fixtures/scopes/python/className.iteration.document.scope +++ /dev/null @@ -1,14 +0,0 @@ - -class Foo: - pass - ---- - -[Content] = -[Domain] = 0:0-3:0 - > -0| -1| class Foo: -2| pass -3| - < diff --git a/data/fixtures/scopes/python/className.scope b/data/fixtures/scopes/python/className.scope deleted file mode 100644 index 0e1664a7c2..0000000000 --- a/data/fixtures/scopes/python/className.scope +++ /dev/null @@ -1,23 +0,0 @@ -class Foo: - pass ---- - -[Content] = 0:6-0:9 - >---< -0| class Foo: - -[Removal] = 0:5-0:9 - >----< -0| class Foo: - -[Leading delimiter] = 0:5-0:6 - >-< -0| class Foo: - -[Domain] = 0:0-1:8 - >---------- -0| class Foo: -1| pass - --------< - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/functionName/functionName.constructor.scope b/data/fixtures/scopes/python/functionName/functionName.constructor.scope deleted file mode 100644 index fe1040388b..0000000000 --- a/data/fixtures/scopes/python/functionName/functionName.constructor.scope +++ /dev/null @@ -1,21 +0,0 @@ -class Foo: - def __init__(self): - pass ---- - -[Content] = -[Removal] = 1:8-1:16 - >--------< -1| def __init__(self): - -[Leading delimiter] = 1:7-1:8 - >-< -1| def __init__(self): - -[Domain] = 1:4-2:12 - >------------------- -1| def __init__(self): -2| pass - ------------< - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/functionName/functionName.iteration.document.scope b/data/fixtures/scopes/python/functionName/functionName.iteration.document.scope deleted file mode 100644 index df491f5017..0000000000 --- a/data/fixtures/scopes/python/functionName/functionName.iteration.document.scope +++ /dev/null @@ -1,14 +0,0 @@ - -def bar(): - pass - ---- - -[Content] = -[Domain] = 0:0-3:0 - > -0| -1| def bar(): -2| pass -3| - < diff --git a/data/fixtures/scopes/python/functionName/functionName.method.iteration.class.scope b/data/fixtures/scopes/python/functionName/functionName.method.iteration.class.scope deleted file mode 100644 index 87bb3e4216..0000000000 --- a/data/fixtures/scopes/python/functionName/functionName.method.iteration.class.scope +++ /dev/null @@ -1,20 +0,0 @@ -class Foo: - def bar(): - pass ---- - -[#1 Content] = -[#1 Domain] = 0:0-2:12 - >---------- -0| class Foo: -1| def bar(): -2| pass - ------------< - - -[#2 Content] = -[#2 Domain] = 1:4-2:12 - >---------- -1| def bar(): -2| pass - ------------< diff --git a/data/fixtures/scopes/python/functionName/functionName.method.scope b/data/fixtures/scopes/python/functionName/functionName.method.scope deleted file mode 100644 index fc1a1d61c8..0000000000 --- a/data/fixtures/scopes/python/functionName/functionName.method.scope +++ /dev/null @@ -1,21 +0,0 @@ -class Foo: - def bar(): - pass ---- - -[Content] = -[Removal] = 1:8-1:11 - >---< -1| def bar(): - -[Leading delimiter] = 1:7-1:8 - >-< -1| def bar(): - -[Domain] = 1:4-2:12 - >---------- -1| def bar(): -2| pass - ------------< - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/functionName/functionName.scope b/data/fixtures/scopes/python/functionName/functionName.scope deleted file mode 100644 index 608fc065d3..0000000000 --- a/data/fixtures/scopes/python/functionName/functionName.scope +++ /dev/null @@ -1,20 +0,0 @@ -def bar(): - pass ---- - -[Content] = -[Removal] = 0:4-0:7 - >---< -0| def bar(): - -[Leading delimiter] = 0:3-0:4 - >-< -0| def bar(): - -[Domain] = 0:0-1:8 - >---------- -0| def bar(): -1| pass - --------< - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.class2.scope b/data/fixtures/scopes/python/name/name.class2.scope new file mode 100644 index 0000000000..aeac1f9449 --- /dev/null +++ b/data/fixtures/scopes/python/name/name.class2.scope @@ -0,0 +1,23 @@ +@bar +class Foo: pass +--- + +[Content] = 1:6-1:9 + >---< +1| class Foo: pass + +[Removal] = 1:5-1:9 + >----< +1| class Foo: pass + +[Leading delimiter] = 1:5-1:6 + >-< +1| class Foo: pass + +[Domain] = 0:0-1:15 + >---- +0| @bar +1| class Foo: pass + ---------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.function2.scope b/data/fixtures/scopes/python/name/name.function2.scope new file mode 100644 index 0000000000..3723a8c176 --- /dev/null +++ b/data/fixtures/scopes/python/name/name.function2.scope @@ -0,0 +1,20 @@ +@bar +def foo(): pass +--- + +[Content] = +[Removal] = 1:4-1:7 + >---< +1| def foo(): pass + +[Leading delimiter] = 1:3-1:4 + >-< +1| def foo(): pass + +[Domain] = 0:0-1:15 + >---- +0| @bar +1| def foo(): pass + ---------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/r/functionName.scope b/data/fixtures/scopes/r/name.function.scope similarity index 100% rename from data/fixtures/scopes/r/functionName.scope rename to data/fixtures/scopes/r/name.function.scope diff --git a/data/fixtures/scopes/scss/functionName.scope b/data/fixtures/scopes/scss/functionName.scope deleted file mode 100644 index 4654c1769b..0000000000 --- a/data/fixtures/scopes/scss/functionName.scope +++ /dev/null @@ -1,17 +0,0 @@ -@function foo() {} ---- - -[Content] = -[Removal] = 0:10-0:13 - >---< -0| @function foo() {} - -[Leading delimiter] = 0:9-0:10 - >-< -0| @function foo() {} - -[Domain] = 0:0-0:18 - >------------------< -0| @function foo() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scss/functionName2.scope b/data/fixtures/scopes/scss/functionName2.scope deleted file mode 100644 index c1ab2ffbe9..0000000000 --- a/data/fixtures/scopes/scss/functionName2.scope +++ /dev/null @@ -1,17 +0,0 @@ -@mixin foo() {} ---- - -[Content] = -[Removal] = 0:7-0:10 - >---< -0| @mixin foo() {} - -[Leading delimiter] = 0:6-0:7 - >-< -0| @mixin foo() {} - -[Domain] = 0:0-0:15 - >---------------< -0| @mixin foo() {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scss/functionName.iteration.block.scope b/data/fixtures/scopes/scss/name.iteration.block.scope similarity index 100% rename from data/fixtures/scopes/scss/functionName.iteration.block.scope rename to data/fixtures/scopes/scss/name.iteration.block.scope diff --git a/data/fixtures/scopes/scss/functionName.iteration.document.scope b/data/fixtures/scopes/scss/name.iteration.document.scope similarity index 100% rename from data/fixtures/scopes/scss/functionName.iteration.document.scope rename to data/fixtures/scopes/scss/name.iteration.document.scope diff --git a/data/fixtures/scopes/typescript.core/class2.scope b/data/fixtures/scopes/typescript.core/class2.scope index 6dc3c2625d..4c476790db 100644 --- a/data/fixtures/scopes/typescript.core/class2.scope +++ b/data/fixtures/scopes/typescript.core/class2.scope @@ -1,10 +1,10 @@ -export default abstract class Foo {} +export abstract class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:36 - >------------------------------------< -0| export default abstract class Foo {} +[Domain] = 0:0-0:28 + >----------------------------< +0| export abstract class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/class3.scope b/data/fixtures/scopes/typescript.core/class3.scope index 4c476790db..f47b88a3eb 100644 --- a/data/fixtures/scopes/typescript.core/class3.scope +++ b/data/fixtures/scopes/typescript.core/class3.scope @@ -1,10 +1,13 @@ -export abstract class Foo {} +@bar +abstract class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:28 - >----------------------------< -0| export abstract class Foo {} +[Domain] = 0:0-1:21 + >---- +0| @bar +1| abstract class Foo {} + ---------------------< [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/name/name.class.scope b/data/fixtures/scopes/typescript.core/name/name.class.scope new file mode 100644 index 0000000000..927421bfef --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.class.scope @@ -0,0 +1,24 @@ +abstract class Foo {} +--- + +[Content] = 0:15-0:18 + >---< +0| abstract class Foo {} + +[Removal] = 0:15-0:19 + >----< +0| abstract class Foo {} + +[Leading delimiter] = 0:14-0:15 + >-< +0| abstract class Foo {} + +[Trailing delimiter] = 0:18-0:19 + >-< +0| abstract class Foo {} + +[Domain] = 0:0-0:21 + >---------------------< +0| abstract class Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.class2.scope b/data/fixtures/scopes/typescript.core/name/name.class2.scope new file mode 100644 index 0000000000..615055687a --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.class2.scope @@ -0,0 +1,24 @@ +export abstract class Foo {} +--- + +[Content] = 0:22-0:25 + >---< +0| export abstract class Foo {} + +[Removal] = 0:22-0:26 + >----< +0| export abstract class Foo {} + +[Leading delimiter] = 0:21-0:22 + >-< +0| export abstract class Foo {} + +[Trailing delimiter] = 0:25-0:26 + >-< +0| export abstract class Foo {} + +[Domain] = 0:0-0:28 + >----------------------------< +0| export abstract class Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.class3.scope b/data/fixtures/scopes/typescript.core/name/name.class3.scope new file mode 100644 index 0000000000..8024ee12e1 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.class3.scope @@ -0,0 +1,27 @@ +@bar +abstract class Foo {} +--- + +[Content] = 1:15-1:18 + >---< +1| abstract class Foo {} + +[Removal] = 1:15-1:19 + >----< +1| abstract class Foo {} + +[Leading delimiter] = 1:14-1:15 + >-< +1| abstract class Foo {} + +[Trailing delimiter] = 1:18-1:19 + >-< +1| abstract class Foo {} + +[Domain] = 0:0-1:21 + >---- +0| @bar +1| abstract class Foo {} + ---------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.constructor.scope b/data/fixtures/scopes/typescript.core/name/name.constructor.scope new file mode 100644 index 0000000000..355ee33f0a --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.constructor.scope @@ -0,0 +1,45 @@ +class Foo { + constructor(); +} +--- + +[#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| constructor(); +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:15 + >-----------< +1| constructor(); + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| constructor(); + +[#2 Domain] = 1:4-1:18 + >--------------< +1| constructor(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/functionName/functionName.scope b/data/fixtures/scopes/typescript.core/name/name.function.scope similarity index 51% rename from data/fixtures/scopes/javascript.core/functionName/functionName.scope rename to data/fixtures/scopes/typescript.core/name/name.function.scope index e5a3e93244..55d6352688 100644 --- a/data/fixtures/scopes/javascript.core/functionName/functionName.scope +++ b/data/fixtures/scopes/typescript.core/name/name.function.scope @@ -1,17 +1,17 @@ -function foo() {} +function foo(); --- [Content] = [Removal] = 0:9-0:12 >---< -0| function foo() {} +0| function foo(); [Leading delimiter] = 0:8-0:9 >-< -0| function foo() {} +0| function foo(); -[Domain] = 0:0-0:17 - >-----------------< -0| function foo() {} +[Domain] = 0:0-0:15 + >---------------< +0| function foo(); [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.method.scope b/data/fixtures/scopes/typescript.core/name/name.method.scope new file mode 100644 index 0000000000..65ac2a1850 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.method.scope @@ -0,0 +1,45 @@ +class Foo { + bar(); +} +--- + +[#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| bar(); +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:7 + >---< +1| bar(); + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar(); + +[#2 Domain] = 1:4-1:10 + >------< +1| bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.method2.scope b/data/fixtures/scopes/typescript.core/name/name.method2.scope new file mode 100644 index 0000000000..74a238d017 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.method2.scope @@ -0,0 +1,45 @@ +class Foo { + abstract bar(); +} +--- + +[#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| abstract bar(); +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:13-1:16 + >---< +1| abstract bar(); + +[#2 Leading delimiter] = 1:12-1:13 + >-< +1| abstract bar(); + +[#2 Domain] = 1:4-1:19 + >---------------< +1| abstract bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/namedFunction.constructor.scope b/data/fixtures/scopes/typescript.core/namedFunction.constructor.scope deleted file mode 100644 index 09948088df..0000000000 --- a/data/fixtures/scopes/typescript.core/namedFunction.constructor.scope +++ /dev/null @@ -1,40 +0,0 @@ -class Foo { - constructor(); - constructor(value: number) {} -} ---- - -[#1 Content] = -[#1 Domain] = 1:2-1:16 - >--------------< -1| constructor(); - -[#1 Removal] = 1:0-2:0 - >---------------- -1| constructor(); -2| constructor(value: number) {} - < - -[#1 Leading delimiter] = 1:0-1:2 - >--< -1| constructor(); - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 2:2-2:31 - >-----------------------------< -2| constructor(value: number) {} - -[#2 Removal] = 2:0-3:0 - >------------------------------- -2| constructor(value: number) {} -3| } - < - -[#2 Leading delimiter] = 2:0-2:2 - >--< -2| constructor(value: number) {} - -[#2 Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction.method.scope b/data/fixtures/scopes/typescript.core/namedFunction.method.scope deleted file mode 100644 index 3f958c076d..0000000000 --- a/data/fixtures/scopes/typescript.core/namedFunction.method.scope +++ /dev/null @@ -1,40 +0,0 @@ -class Foo { - bar(); - bar(value: number) {} -} ---- - -[#1 Content] = -[#1 Domain] = 1:2-1:8 - >------< -1| bar(); - -[#1 Removal] = 1:0-2:0 - >-------- -1| bar(); -2| bar(value: number) {} - < - -[#1 Leading delimiter] = 1:0-1:2 - >--< -1| bar(); - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 2:2-2:23 - >---------------------< -2| bar(value: number) {} - -[#2 Removal] = 2:0-3:0 - >----------------------- -2| bar(value: number) {} -3| } - < - -[#2 Leading delimiter] = 2:0-2:2 - >--< -2| bar(value: number) {} - -[#2 Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction.scope b/data/fixtures/scopes/typescript.core/namedFunction.scope deleted file mode 100644 index 70e41d982a..0000000000 --- a/data/fixtures/scopes/typescript.core/namedFunction.scope +++ /dev/null @@ -1,45 +0,0 @@ -function foo(value: string) -function foo(value: number); -function foo(value: string | number) {} ---- - -[#1 Content] = -[#1 Domain] = 0:0-0:27 - >---------------------------< -0| function foo(value: string) - -[#1 Removal] = 0:0-1:0 - >--------------------------- -0| function foo(value: string) -1| function foo(value: number); - < - -[#1 Insertion delimiter] = "\n\n" - - -[#2 Content] = -[#2 Domain] = 1:0-1:28 - >----------------------------< -1| function foo(value: number); - -[#2 Removal] = 1:0-2:0 - >---------------------------- -1| function foo(value: number); -2| function foo(value: string | number) {} - < - -[#2 Insertion delimiter] = "\n\n" - - -[#3 Content] = -[#3 Domain] = 2:0-2:39 - >---------------------------------------< -2| function foo(value: string | number) {} - -[#3 Removal] = 1:28-2:39 - > -1| function foo(value: number); -2| function foo(value: string | number) {} - ---------------------------------------< - -[#3 Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.constructor.scope b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.constructor.scope new file mode 100644 index 0000000000..22e8c6d5d1 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.constructor.scope @@ -0,0 +1,21 @@ +class Foo { + constructor(); +} +--- + +[Content] = +[Domain] = 1:2-1:16 + >--------------< +1| constructor(); + +[Removal] = 1:0-2:0 + >---------------- +1| constructor(); +2| } + < + +[Leading delimiter] = 1:0-1:2 + >--< +1| constructor(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.method.scope b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.method.scope new file mode 100644 index 0000000000..bc0d80a165 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.method.scope @@ -0,0 +1,21 @@ +class Foo { + bar(); +} +--- + +[Content] = +[Domain] = 1:2-1:8 + >------< +1| bar(); + +[Removal] = 1:0-2:0 + >-------- +1| bar(); +2| } + < + +[Leading delimiter] = 1:0-1:2 + >--< +1| bar(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.method2.scope b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.method2.scope new file mode 100644 index 0000000000..61e32e7aad --- /dev/null +++ b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.method2.scope @@ -0,0 +1,21 @@ +class Foo { + abstract bar(); +} +--- + +[Content] = +[Domain] = 1:4-1:19 + >---------------< +1| abstract bar(); + +[Removal] = 1:0-2:0 + >------------------- +1| abstract bar(); +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| abstract bar(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.scope b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.scope new file mode 100644 index 0000000000..c7bde4e888 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction.scope @@ -0,0 +1,10 @@ +function foo(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| function foo(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/namedFunction/namedFunction2.scope b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction2.scope new file mode 100644 index 0000000000..c0a8857f56 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/namedFunction/namedFunction2.scope @@ -0,0 +1,10 @@ +export function foo(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:22 + >----------------------< +0| export function foo(); + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/typescript.core/type/type.class2.scope b/data/fixtures/scopes/typescript.core/type/type.class2.scope index c917ac4ee4..a8abf5726b 100644 --- a/data/fixtures/scopes/typescript.core/type/type.class2.scope +++ b/data/fixtures/scopes/typescript.core/type/type.class2.scope @@ -1,10 +1,10 @@ -abstract class Foo {} +export class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:21 - >---------------------< -0| abstract class Foo {} +[Domain] = 0:0-0:19 + >-------------------< +0| export class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.class3.scope b/data/fixtures/scopes/typescript.core/type/type.class3.scope new file mode 100644 index 0000000000..af283fb3d9 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type/type.class3.scope @@ -0,0 +1,13 @@ +@bar +class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:12 + >---- +0| @bar +1| class Foo {} + ------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.class4.scope b/data/fixtures/scopes/typescript.core/type/type.class4.scope new file mode 100644 index 0000000000..c917ac4ee4 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type/type.class4.scope @@ -0,0 +1,10 @@ +abstract class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| abstract class Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.class5.scope b/data/fixtures/scopes/typescript.core/type/type.class5.scope new file mode 100644 index 0000000000..d570352c01 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type/type.class5.scope @@ -0,0 +1,10 @@ +export abstract class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| export abstract class Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.class6.scope b/data/fixtures/scopes/typescript.core/type/type.class6.scope new file mode 100644 index 0000000000..02a9f6ac23 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type/type.class6.scope @@ -0,0 +1,13 @@ +@bar +abstract class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:21 + >---- +0| @bar +1| abstract class Foo {} + ---------------------< + +[Insertion delimiter] = " " diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 409194f04e..723b58d72f 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -90,12 +90,6 @@ - `class.iteration.block` Iteration scope for classes: statement blocks (body of functions/if-statements/for-loops/etc). - `class.iteration.document` Iteration scope for classes: the entire document including leading and trailing empty lines. -### className - -- `className` The name of a class -- `className.iteration.block` Iteration scope for class names: statement blocks (body of functions/if-statements/for-loops/etc). -- `className.iteration.document` Iteration scope for class names: the entire document including leading and trailing empty lines. - ### collectionItem - `collectionItem.textual` A text based collection item @@ -156,15 +150,6 @@ - `functionCallee` The function being called in a function call - `functionCallee.constructor` The class being constructed in a class instantiation, including the `new` keyword -### functionName - -- `functionName` The name of a function -- `functionName.constructor` The name of a constructor in a class -- `functionName.iteration.block` Iteration scope for function names: statement blocks (body of functions/if-statements/for-loops/etc). -- `functionName.iteration.document` Iteration scope for function names: the entire document including leading and trailing empty lines. -- `functionName.method` The name of a method in a class -- `functionName.method.iteration.class` Iteration scope for method names: class bodies. - ### identifier - `identifier` A single alphanumeric identifier in the document diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 9936a4aad5..6202600682 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -18,15 +18,11 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { class: supported, "class.iteration.document": supported, - className: supported, - "className.iteration.document": supported, "collectionItem.unenclosed": supported, "collectionItem.unenclosed.iteration": supported, namedFunction: supported, - functionName: supported, - "functionName.iteration.document": supported, "namedFunction.iteration.document": supported, functionCall: supported, @@ -86,9 +82,9 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": supported, "name.argument.formal.iteration": supported, "name.iteration.block": supported, + "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.enum": supported, - "name.iteration.document": supported, "value.assignment": supported, "value.variable": supported, @@ -189,10 +185,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Nested class "class.iteration.block": notApplicable, - "className.iteration.block": notApplicable, // Nested function - "functionName.iteration.block": notApplicable, "namedFunction.iteration.block": notApplicable, // Try catch @@ -265,7 +259,6 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.constructor.singleLine": notApplicable, "functionCall.constructor": notApplicable, "functionCallee.constructor": notApplicable, - "functionName.constructor": notApplicable, "name.argument.formal.constructor.iteration": notApplicable, "name.argument.formal.constructor": notApplicable, "name.constructor": notApplicable, @@ -283,8 +276,6 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.method.empty": notApplicable, "argumentList.formal.method.multiLine": notApplicable, "argumentList.formal.method.singleLine": notApplicable, - "functionName.method.iteration.class": notApplicable, - "functionName.method": notApplicable, "name.argument.formal.method.iteration": notApplicable, "name.argument.formal.method": notApplicable, "name.method": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 6c9a8a2ef8..7dfb88c4fa 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -42,10 +42,6 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.constructor": supported, "functionCallee.constructor": supported, - "functionName.constructor": supported, - "functionName.method": supported, - "functionName.method.iteration.class": supported, - "namedFunction.method": supported, "namedFunction.method.iteration.class": supported, "namedFunction.constructor": supported, @@ -58,6 +54,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.method": supported, "name.namespace": supported, + "name.iteration.class": supported, "value.argument.formal": supported, "value.argument.formal.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 6ea61a585b..1688599a98 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -14,10 +14,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "class.iteration.document": supported, "class.iteration.block": supported, - className: supported, - "className.iteration.document": supported, - "className.iteration.block": supported, - "comment.line": supported, "comment.block": supported, @@ -32,12 +28,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.method": supported, "namedFunction.method.iteration.class": supported, - functionName: supported, - "functionName.iteration.document": supported, - "functionName.constructor": supported, - "functionName.method": supported, - "functionName.method.iteration.class": supported, - "branch.if": supported, "branch.if.elif.else": supported, "branch.if.else": supported, @@ -236,7 +226,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual.iteration": notApplicable, // Functions in blocks - "functionName.iteration.block": notApplicable, "namedFunction.iteration.block": notApplicable, // Resource syntax diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index b5e0ccbff3..6f13b75d19 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -46,9 +46,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -62,7 +59,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -163,11 +159,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { fieldAccess: notApplicable, "functionCall.constructor": notApplicable, "functionCallee.constructor": notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, - functionName: notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, "interior.element": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/dart.ts b/packages/common/src/scopeSupportFacets/dart.ts index aeb0a213af..9a6d3b1760 100644 --- a/packages/common/src/scopeSupportFacets/dart.ts +++ b/packages/common/src/scopeSupportFacets/dart.ts @@ -9,5 +9,5 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = { list: supported, map: supported, class: supported, - className: supported, + "name.class": supported, }; diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 5c686029a4..dd53a33879 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -24,9 +24,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -40,7 +37,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -142,10 +138,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "condition.while": notApplicable, "functionCall.constructor": notApplicable, "functionCallee.constructor": notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, "interior.cell": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -242,7 +234,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { fieldAccess: notApplicable, functionCall: notApplicable, functionCallee: notApplicable, - functionName: notApplicable, ifStatement: notApplicable, list: notApplicable, map: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 67e4c82d21..c9cb5bb22e 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -65,10 +65,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "class.iteration.block": supported, "class.iteration.document": supported, - className: supported, - "className.iteration.block": supported, - "className.iteration.document": supported, - "comment.block": supported, "comment.line": supported, @@ -89,10 +85,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.method": supported, "namedFunction.method.iteration.class": supported, - "functionName.constructor": supported, - "functionName.method": supported, - "functionName.method.iteration.class": supported, - ifStatement: supported, statement: supported, "statement.class": supported, @@ -199,9 +191,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { namedFunction: notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.iteration.block": notApplicable, - functionName: notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.iteration.block": notApplicable, "argument.formal.singleLine": notApplicable, "argument.formal.multiLine": notApplicable, "argument.formal.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 6e2c3713eb..ac75aca1aa 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -31,9 +31,6 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { class: supported, "class.iteration.document": supported, - className: supported, - "className.iteration.document": supported, - anonymousFunction: supported, namedFunction: supported, @@ -42,12 +39,6 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.method.iteration.class": supported, "namedFunction.constructor": supported, - functionName: supported, - "functionName.iteration.document": supported, - "functionName.method": supported, - "functionName.method.iteration.class": supported, - "functionName.constructor": supported, - functionCall: supported, "functionCall.constructor": supported, functionCallee: supported, @@ -186,9 +177,11 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE (JS & TS) */ - // Nested the classes + // Nested classes "class.iteration.block": notApplicable, - "className.iteration.block": notApplicable, + + // Nested functions. Technically supported, but creates problem with `every funk` in a method. + "namedFunction.iteration.block": notApplicable, // Section section: notApplicable, @@ -220,10 +213,6 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual.iteration": notApplicable, "value.argument.actual": notApplicable, - // Nested functions. Technically supported, but great problem with `every funk` in a method. - "functionName.iteration.block": notApplicable, - "namedFunction.iteration.block": notApplicable, - // Namespace "name.namespace": notApplicable, "interior.namespace": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 4083001724..87b3da8d03 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -27,9 +27,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -43,7 +40,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -153,11 +149,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.constructor": notApplicable, functionCallee: notApplicable, "functionCallee.constructor": notApplicable, - functionName: notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, "interior.element": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index bba3d6570b..55519b0950 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -23,9 +23,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -39,7 +36,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -149,11 +145,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.constructor": notApplicable, functionCallee: notApplicable, "functionCallee.constructor": notApplicable, - functionName: notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, ifStatement: notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 852f81dd59..67463d6e23 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -78,12 +78,6 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.method": supported, "namedFunction.method.iteration.class": supported, - functionName: supported, - "functionName.constructor": supported, - "functionName.iteration.document": supported, - "functionName.method": supported, - "functionName.method.iteration.class": supported, - "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, "argument.actual.iteration": supported, @@ -146,9 +140,6 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { class: supported, "class.iteration.document": supported, - className: supported, - "className.iteration.document": supported, - "interior.class": supported, "interior.function": supported, "interior.constructor": supported, @@ -228,18 +219,16 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.namespace": notApplicable, "interior.namespace": notApplicable, - // Nested classes - "class.iteration.block": notApplicable, - "className.iteration.block": notApplicable, - // for and do-while loops "condition.doWhile": notApplicable, "condition.for": notApplicable, "interior.for": notApplicable, "interior.doWhile": notApplicable, - // Nested functions. Technically supported, but great problem with `every funk` in a method. - "functionName.iteration.block": notApplicable, + // Nested classes + "class.iteration.block": notApplicable, + + // Nested functions. Technically supported, but creates problem with `every funk` in a method. "namedFunction.iteration.block": notApplicable, // Type. Python have some types, but not these. diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index a2f724d61b..a810b6c9d7 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -28,9 +28,9 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "comment.line": supported, functionCall: supported, functionCallee: supported, - functionName: supported, ifStatement: supported, "name.assignment": supported, + "name.function": supported, "name.variable": supported, namedFunction: supported, "value.assignment": supported, @@ -59,7 +59,6 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "name.class": unsupported, "name.field.class": unsupported, "name.foreach": unsupported, - "name.function": unsupported, "name.method": unsupported, "statement.class": unsupported, "string.multiLine": unsupported, @@ -70,7 +69,6 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "value.switch": unsupported, attribute: unsupported, class: unsupported, - className: unsupported, environment: unsupported, fieldAccess: unsupported, map: unsupported, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 3183c84c07..3c44f539c2 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -29,9 +29,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -45,7 +42,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -148,11 +144,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { fieldAccess: notApplicable, "functionCall.constructor": notApplicable, "functionCallee.constructor": notApplicable, - functionName: notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, "interior.element": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 8ffbd58dab..b732cec19a 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -105,12 +105,6 @@ export const scopeSupportFacetInfos: Record< }, "class.iteration.document": documentIter("class", "classes"), "class.iteration.block": blockIter("class", "classes"), - className: { - description: "The name of a class", - scopeType: "className", - }, - "className.iteration.document": documentIter("className", "class names"), - "className.iteration.block": blockIter("className", "class names"), namedFunction: { description: "A named function declaration", @@ -141,27 +135,6 @@ export const scopeSupportFacetInfos: Record< "An anonymous function, eg a lambda function, an arrow function, etc", scopeType: "anonymousFunction", }, - functionName: { - description: "The name of a function", - scopeType: "functionName", - }, - "functionName.method": { - description: "The name of a method in a class", - scopeType: "functionName", - }, - "functionName.method.iteration.class": classIter( - "functionName", - "method names", - ), - "functionName.constructor": { - description: "The name of a constructor in a class", - scopeType: "functionName", - }, - "functionName.iteration.block": blockIter("functionName", "function names"), - "functionName.iteration.document": documentIter( - "functionName", - "function names", - ), functionCall: { description: "A function call", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index f460fb9655..b32070d15c 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -41,10 +41,6 @@ export const scopeSupportFacets = [ "class.iteration.document", "class.iteration.block", - "className", - "className.iteration.document", - "className.iteration.block", - "anonymousFunction", "namedFunction", @@ -54,13 +50,6 @@ export const scopeSupportFacets = [ "namedFunction.method.iteration.class", "namedFunction.constructor", - "functionName", - "functionName.iteration.block", - "functionName.iteration.document", - "functionName.method", - "functionName.method.iteration.class", - "functionName.constructor", - "functionCall", "functionCall.constructor", "functionCallee", @@ -179,11 +168,11 @@ export const scopeSupportFacets = [ "name.argument.formal.constructor", "name.argument.formal.constructor.iteration", "name.argument.catch", - "name.iteration.block", + "name.iteration.document", "name.iteration.class", + "name.iteration.block", "name.iteration.interface", "name.iteration.enum", - "name.iteration.document", "key.attribute", "key.mapPair", diff --git a/packages/common/src/scopeSupportFacets/scss.ts b/packages/common/src/scopeSupportFacets/scss.ts index b99f262ee6..faa28f5e15 100644 --- a/packages/common/src/scopeSupportFacets/scss.ts +++ b/packages/common/src/scopeSupportFacets/scss.ts @@ -13,13 +13,11 @@ export const scssScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": supported, "namedFunction.iteration.document": supported, - functionName: supported, - "functionName.iteration.block": supported, - "functionName.iteration.document": supported, - "name.argument.formal": supported, "name.argument.formal.iteration": supported, "name.function": supported, + "name.iteration.document": supported, + "name.iteration.block": supported, "value.argument.formal": supported, "value.argument.formal.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 3c7237e4d7..18ccd765f7 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -54,9 +54,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -70,7 +67,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -168,11 +164,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.constructor": notApplicable, functionCallee: notApplicable, "functionCallee.constructor": notApplicable, - functionName: notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, "interior.element": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index f032efa44f..b4ba7bf93e 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -24,9 +24,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -40,7 +37,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -148,11 +144,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.constructor": notApplicable, functionCallee: notApplicable, "functionCallee.constructor": notApplicable, - functionName: notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, "interior.function": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 482c0e7cd1..9be1ff4f9c 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -33,9 +33,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { 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, @@ -49,7 +46,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": notApplicable, "interior.class": notApplicable, "namedFunction.method.iteration.class": notApplicable, - "functionName.method.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -157,11 +153,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.constructor": notApplicable, functionCallee: notApplicable, "functionCallee.constructor": notApplicable, - functionName: notApplicable, - "functionName.constructor": notApplicable, - "functionName.iteration.block": notApplicable, - "functionName.iteration.document": notApplicable, - "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, "interior.element": notApplicable, diff --git a/packages/common/src/types/command/PartialTargetDescriptor.types.ts b/packages/common/src/types/command/PartialTargetDescriptor.types.ts index 0506cd563d..b64d3f8425 100644 --- a/packages/common/src/types/command/PartialTargetDescriptor.types.ts +++ b/packages/common/src/types/command/PartialTargetDescriptor.types.ts @@ -217,6 +217,12 @@ export function isSimpleScopeType( export type SimpleScopeTypeType = (typeof simpleScopeTypeTypes)[number]; +export const pseudoScopes = new Set([ + "instance", + "className", + "functionName", +]); + export interface SimpleScopeType { type: SimpleScopeTypeType; } diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/validateQueryCaptures.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/validateQueryCaptures.ts index 594b755129..9ff3f94f19 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/validateQueryCaptures.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/validateQueryCaptures.ts @@ -1,8 +1,16 @@ -import { showError, simpleScopeTypeTypes } from "@cursorless/common"; +import { + pseudoScopes, + showError, + simpleScopeTypeTypes, +} from "@cursorless/common"; import { ide } from "../../singletons/ide.singleton"; const wildcard = "_"; -const captureNames = [wildcard, "interior", ...simpleScopeTypeTypes]; +const captureNames = [ + ...simpleScopeTypeTypes.filter((s) => !pseudoScopes.has(s)), + wildcard, + "interior", +]; const positionRelationships = ["prefix", "leading", "trailing"]; const positionSuffixes = [ diff --git a/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts b/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts index 1bfc0cb3fa..34ae25fe18 100644 --- a/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts +++ b/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts @@ -4,6 +4,7 @@ import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; import type { ModifierStageFactory } from "./ModifierStageFactory"; import type { ModifierStage } from "./PipelineStages.types"; import { CascadingStage } from "./modifiers/CascadingStage"; +import { ClassFunctionNameStage } from "./modifiers/ClassFunctionNameStage"; import { ModifyIfUntypedStage } from "./modifiers/ConditionalModifierStages"; import { ContainingScopeStage } from "./modifiers/ContainingScopeStage"; import { EveryScopeStage } from "./modifiers/EveryScopeStage"; @@ -11,7 +12,7 @@ import { KeepContentFilterStage, KeepEmptyFilterStage, } from "./modifiers/FilterStages"; -import { HeadTailStage } from "./modifiers/HeadTailStage"; +import { HeadStage, TailStage } from "./modifiers/HeadTailStage"; import { InstanceStage } from "./modifiers/InstanceStage"; import { ExcludeInteriorStage, @@ -43,8 +44,9 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory { case "endOf": return new EndOfStage(); case "extendThroughStartOf": + return new HeadStage(this, modifier); case "extendThroughEndOf": - return new HeadTailStage(this, modifier); + return new TailStage(this, modifier); case "toRawSelection": return new RawSelectionStage(modifier); case "interiorOnly": @@ -57,33 +59,54 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory { return new TrailingStage(this, modifier); case "visible": return new VisibleStage(modifier); + case "containingScope": + if (ClassFunctionNameStage.use(modifier.scopeType)) { + return new ClassFunctionNameStage(this, modifier); + } return new ContainingScopeStage( this, this.scopeHandlerFactory, modifier, ); + case "preferredScope": + if (ClassFunctionNameStage.use(modifier.scopeType)) { + return new ClassFunctionNameStage(this, modifier); + } return new PreferredScopeStage( this, this.scopeHandlerFactory, modifier, ); + case "everyScope": - if (modifier.scopeType.type === "instance") { + if (InstanceStage.use(modifier.scopeType)) { return new InstanceStage(this, this.storedTargets, modifier); } + if (ClassFunctionNameStage.use(modifier.scopeType)) { + return new ClassFunctionNameStage(this, modifier); + } return new EveryScopeStage(this, this.scopeHandlerFactory, modifier); + case "ordinalScope": - if (modifier.scopeType.type === "instance") { + if (InstanceStage.use(modifier.scopeType)) { return new InstanceStage(this, this.storedTargets, modifier); } + if (ClassFunctionNameStage.use(modifier.scopeType)) { + return new ClassFunctionNameStage(this, modifier); + } return new OrdinalScopeStage(this, modifier); + case "relativeScope": - if (modifier.scopeType.type === "instance") { + if (InstanceStage.use(modifier.scopeType)) { return new InstanceStage(this, this.storedTargets, modifier); } + if (ClassFunctionNameStage.use(modifier.scopeType)) { + return new ClassFunctionNameStage(this, modifier); + } return new RelativeScopeStage(this.scopeHandlerFactory, modifier); + case "keepContentFilter": return new KeepContentFilterStage(modifier); case "keepEmptyFilter": @@ -98,6 +121,7 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory { throw Error( `Unexpected modifier '${modifier.type}'; it should have been removed during inference`, ); + default: { // Ensure we don't miss any new modifiers. Needed because we don't have input validation. // FIXME: remove once we have schema validation (#983) diff --git a/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts b/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts index 6f99909b72..8f146c5940 100644 --- a/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts +++ b/packages/cursorless-engine/src/processTargets/TargetPipelineRunner.ts @@ -299,10 +299,10 @@ export function processModifierStages( // First we apply each stage in sequence, letting each stage see the targets // one-by-one and concatenating the results before passing them on to the // next stage. + const options: ModifierStateOptions = { + multipleTargets: targets.length > 1, + }; modifierStages.forEach((stage) => { - const options: ModifierStateOptions = { - multipleTargets: targets.length > 1, - }; targets = targets.flatMap((target) => stage.run(target, options)); }); diff --git a/packages/cursorless-engine/src/processTargets/modifiers/ClassFunctionNameStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/ClassFunctionNameStage.ts new file mode 100644 index 0000000000..28e62dc282 --- /dev/null +++ b/packages/cursorless-engine/src/processTargets/modifiers/ClassFunctionNameStage.ts @@ -0,0 +1,62 @@ +import type { + ContainingScopeModifier, + EveryScopeModifier, + OrdinalScopeModifier, + PreferredScopeModifier, + RelativeScopeModifier, + ScopeType, +} from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { + ModifierStage, + ModifierStateOptions, +} from "../PipelineStages.types"; + +/** + * Replace `className` scope with `name` and `class`. + * Replace `functionName` scope with `name` and `namedFunction`. + */ +export class ClassFunctionNameStage implements ModifierStage { + static use(scopeType: ScopeType): boolean { + return scopeType.type === "className" || scopeType.type === "functionName"; + } + + constructor( + private modifierStageFactory: ModifierStageFactory, + private modifier: + | ContainingScopeModifier + | PreferredScopeModifier + | EveryScopeModifier + | OrdinalScopeModifier + | RelativeScopeModifier, + ) {} + + run(target: Target, options: ModifierStateOptions): Target[] { + const stage1 = this.modifierStageFactory.create({ + ...this.modifier, + scopeType: { + type: getScopeTypeType(this.modifier.scopeType), + }, + }); + + const stage2 = this.modifierStageFactory.create({ + type: "containingScope", + scopeType: { + type: "name", + }, + }); + + return stage1.run(target, options).flatMap((t) => stage2.run(t, options)); + } +} + +function getScopeTypeType(scopeType: ScopeType) { + if (scopeType.type === "className") { + return "class"; + } + if (scopeType.type === "functionName") { + return "namedFunction"; + } + throw new Error(`Unsupported scope type: ${scopeType.type}`); +} diff --git a/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts index 0b01c72658..3ee489bada 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts @@ -1,6 +1,7 @@ import { NoContainingScopeError, type HeadModifier, + type Modifier, type ScopeType, type TailModifier, } from "@cursorless/common"; @@ -16,45 +17,60 @@ import { } from "../TargetPipelineRunner"; import { HeadTailTarget, PlainTarget } from "../targets"; -export class HeadTailStage implements ModifierStage { +class HeadTailStage implements ModifierStage { constructor( private modifierStageFactory: ModifierStageFactory, - private modifier: HeadModifier | TailModifier, + private modifiers: Modifier[] | undefined, + private isHead: boolean, ) {} run(target: Target): Target[] { const modifierStages = this.getModifierStages(); const modifiedTargets = processModifierStages(modifierStages, [target]); - const isHead = this.modifier.type === "extendThroughStartOf"; return modifiedTargets.map((modifiedTarget) => { return new HeadTailTarget({ editor: target.editor, - isReversed: isHead, + isReversed: this.isHead, inputTarget: target, modifiedTarget, - isHead, + isHead: this.isHead, }); }); } private getModifierStages(): ModifierStage[] { - if (this.modifier.modifiers != null) { + if (this.modifiers != null) { return getModifierStagesFromTargetModifiers( this.modifierStageFactory, - this.modifier.modifiers, + this.modifiers, ); } - return [new BoundedLineStage(this.modifierStageFactory, this.modifier)]; + return [new BoundedLineStage(this.modifierStageFactory)]; } } -class BoundedLineStage implements ModifierStage { +export class HeadStage extends HeadTailStage { constructor( - private modifierStageFactory: ModifierStageFactory, - private modifier: HeadModifier | TailModifier, - ) {} + modifierStageFactory: ModifierStageFactory, + modifier: HeadModifier, + ) { + super(modifierStageFactory, modifier.modifiers, true); + } +} + +export class TailStage extends HeadTailStage { + constructor( + modifierStageFactory: ModifierStageFactory, + modifier: TailModifier, + ) { + super(modifierStageFactory, modifier.modifiers, false); + } +} + +class BoundedLineStage implements ModifierStage { + constructor(private modifierStageFactory: ModifierStageFactory) {} run(target: Target, options: ModifierStateOptions): Target[] { const line = this.getContainingLine(target, options); diff --git a/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts index c3e0ee7f26..14956c1360 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/InstanceStage.ts @@ -22,6 +22,10 @@ import { ContainingTokenIfUntypedEmptyStage } from "./ConditionalModifierStages" import { OutOfRangeError } from "./listUtils"; export class InstanceStage implements ModifierStage { + static use(scopeType: ScopeType): boolean { + return scopeType.type === "instance"; + } + constructor( private modifierStageFactory: ModifierStageFactory, private storedTargets: StoredTargetMap, diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts index 046a25fe12..4002f883fe 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ScopeHandlerFactoryImpl.ts @@ -1,4 +1,4 @@ -import type { ScopeType } from "@cursorless/common"; +import { pseudoScopes, type ScopeType } from "@cursorless/common"; import type { LanguageDefinitions } from "../../../languages/LanguageDefinitions"; import { BoundedNonWhitespaceSequenceScopeHandler, @@ -12,7 +12,6 @@ import { FallbackScopeHandler } from "./FallbackScopeHandler"; import { IdentifierScopeHandler } from "./IdentifierScopeHandler"; import { LineScopeHandler } from "./LineScopeHandler"; import { NotebookCellScopeHandler } from "./NotebookCellScopeHandler"; -import { SortedScopeHandler } from "./SortedScopeHandler"; import { ParagraphScopeHandler } from "./ParagraphScopeHandler"; import { CustomRegexScopeHandler, @@ -23,6 +22,7 @@ import { import type { ComplexScopeType, ScopeHandler } from "./scopeHandler.types"; import type { ScopeHandlerFactory } from "./ScopeHandlerFactory"; import { SentenceScopeHandler } from "./SentenceScopeHandler/SentenceScopeHandler"; +import { SortedScopeHandler } from "./SortedScopeHandler"; import { SurroundingPairInteriorScopeHandler, SurroundingPairScopeHandler, @@ -128,10 +128,11 @@ export class ScopeHandlerFactoryImpl implements ScopeHandlerFactory { return FallbackScopeHandler.create(this, scopeType, languageId); case "conditional": return new ConditionalScopeHandler(this, scopeType, languageId); - case "instance": - // Handle instance pseudoscope with its own special modifier - throw Error("Unexpected scope type 'instance'"); default: + // Pseudoscopes are handled separately in their own modifiers. + if (pseudoScopes.has(scopeType.type)) { + throw Error(`Unexpected scope type '${scopeType.type}'`); + } return this.languageDefinitions .get(languageId) ?.getScopeHandler(scopeType); diff --git a/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts b/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts index b5600bee97..2569c4812e 100644 --- a/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts +++ b/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts @@ -5,7 +5,11 @@ import type { ScopeTypeInfoEventCallback, SurroundingPairScopeType, } from "@cursorless/common"; -import { simpleScopeTypeTypes, surroundingPairNames } from "@cursorless/common"; +import { + pseudoScopes, + simpleScopeTypeTypes, + surroundingPairNames, +} from "@cursorless/common"; import { pull } from "lodash-es"; import type { CustomSpokenFormGeneratorImpl } from "../generateSpokenForm/CustomSpokenFormGeneratorImpl"; @@ -63,7 +67,7 @@ export class ScopeInfoProvider { const scopeTypes: ScopeType[] = [ ...simpleScopeTypeTypes // Ignore instance pseudo-scope because it's not really a scope - .filter((scopeTypeType) => scopeTypeType !== "instance") + .filter((scopeTypeType) => !pseudoScopes.has(scopeTypeType)) .map((scopeTypeType) => ({ type: scopeTypeType, })), diff --git a/packages/cursorless-org-docs/src/docs/components/util.ts b/packages/cursorless-org-docs/src/docs/components/util.ts index d8237f2969..17ef0d0fcf 100644 --- a/packages/cursorless-org-docs/src/docs/components/util.ts +++ b/packages/cursorless-org-docs/src/docs/components/util.ts @@ -60,7 +60,7 @@ export function nameComparator( a: { name: string }, b: { name: string }, ): number { - return a.name.localeCompare(b.name); + return a.name.localeCompare(b.name, undefined, { numeric: true }); } export function isScopeInternal(scope: ScopeTypeType): boolean { diff --git a/packages/meta-updater/package.json b/packages/meta-updater/package.json index eca56711db..c01f5fc8a8 100644 --- a/packages/meta-updater/package.json +++ b/packages/meta-updater/package.json @@ -14,7 +14,7 @@ } }, "scripts": { - "build": "esbuild ./src/index.ts --conditions=cursorless:bundler --bundle --outfile=dist/index.cjs --format=cjs --platform=node --external:@reflink/*", + "build": "esbuild ./src/index.ts --conditions=cursorless:bundler --bundle --outfile=dist/index.cjs --format=cjs --platform=node --external:@reflink/* --external:./get-uid-gid.js", "compile": "tsc --build", "watch": "tsc --build --watch", "clean": "rm -rf ./out tsconfig.tsbuildinfo ./dist ./build" diff --git a/queries/c.scm b/queries/c.scm index c7aaf0796d..2cc6b2524e 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -31,13 +31,8 @@ ] @statement ( - (translation_unit) @statement.iteration @class.iteration @className.iteration - (#document-range! @statement.iteration @class.iteration @className.iteration) -) - -( - (translation_unit) @namedFunction.iteration @functionName.iteration - (#document-range! @namedFunction.iteration @functionName.iteration) + (translation_unit) @statement.iteration @class.iteration @namedFunction.iteration + (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) ) ( @@ -82,7 +77,7 @@ ;;!! enum foo { }; (_ (_ - name: (_) @className @name + name: (_) @name body: (_ "{" @interior.start.endOf "}" @interior.end.startOf @@ -113,7 +108,7 @@ "}" @interior.end.startOf ) ) @_dummy - declarator: (type_identifier) @className @name + declarator: (type_identifier) @name (#type? @_dummy struct_specifier union_specifier enum_specifier) ) @_.domain @class @type @@ -135,35 +130,35 @@ (function_declarator declarator: (_ !name - ) @functionName @name + ) @name ) -) @namedFunction @functionName.domain @name.domain +) @namedFunction @name.domain ;;!! void C::foo() {} (declaration (function_declarator declarator: (_ - name: (_) @functionName @name + name: (_) @name ) ) -) @namedFunction @functionName.domain @name.domain +) @namedFunction @name.domain (function_definition declarator: (_ declarator: (_ - name: (_) @functionName @name + name: (_) @name ) ) -) @namedFunction @functionName.domain @name.domain +) @namedFunction @name.domain ;;!! void foo() {} (function_definition declarator: (_ declarator: (_ !name - ) @functionName @name + ) @name ) -) @namedFunction @functionName.domain @name.domain +) @namedFunction @name.domain ;;!! void foo() { } ;;! ^ diff --git a/queries/clojure.scm b/queries/clojure.scm index 2ec5c41e99..4a6dbdb357 100644 --- a/queries/clojure.scm +++ b/queries/clojure.scm @@ -110,8 +110,8 @@ . value: (_) @_dummy . - value: (_) @name @functionName - ) @namedFunction @name.domain @functionName.domain + value: (_) @name + ) @namedFunction @name.domain (#text? @_dummy defn defmacro) (#not-parent-type? @namedFunction quoting_lit) ) diff --git a/queries/cpp.scm b/queries/cpp.scm index cbd13fb683..8e0f8a9fee 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -18,7 +18,7 @@ (_ (class_specifier - name: (_) @className @name + name: (_) @name body: (_ "{" @interior.start.endOf "}" @interior.end.startOf @@ -47,8 +47,8 @@ ) @_.domain (field_declaration_list - "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf - "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf + "{" @namedFunction.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf ) @_.domain ;;!! int aaa = 0; @@ -58,15 +58,6 @@ default_value: (_) @value ) @_.domain -;;!! void ClassName::method() {} -(function_definition - declarator: (_ - declarator: (_ - scope: (_) @className - ) - ) -) @_.domain - ;;!! []() {} ;;! ^^^^^^^ (lambda_expression diff --git a/queries/csharp.scm b/queries/csharp.scm index c73ba46c7e..9a8b983a3c 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -50,13 +50,8 @@ ] @statement ( - (compilation_unit) @statement.iteration @class.iteration @className.iteration - (#document-range! @statement.iteration @class.iteration @className.iteration) -) - -( - (compilation_unit) @namedFunction.iteration @functionName.iteration - (#document-range! @namedFunction.iteration @functionName.iteration) + (compilation_unit) @statement.iteration @class.iteration @namedFunction.iteration + (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) ) ( @@ -196,7 +191,7 @@ ;;!! class Foo {} ;;! ^^^^^^^^^^^^ (class_declaration - name: (identifier) @className + name: (identifier) @name body: (_ "{" @interior.start.endOf "}" @interior.end.startOf @@ -205,8 +200,8 @@ (class_declaration body: (_ - "{" @class.iteration.start.endOf @className.iteration.start.endOf @statement.iteration.start.endOf - "}" @class.iteration.end.startOf @className.iteration.end.startOf @statement.iteration.end.startOf + "{" @class.iteration.start.endOf @name.iteration.start.endOf @statement.iteration.start.endOf + "}" @class.iteration.end.startOf @name.iteration.end.startOf @statement.iteration.end.startOf ) ) @@ -277,23 +272,23 @@ [ (delegate_declaration - name: (_) @functionName + name: (_) @name ) (local_function_statement - name: (_) @functionName + name: (_) @name ) (method_declaration - name: (_) @functionName + name: (_) @name ) (constructor_declaration - name: (_) @functionName + name: (_) @name ) -] @namedFunction @functionName.domain +] @namedFunction @name.domain (class_declaration body: (_ - "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf - "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf + "{" @namedFunction.iteration.start.endOf @name.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf @name.iteration.end.startOf ) ) diff --git a/queries/dart.scm b/queries/dart.scm index 3f8a70e974..8649c3e550 100644 --- a/queries/dart.scm +++ b/queries/dart.scm @@ -22,5 +22,5 @@ ;;!! class Foo {} ;;! ^^^^^^^^^^^^ (class_definition - name: (_) @className -) @class @className.domain + name: (_) @name +) @class @name.domain diff --git a/queries/go.scm b/queries/go.scm index 455f3e404b..7cb7da5335 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -199,26 +199,26 @@ ;; func foo[]() {} ;; func foo() (function_declaration - name: (_) @functionName + name: (_) @name body: (block . "{" @interior.start.endOf "}" @interior.end.startOf . )? -) @namedFunction @functionName.domain @interior.domain +) @namedFunction @_.domain ;; method declaration ;; func (X) foo() {} (method_declaration - name: (_) @functionName + name: (_) @name body: (block . "{" @interior.start.endOf "}" @interior.end.startOf . ) -) @namedFunction @functionName.domain @interior.domain +) @namedFunction @_.domain ;; func literal (func_literal diff --git a/queries/java.scm b/queries/java.scm index 1ae73642f6..440591269d 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -62,7 +62,7 @@ ;;! ^^^^^^^^^^^^ ;;! ^^^ (class_declaration - name: (_) @name @className + name: (_) @name ) @class @type @_.domain ;;!! interface Foo {} @@ -73,8 +73,8 @@ ) @type @_.domain ( - (program) @class.iteration @className.iteration @statement.iteration - (#document-range! @class.iteration @className.iteration @statement.iteration) + (program) @class.iteration @statement.iteration + (#document-range! @class.iteration @statement.iteration) ) ( @@ -85,13 +85,8 @@ ;;!! class MyClass { } ;;! ^ (class_body - "{" @class.iteration.start.endOf @className.iteration.start.endOf - "}" @class.iteration.end.startOf @className.iteration.end.startOf -) - -(class_body - "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf - "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf + "{" @class.iteration.start.endOf @namedFunction.iteration.start.endOf + "}" @class.iteration.end.startOf @namedFunction.iteration.end.startOf ) ;;!! { } @@ -128,11 +123,12 @@ ;;!! void myFunk() {} ;;! ^^^^^^^^^^^^^^^^ (method_declaration - name: (_) @name @functionName -) @namedFunction @_.domain + name: (_) @name +) @namedFunction @name.domain + (constructor_declaration - name: (_) @name @functionName -) @namedFunction @_.domain + name: (_) @name +) @namedFunction @name.domain ;;!! "string" ;;! ^^^^^^^^ diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 5df0c89704..b2d267a913 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -44,8 +44,8 @@ ) ( - (program) @statement.iteration @class.iteration @className.iteration - (#document-range! @statement.iteration @class.iteration @className.iteration) + (program) @statement.iteration @class.iteration + (#document-range! @statement.iteration @class.iteration) ) ( @@ -67,6 +67,7 @@ enum_assignment variable_declarator method_signature + method_definition abstract_method_signature public_field_definition field_definition @@ -605,13 +606,9 @@ ;;! ^^^^^^^^^^^^ ( [ - (class_declaration - name: (_) @className - ) - (class - name: (_) @className - ) - ] @class @type @_.domain + (class_declaration) + (class) + ] @class @type (#not-parent-type? @class export_statement) ) @@ -619,14 +616,10 @@ ;;! ^^^^^^^^^^^^^^^^^^^ (export_statement [ - (class_declaration - name: (_) @className - ) - (class - name: (_) @className - ) + (class_declaration) + (class) ] -) @class @type @_.domain +) @class @type ;;!! true ? 0 : 1 ;;! ^^^^ diff --git a/queries/javascript.function.scm b/queries/javascript.function.scm index 831d1dc155..617f8c1ffd 100644 --- a/queries/javascript.function.scm +++ b/queries/javascript.function.scm @@ -1,3 +1,8 @@ +;; Note that there are a few Typescript-specific function declarations that we +;; don't handle here; see typescript.scm. +;; We also don't handle function declarations that only exist in Javascript; +;; see javascript.scm. + ;; Anonymous functions [ ;;!! function() {} @@ -37,21 +42,16 @@ ( [ ;;!! function foo() {} - (function_declaration - name: (_) @functionName - ) + (function_declaration) ;;!! function *foo() {} - (generator_function_declaration - name: (_) @functionName - ) + (generator_function_declaration) ;;!! (let | const) foo = () => {} ;;!! (let | const) foo = function() {} ;;!! (let | const) foo = function *() {} (lexical_declaration (variable_declarator - name: (_) @functionName value: [ (function_expression !name @@ -71,7 +71,6 @@ ;; of https://github.com/tree-sitter/tree-sitter/issues/1442#issuecomment-1584628651 (variable_declaration (variable_declarator - name: (_) @functionName value: [ (function_expression !name @@ -83,7 +82,7 @@ ] ) ) - ] @namedFunction @functionName.domain + ] @namedFunction (#not-parent-type? @namedFunction export_statement) ) @@ -91,21 +90,16 @@ (export_statement [ ;;!! export [default] function foo() {} - (function_declaration - name: (_) @functionName - ) + (function_declaration) ;;!! export [default] function *foo() {} - (generator_function_declaration - name: (_) @functionName - ) + (generator_function_declaration) - ;;!! export [default] (let | const | var) foo = () => {} ;;!! export [default] (let | const | var) foo = function() {} ;;!! export [default] (let | const | var) foo = function *() {} + ;;!! export [default] (let | const | var) foo = () => {} (_ (variable_declarator - name: (_) @functionName value: [ (function_expression !name @@ -118,49 +112,63 @@ ) ) ] -) @namedFunction @functionName.domain +) @namedFunction -;; Note that there are a few Typescript-specific function declarations that we -;; don't handle here; see typescript.scm. -;; We also don't handle function declarations that only exist in Javascript; -;; see javascript.scm. +;;!! (function foo() {}) +;;!! (function *foo() {}) [ - ;;!! (function foo() {}) (function_expression - name: (_) @functionName + name: (_) ) - - ;;!! (function *foo() {}) (generator_function - name: (_) @functionName + name: (_) ) +] @namedFunction - ;;!! class Foo { foo() {} } - ;;! ^^^^^^^^ - (method_definition - name: (_) @functionName - ) +;;!! foo = function() {}; +;;!! foo = function *() {}; +;;!! foo = () => {}; +(assignment_expression + right: [ + (function_expression + !name + ) + (generator_function + !name + ) + (arrow_function) + ] +) @namedFunction - ;;!! foo = () => {}; - ;;!! foo = function() {}; - ;;!! foo = function *() {}; - (assignment_expression - left: (_) @functionName - right: [ - (function_expression - !name - ) - (generator_function - !name - ) - (arrow_function) - ] - ) -] @namedFunction @functionName.domain +;;!! { foo: function() {} } +;;!! { foo: *() {} } +;;!! { foo: () => {} } +(pair + key: (_) @name + value: [ + (function_expression + !name + ) + (generator_function + !name + ) + (arrow_function) + ] @name.trailing.startOf +) @namedFunction @name.domain +;;!! class Foo { @bar foo() {} } +;;! ^^^^^^^^^^^^^ ( - (program) @namedFunction.iteration @functionName.iteration - (#document-range! @namedFunction.iteration @functionName.iteration) + (decorator)? @namedFunction.start @name.domain.start + . + (method_definition + name: (_) @name + ) @namedFunction.end @name.domain.end +) + +( + (program) @namedFunction.iteration + (#document-range! @namedFunction.iteration) ) [ @@ -168,23 +176,9 @@ (object (method_definition) ) -] @namedFunction.iteration @functionName.iteration +] @namedFunction.iteration (class_body - "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf - "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf + "{" @namedFunction.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf ) - -;;!! { funk: function() { } } -;;! ^^^^ -(pair - key: (_) @functionName @name - value: (function_expression) -) @_.domain - -;;!! { funk: () => { } } -;;! ^^^^ -(pair - key: (_) @functionName @name - value: (arrow_function) -) @_.domain diff --git a/queries/javascript.scm b/queries/javascript.scm index 8d94112311..08c1cda195 100644 --- a/queries/javascript.scm +++ b/queries/javascript.scm @@ -16,7 +16,6 @@ ;;! ^^^^^^^^^^^^^^^^^^^^^^ ;;!! } (field_definition - property: (_) @functionName value: [ (function_expression !name @@ -26,9 +25,9 @@ ) (arrow_function) ] - ) @statement.start @namedFunction.start @functionName.domain.start + ) @statement.start @namedFunction.start @name.domain.start . - ";"? @statement.end @namedFunction.end @functionName.domain.end + ";"? @statement.end @namedFunction.end @name.domain.end ) (_ diff --git a/queries/kotlin.scm b/queries/kotlin.scm index b604afef0e..0b3b71be81 100644 --- a/queries/kotlin.scm +++ b/queries/kotlin.scm @@ -29,20 +29,21 @@ ) (class_declaration - (type_identifier) @name @className + (type_identifier) @name ) @class @_.domain (object_declaration - (type_identifier) @name @className + (type_identifier) @name ) @class @_.domain (companion_object - (type_identifier) @name @className + (type_identifier) @name ) @class @_.domain (function_declaration - (simple_identifier) @name @functionName + (simple_identifier) @name ) @namedFunction @_.domain + (secondary_constructor) @namedFunction (if_expression) @ifStatement diff --git a/queries/lua.scm b/queries/lua.scm index e176daa432..934614788d 100644 --- a/queries/lua.scm +++ b/queries/lua.scm @@ -217,7 +217,7 @@ ;;!! function add(x, b) return x + y end ;;! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (function_declaration - name: (_) @functionName + name: (_) @name parameters: (_) @interior.start.endOf "end" @interior.end.startOf ) @namedFunction @_.domain diff --git a/queries/php.scm b/queries/php.scm index 3a3d4dd0ff..75cd9b83d4 100644 --- a/queries/php.scm +++ b/queries/php.scm @@ -70,8 +70,8 @@ ] @list (class_declaration - name: (_) @className -) @class @className.domain + name: (_) @name +) @class @name.domain [ (function_definition) @@ -96,12 +96,12 @@ [ (function_definition - name: (_) @functionName + name: (_) @name ) (method_declaration - name: (_) @functionName + name: (_) @name ) -] @functionName.domain +] @name.domain [ (function_call_expression) diff --git a/queries/python.scm b/queries/python.scm index 42ca32c45e..c15c40e1b4 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -73,6 +73,7 @@ (_ name: (_) @name + (#not-parent-type? @name function_definition class_definition) ) @_.domain ;;!! def aaa(bbb): @@ -124,18 +125,6 @@ ) ) -;;!! def aaa() -> str: -;;! ^^^ -;;! xxxxxxx -;;! [----------------- -;;!! pass -;;! --------] -(function_definition - (_) @_.leading.endOf - . - return_type: (_) @type -) @_.domain - ;;!! d = {"a": 1234} ;;! ^^^^ ;;! xxxxxx @@ -305,24 +294,37 @@ ( (function_definition - name: (_) @functionName + name: (_) @name body: (_) @interior - ) @namedFunction @functionName.domain @interior.domain + ) @namedFunction @_.domain (#not-parent-type? @namedFunction decorated_definition) ) + (decorated_definition (function_definition - name: (_) @functionName + name: (_) @name body: (_) @interior ) -) @namedFunction @functionName.domain @interior.domain +) @namedFunction @_.domain + +;;!! def aaa() -> str: +;;! ^^^ +;;! xxxxxxx +;;! [----------------- +;;!! pass +;;! --------] +(function_definition + (_) @_.leading.endOf + . + return_type: (_) @type +) @_.domain ;;!! class MyClass: ( (class_definition - name: (_) @className + name: (_) @name body: (_) @interior - ) @class @className.domain @interior.domain + ) @class @_.domain (#not-parent-type? @class decorated_definition) ) @@ -335,23 +337,18 @@ ;;!! class MyClass: (decorated_definition (class_definition - name: (_) @className + name: (_) @name body: (_) @interior ) -) @class @className.domain @interior.domain +) @class @_.domain (decorated_definition (class_definition) ) @type ( - (module) @class.iteration @className.iteration - (#document-range! @class.iteration @className.iteration) -) - -( - (module) @statement.iteration - (#document-range! @statement.iteration) + (module) @statement.iteration @class.iteration @namedFunction.iteration + (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) ) ;; This is a hack to handle the case where the entire document is a `with` statement @@ -363,13 +360,8 @@ (#document-range! @name.iteration @value.iteration @type.iteration) ) -( - (module) @namedFunction.iteration @functionName.iteration - (#document-range! @namedFunction.iteration @functionName.iteration) -) - (class_definition - body: (_) @namedFunction.iteration @functionName.iteration + body: (_) @namedFunction.iteration @name.iteration ) ;;!! def foo(): diff --git a/queries/r.scm b/queries/r.scm index c1afd05fbd..c5ea2c3109 100644 --- a/queries/r.scm +++ b/queries/r.scm @@ -32,13 +32,13 @@ (binary_operator ;;!! abc <- function(x){ } ;;! ^^^ - lhs: (identifier) @functionName + lhs: (identifier) @name rhs: (function_definition name: "function" parameters: (parameters) body: (braced_expression) @interior - ) @functionName.trailing.startOf -) @namedFunction @namedFunction.domain @functionName.domain + ) @name.trailing.startOf +) @namedFunction @_.domain ;; anonymous function ;;!! function(x){ } @@ -148,8 +148,8 @@ ;;!! list(1, 2, 3) ;;! ^^^^^^^^^^^^^ (call - function: (identifier) @functionName - (#match? @functionName "^(c|list)$") + function: (identifier) @name + (#match? @name "^(c|list)$") ) @list (binary_operator diff --git a/queries/ruby.scm b/queries/ruby.scm index 6f6c831deb..766c4e0966 100644 --- a/queries/ruby.scm +++ b/queries/ruby.scm @@ -123,17 +123,16 @@ (singleton_method) ] @namedFunction -(class) @class +(program) @class.iteration @namedFunction.iteration @name.iteration -(class) @namedFunction.iteration @class.iteration -(program) @namedFunction.iteration @class.iteration @className.iteration - -(class) @functionName.iteration @name.iteration -(program) @functionName.iteration @name.iteration +(class + name: (_) @class.iteration.start.endOf @namedFunction.iteration.start.endOf @name.iteration.start.endOf + "end" @class.iteration.end.startOf @namedFunction.iteration.end.startOf @name.iteration.end.startOf +) @class (class - name: (_) @className @name -) @_.domain + name: (_) @name +) @class @_.domain (string) @string @@ -143,15 +142,17 @@ ] @textFragment (method - name: (_) @functionName @name + name: (_) @name ) @_.domain + (singleton_method - name: (_) @functionName @name + name: (_) @name ) @_.domain (assignment left: (_) @name ) @_.domain + (operator_assignment left: (_) @name ) @_.domain diff --git a/queries/rust.scm b/queries/rust.scm index dde0ec29b6..105de88965 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -99,10 +99,10 @@ [ (struct_item - name: (_) @className @name + name: (_) @name ) (enum_item - name: (_) @className @name + name: (_) @name ) ] @class @_.domain @@ -113,14 +113,14 @@ ) @_.domain (trait_item - name: (_) @className @name + name: (_) @name ) @_.domain ;;!! fn foo() {} ;;! ^^^^^^^^^^^ (function_item - name: (_) @functionName @name -) @namedFunction @_.domain + name: (_) @name +) @namedFunction @name.domain ;;!! fn foo() -> int {} ;;! ^^^ diff --git a/queries/scala.scm b/queries/scala.scm index 29e3d83dfe..f62fac220f 100644 --- a/queries/scala.scm +++ b/queries/scala.scm @@ -18,15 +18,15 @@ ;; treating classes = classlike [ (class_definition - name: (_) @className + name: (_) @name ) (object_definition - name: (_) @className + name: (_) @name ) (trait_definition - name: (_) @className + name: (_) @name ) -] @class @className.domain +] @class @name.domain ;; list.size(), does not count foo.size (field_expression), or foo size (postfix_expression) (call_expression) @functionCall @@ -34,8 +34,8 @@ (lambda_expression) @anonymousFunction (function_definition - name: (_) @functionName -) @namedFunction @functionName.domain + name: (_) @name +) @namedFunction @name.domain (match_expression value: (_) @value diff --git a/queries/scss.scm b/queries/scss.scm index ac2c844681..ceda500c02 100644 --- a/queries/scss.scm +++ b/queries/scss.scm @@ -77,12 +77,12 @@ (else_clause) @branch (mixin_statement - (name) @functionName @name -) @namedFunction @functionName.domain @name.domain + (name) @name +) @namedFunction @name.domain (function_statement - (name) @functionName @name -) @namedFunction @functionName.domain @name.domain + (name) @name +) @namedFunction @name.domain (declaration (variable_name) @name @@ -124,13 +124,13 @@ ) ( - (stylesheet) @namedFunction.iteration @functionName.iteration - (#document-range! @namedFunction.iteration @functionName.iteration) + (stylesheet) @namedFunction.iteration @name.iteration + (#document-range! @namedFunction.iteration @name.iteration) ) (block - "{" @namedFunction.iteration.start.endOf @functionName.iteration.start.endOf - "}" @namedFunction.iteration.end.startOf @functionName.iteration.end.startOf + "{" @namedFunction.iteration.start.endOf @name.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf @name.iteration.end.startOf ) (binary_expression diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index d0dfe41437..7ce84f207e 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -78,27 +78,32 @@ ) ) @_.domain +( + ;;!! function foo(); + ;;! ^^^^^^^^^^^^^^^ + (function_signature) @namedFunction + (#not-parent-type? @namedFunction export_statement) +) + +(export_statement + (function_signature) +) @namedFunction + ;; Define these here because these node types don't exist in javascript. (_ [ - ;;!! function foo(); - ;;! ^^^^^^^^^^^^^^^ - (function_signature - name: (_) @functionName @name - ) - ;;!! class Foo { foo() {} } ;;! ^^^^^^^^ ;;!! interface Foo { foo(): void; } ;;! ^^^^^^^^^^^^ (method_signature - name: (_) @functionName @name + name: (_) @name ) ;;!! class Foo { abstract foo(): void; } ;;! ^^^^^^^^^^^^^^^^^^^^^ (abstract_method_signature - name: (_) @functionName @name + name: (_) @name ) ;;!! class Foo { @@ -110,7 +115,6 @@ ;;! ^^^^^^^^^^^^^^^^^^^^^^ ;;!! } (public_field_definition - name: (_) @functionName value: [ (function_expression !name @@ -121,9 +125,9 @@ (arrow_function) ] ) - ] @namedFunction.start @functionName.domain.start @name.domain.start + ] @namedFunction.start @name.domain.start . - ";"? @namedFunction.end @functionName.domain.end @name.domain.end + ";"? @namedFunction.end @name.domain.end ) (_ @@ -168,7 +172,7 @@ [ (interface_declaration) (object_type) -] @namedFunction.iteration @functionName.iteration +] @namedFunction.iteration ;; Special cases for `(let | const | var) foo = ...;` because the full statement ;; is actually a grandparent of the `name` node, so we want the domain to include @@ -398,26 +402,15 @@ ;;!! abstract class MyClass {} ;;! ^^^^^^^^^^^^^^^^^^^^^^^^^ ( - (abstract_class_declaration - name: (_) @className - ) @class @type @_.domain + (abstract_class_declaration) @class @type (#not-parent-type? @class export_statement) ) ;;!! export abstract class MyClass {} ;;! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (export_statement - (abstract_class_declaration - name: (_) @className - ) -) @class @type @_.domain - -;;!! class MyClass {} -;;! ^^^^^^^ -;;! ---------------- -(abstract_class_declaration - name: (_) @name -) @_.domain + (abstract_class_declaration) +) @class @type ;;!! interface Type { name: string; } ;;! ^^^^