diff --git a/data/fixtures/scopes/java/type/type.return.scope b/data/fixtures/scopes/java/type/type.return.scope deleted file mode 100644 index 74a68959c5..0000000000 --- a/data/fixtures/scopes/java/type/type.return.scope +++ /dev/null @@ -1,38 +0,0 @@ -public class Foo { - public int foo() {} -} ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-2:1 - >------------------ -0| public class Foo { -1| public int foo() {} -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:11-1:14 - >---< -1| public int foo() {} - -[#2 Removal] = 1:11-1:15 - >----< -1| public int foo() {} - -[#2 Leading delimiter] = 1:10-1:11 - >-< -1| public int foo() {} - -[#2 Trailing delimiter] = 1:14-1:15 - >-< -1| public int foo() {} - -[#2 Domain] = 1:4-1:23 - >-------------------< -1| public int foo() {} - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/anonymousFunction.scope b/data/fixtures/scopes/php/anonymousFunction.scope new file mode 100644 index 0000000000..d56626e8d2 --- /dev/null +++ b/data/fixtures/scopes/php/anonymousFunction.scope @@ -0,0 +1,11 @@ +-------------< +1| function() {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/anonymousFunction2.scope b/data/fixtures/scopes/php/anonymousFunction2.scope new file mode 100644 index 0000000000..3fcf9c76d8 --- /dev/null +++ b/data/fixtures/scopes/php/anonymousFunction2.scope @@ -0,0 +1,11 @@ + 0; +--- + +[Content] = +[Removal] = +[Domain] = 1:0-1:9 + >---------< +1| fn() => 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/argument/argument.catch.scope b/data/fixtures/scopes/php/argument/argument.catch.scope new file mode 100644 index 0000000000..e548698aa1 --- /dev/null +++ b/data/fixtures/scopes/php/argument/argument.catch.scope @@ -0,0 +1,12 @@ +------------< +2| catch (Exception $e) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/argument/argument.formal.lambda.iteration.scope b/data/fixtures/scopes/php/argument/argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..80af447c27 --- /dev/null +++ b/data/fixtures/scopes/php/argument/argument.formal.lambda.iteration.scope @@ -0,0 +1,11 @@ +----------< +1| function($aaa, $bbb) {}; + +[Domain] = 1:0-1:23 + >-----------------------< +1| function($aaa, $bbb) {}; diff --git a/data/fixtures/scopes/php/argument/argument.formal.lambda.multiLine.scope b/data/fixtures/scopes/php/argument/argument.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..e2db6c9ec8 --- /dev/null +++ b/data/fixtures/scopes/php/argument/argument.formal.lambda.multiLine.scope @@ -0,0 +1,45 @@ +----< +2| $aaa, + +[#1 Removal] = 2:4-3:4 + >----- +2| $aaa, +3| $bbb + ----< + +[#1 Trailing delimiter] = 2:8-3:4 + >- +2| $aaa, +3| $bbb + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:4-3:8 + >----< +3| $bbb + +[#2 Removal] = 2:8-3:8 + >- +2| $aaa, +3| $bbb + --------< + +[#2 Leading delimiter] = 2:8-3:4 + >- +2| $aaa, +3| $bbb + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argument/argument.formal.lambda.singleLine.scope b/data/fixtures/scopes/php/argument/argument.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..f72b84b904 --- /dev/null +++ b/data/fixtures/scopes/php/argument/argument.formal.lambda.singleLine.scope @@ -0,0 +1,34 @@ +----< +1| function($aaa, $bbb) {}; + +[#1 Removal] = 1:9-1:15 + >------< +1| function($aaa, $bbb) {}; + +[#1 Trailing delimiter] = 1:13-1:15 + >--< +1| function($aaa, $bbb) {}; + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:15-1:19 + >----< +1| function($aaa, $bbb) {}; + +[#2 Removal] = 1:13-1:19 + >------< +1| function($aaa, $bbb) {}; + +[#2 Leading delimiter] = 1:13-1:15 + >--< +1| function($aaa, $bbb) {}; + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.empty.scope new file mode 100644 index 0000000000..3290a8b2fa --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.empty.scope @@ -0,0 +1,14 @@ +< +1| new Foo(); + +[Domain] = 1:0-1:9 + >---------< +1| new Foo(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.multiLine.scope new file mode 100644 index 0000000000..2f2f370c7b --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.multiLine.scope @@ -0,0 +1,34 @@ +---- +2| aaa, +3| bbb + -------< + +[Removal] = 1:8-4:0 + > +1| new Foo( +2| aaa, +3| bbb +4| ); + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| aaa, + +[Domain] = 1:0-4:1 + >-------- +1| new Foo( +2| aaa, +3| bbb +4| ); + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.singleLine.scope new file mode 100644 index 0000000000..bc77898c31 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.constructor.singleLine.scope @@ -0,0 +1,14 @@ +--------< +1| new Foo(aaa, bbb); + +[Domain] = 1:0-1:17 + >-----------------< +1| new Foo(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.empty.scope new file mode 100644 index 0000000000..04f5dcd757 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.empty.scope @@ -0,0 +1,14 @@ +< +1| foo(); + +[Domain] = 1:0-1:5 + >-----< +1| foo(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.method.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.method.empty.scope new file mode 100644 index 0000000000..23d10679f9 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.method.empty.scope @@ -0,0 +1,14 @@ +bar(); +--- + +[Content] = +[Removal] = 1:10-1:10 + >< +1| $foo->bar(); + +[Domain] = 1:0-1:11 + >-----------< +1| $foo->bar(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.method.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.method.multiLine.scope new file mode 100644 index 0000000000..c5567d7521 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.method.multiLine.scope @@ -0,0 +1,34 @@ +bar( + aaa, + bbb +); +--- + +[Content] = 2:4-3:7 + >---- +2| aaa, +3| bbb + -------< + +[Removal] = 1:10-4:0 + > +1| $foo->bar( +2| aaa, +3| bbb +4| ); + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| aaa, + +[Domain] = 1:0-4:1 + >---------- +1| $foo->bar( +2| aaa, +3| bbb +4| ); + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.method.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.method.singleLine.scope new file mode 100644 index 0000000000..de75a76ba6 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.method.singleLine.scope @@ -0,0 +1,14 @@ +bar(aaa, bbb); +--- + +[Content] = +[Removal] = 1:10-1:18 + >--------< +1| $foo->bar(aaa, bbb); + +[Domain] = 1:0-1:19 + >-------------------< +1| $foo->bar(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.multiLine.scope new file mode 100644 index 0000000000..3def60e39e --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.multiLine.scope @@ -0,0 +1,34 @@ +---- +2| aaa, +3| bbb + -------< + +[Removal] = 1:4-4:0 + > +1| foo( +2| aaa, +3| bbb +4| ); + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| aaa, + +[Domain] = 1:0-4:1 + >---- +1| foo( +2| aaa, +3| bbb +4| ); + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.actual.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.actual.singleLine.scope new file mode 100644 index 0000000000..f0c671d91b --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.actual.singleLine.scope @@ -0,0 +1,14 @@ +--------< +1| foo(aaa, bbb); + +[Domain] = 1:0-1:13 + >-------------< +1| foo(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.empty.scope new file mode 100644 index 0000000000..01864297e5 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.empty.scope @@ -0,0 +1,16 @@ +< +2| function __construct() {} + +[Domain] = 2:4-2:29 + >-------------------------< +2| function __construct() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.multiLine.scope new file mode 100644 index 0000000000..9818f28d32 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.multiLine.scope @@ -0,0 +1,36 @@ +----- +3| $aaa, +4| $bbb + ------------< + +[Removal] = 2:25-5:4 + > +2| function __construct( +3| $aaa, +4| $bbb +5| ) {} + ----< + +[Leading delimiter] = 3:0-3:8 + >--------< +3| $aaa, + +[Domain] = 2:4-5:8 + >--------------------- +2| function __construct( +3| $aaa, +4| $bbb +5| ) {} + --------< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.singleLine.scope new file mode 100644 index 0000000000..40bcee21b2 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.constructor.singleLine.scope @@ -0,0 +1,16 @@ +----------< +2| function __construct($aaa, $bbb) {} + +[Domain] = 2:4-2:39 + >-----------------------------------< +2| function __construct($aaa, $bbb) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.empty.scope new file mode 100644 index 0000000000..ac3729d833 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.empty.scope @@ -0,0 +1,14 @@ +< +1| function foo() {} + +[Domain] = 1:0-1:17 + >-----------------< +1| function foo() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.empty.scope new file mode 100644 index 0000000000..e1aed2fbff --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.empty.scope @@ -0,0 +1,14 @@ +< +1| function() {}; + +[Domain] = 1:0-1:13 + >-------------< +1| function() {}; + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.empty2.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.empty2.scope new file mode 100644 index 0000000000..6421093e1f --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.empty2.scope @@ -0,0 +1,14 @@ + 0; +--- + +[Content] = +[Removal] = 1:3-1:3 + >< +1| fn() => 0; + +[Domain] = 1:0-1:9 + >---------< +1| fn() => 0; + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..b904cf2344 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.multiLine.scope @@ -0,0 +1,34 @@ +----- +2| $aaa, +3| $bbb + --------< + +[Removal] = 1:9-4:0 + > +1| function( +2| $aaa, +3| $bbb +4| ) {}; + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| $aaa, + +[Domain] = 1:0-4:4 + >--------- +1| function( +2| $aaa, +3| $bbb +4| ) {}; + ----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.multiLine2.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.multiLine2.scope new file mode 100644 index 0000000000..f80b9685cb --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.multiLine2.scope @@ -0,0 +1,34 @@ + 0; +--- + +[Content] = 2:4-3:8 + >----- +2| $aaa, +3| $bbb + --------< + +[Removal] = 1:3-4:0 + > +1| fn( +2| $aaa, +3| $bbb +4| ) => 0; + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| $aaa, + +[Domain] = 1:0-4:6 + >--- +1| fn( +2| $aaa, +3| $bbb +4| ) => 0; + ------< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..ba2a2fc47a --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.singleLine.scope @@ -0,0 +1,14 @@ +----------< +1| function($aaa, $bbb) {}; + +[Domain] = 1:0-1:23 + >-----------------------< +1| function($aaa, $bbb) {}; + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.singleLine2.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.singleLine2.scope new file mode 100644 index 0000000000..e316de2583 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.lambda.singleLine2.scope @@ -0,0 +1,14 @@ + 0; +--- + +[Content] = +[Removal] = 1:3-1:13 + >----------< +1| fn($aaa, $bbb) => 0; + +[Domain] = 1:0-1:19 + >-------------------< +1| fn($aaa, $bbb) => 0; + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.method.empty.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.method.empty.scope new file mode 100644 index 0000000000..b0d071c1e2 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.method.empty.scope @@ -0,0 +1,16 @@ +< +2| function bar() {} + +[Domain] = 2:4-2:21 + >-----------------< +2| function bar() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.method.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.method.multiLine.scope new file mode 100644 index 0000000000..c587306aef --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.method.multiLine.scope @@ -0,0 +1,36 @@ +----- +3| $aaa, +4| $bbb + ------------< + +[Removal] = 2:17-5:4 + > +2| function bar( +3| $aaa, +4| $bbb +5| ) {} + ----< + +[Leading delimiter] = 3:0-3:8 + >--------< +3| $aaa, + +[Domain] = 2:4-5:8 + >------------- +2| function bar( +3| $aaa, +4| $bbb +5| ) {} + --------< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.method.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.method.singleLine.scope new file mode 100644 index 0000000000..b2dcb13a6c --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.method.singleLine.scope @@ -0,0 +1,16 @@ +----------< +2| function bar($aaa, $bbb) {} + +[Domain] = 2:4-2:31 + >---------------------------< +2| function bar($aaa, $bbb) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.multiLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.multiLine.scope new file mode 100644 index 0000000000..170bf60fc2 --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.multiLine.scope @@ -0,0 +1,34 @@ +----- +2| $aaa, +3| $bbb + --------< + +[Removal] = 1:13-4:0 + > +1| function foo( +2| $aaa, +3| $bbb +4| ) {} + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| $aaa, + +[Domain] = 1:0-4:4 + >------------- +1| function foo( +2| $aaa, +3| $bbb +4| ) {} + ----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/php/argumentList/argumentList.formal.singleLine.scope b/data/fixtures/scopes/php/argumentList/argumentList.formal.singleLine.scope new file mode 100644 index 0000000000..77c8f837de --- /dev/null +++ b/data/fixtures/scopes/php/argumentList/argumentList.formal.singleLine.scope @@ -0,0 +1,14 @@ +----------< +1| function foo($aaa, $bbb) {} + +[Domain] = 1:0-1:27 + >---------------------------< +1| function foo($aaa, $bbb) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/php/branch/branch.if.elif.else.scope b/data/fixtures/scopes/php/branch/branch.if.elif.else.scope new file mode 100644 index 0000000000..be0c4d1353 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.if.elif.else.scope @@ -0,0 +1,46 @@ +------------< +1| if (true) {} + +[#1 Removal] = 1:0-2:5 + >------------ +1| if (true) {} +2| else if (false) {} + -----< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:0-2:18 + >------------------< +2| else if (false) {} + +[#2 Removal] = 2:0-3:0 + >------------------ +2| else if (false) {} +3| else {} + < + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 3:0-3:7 + >-------< +3| else {} + +[#3 Removal] = 2:18-3:7 + > +2| else if (false) {} +3| else {} + -------< + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/branch/branch.if.else.scope b/data/fixtures/scopes/php/branch/branch.if.else.scope new file mode 100644 index 0000000000..64fe44263f --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.if.else.scope @@ -0,0 +1,31 @@ +------------< +1| if (true) {} + +[#1 Removal] = 1:0-2:0 + >------------ +1| if (true) {} +2| else {} + < + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:0-2:7 + >-------< +2| else {} + +[#2 Removal] = 1:12-2:7 + > +1| if (true) {} +2| else {} + -------< + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/branch/branch.if.iteration.scope b/data/fixtures/scopes/php/branch/branch.if.iteration.scope new file mode 100644 index 0000000000..efbd899481 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.if.iteration.scope @@ -0,0 +1,13 @@ +------------ +1| if (true) {} +2| else if (false) {} +3| else {} + -------< diff --git a/data/fixtures/scopes/php/branch/branch.if.scope b/data/fixtures/scopes/php/branch/branch.if.scope new file mode 100644 index 0000000000..5ae6fa60ca --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.if.scope @@ -0,0 +1,11 @@ +------------< +1| if (true) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/branch/branch.switchCase.iteration.scope b/data/fixtures/scopes/php/branch/branch.switchCase.iteration.scope new file mode 100644 index 0000000000..db996238f9 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.switchCase.iteration.scope @@ -0,0 +1,8 @@ +-< +1| switch ($foo) { } diff --git a/data/fixtures/scopes/php/branch/branch.switchCase.scope b/data/fixtures/scopes/php/branch/branch.switchCase.scope new file mode 100644 index 0000000000..07b32abfe0 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.switchCase.scope @@ -0,0 +1,26 @@ +------- +2| case 0: +3| break; + --------------< + +[Removal] = 2:0-4:0 + >----------- +2| case 0: +3| break; +4| } + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| case 0: + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/branch/branch.switchCase2.scope b/data/fixtures/scopes/php/branch/branch.switchCase2.scope new file mode 100644 index 0000000000..c6b04681a8 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.switchCase2.scope @@ -0,0 +1,26 @@ +-------- +2| default: +3| break; + --------------< + +[Removal] = 2:0-4:0 + >------------ +2| default: +3| break; +4| } + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| default: + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/branch/branch.ternary.iteration.scope b/data/fixtures/scopes/php/branch/branch.ternary.iteration.scope new file mode 100644 index 0000000000..53e108ac1f --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.ternary.iteration.scope @@ -0,0 +1,8 @@ +------------< +1| true ? 0 : 1 diff --git a/data/fixtures/scopes/php/branch/branch.ternary.scope b/data/fixtures/scopes/php/branch/branch.ternary.scope new file mode 100644 index 0000000000..bfa6e05fd1 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.ternary.scope @@ -0,0 +1,38 @@ +-< +1| true ? 0 : 1 + +[#1 Removal] = 1:7-1:9 + >--< +1| true ? 0 : 1 + +[#1 Leading delimiter] = 1:6-1:7 + >-< +1| true ? 0 : 1 + +[#1 Trailing delimiter] = 1:8-1:9 + >-< +1| true ? 0 : 1 + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:11-1:12 + >-< +1| true ? 0 : 1 + +[#2 Removal] = 1:10-1:12 + >--< +1| true ? 0 : 1 + +[#2 Leading delimiter] = 1:10-1:11 + >-< +1| true ? 0 : 1 + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/branch/branch.try.iteration.scope b/data/fixtures/scopes/php/branch/branch.try.iteration.scope new file mode 100644 index 0000000000..9ff7147230 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.try.iteration.scope @@ -0,0 +1,13 @@ +------ +1| try {} +2| catch (Exception $e) {} +3| finally {} + ----------< diff --git a/data/fixtures/scopes/php/branch/branch.try.scope b/data/fixtures/scopes/php/branch/branch.try.scope new file mode 100644 index 0000000000..2041fc9174 --- /dev/null +++ b/data/fixtures/scopes/php/branch/branch.try.scope @@ -0,0 +1,46 @@ +------< +1| try {} + +[#1 Removal] = 1:0-2:0 + >------ +1| try {} +2| catch (Exception $e) {} + < + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:0-2:23 + >-----------------------< +2| catch (Exception $e) {} + +[#2 Removal] = 2:0-3:0 + >----------------------- +2| catch (Exception $e) {} +3| finally {} + < + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 3:0-3:10 + >----------< +3| finally {} + +[#3 Removal] = 2:23-3:10 + > +2| catch (Exception $e) {} +3| finally {} + ----------< + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/class.iteration.document.scope b/data/fixtures/scopes/php/class.iteration.document.scope new file mode 100644 index 0000000000..ac763c63c2 --- /dev/null +++ b/data/fixtures/scopes/php/class.iteration.document.scope @@ -0,0 +1,14 @@ + + +0| +1| ------------< +1| class Foo {} + +[Removal] = 0:5-1:12 + > +0| ----< +1| do {} while (true); + +[Domain] = 1:0-1:19 + >-------------------< +1| do {} while (true); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/condition/condition.for.scope b/data/fixtures/scopes/php/condition/condition.for.scope new file mode 100644 index 0000000000..31b46a0f1a --- /dev/null +++ b/data/fixtures/scopes/php/condition/condition.for.scope @@ -0,0 +1,21 @@ +----------< +1| for ($i = 0; $i < $size; $i++) {} + +[Removal] = 1:12-1:23 + >-----------< +1| for ($i = 0; $i < $size; $i++) {} + +[Leading delimiter] = 1:12-1:13 + >-< +1| for ($i = 0; $i < $size; $i++) {} + +[Domain] = 1:0-1:33 + >---------------------------------< +1| for ($i = 0; $i < $size; $i++) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/condition/condition.if.scope b/data/fixtures/scopes/php/condition/condition.if.scope new file mode 100644 index 0000000000..196bcaf9c6 --- /dev/null +++ b/data/fixtures/scopes/php/condition/condition.if.scope @@ -0,0 +1,31 @@ +----< +1| if (true) {} + +[#1 Domain] = 1:0-3:7 + >------------ +1| if (true) {} +2| else if (false) {} +3| else {} + -------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:9-2:14 + >-----< +2| else if (false) {} + +[#2 Domain] = 2:0-2:18 + >------------------< +2| else if (false) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/condition/condition.switchCase.iteration.scope b/data/fixtures/scopes/php/condition/condition.switchCase.iteration.scope new file mode 100644 index 0000000000..db996238f9 --- /dev/null +++ b/data/fixtures/scopes/php/condition/condition.switchCase.iteration.scope @@ -0,0 +1,8 @@ +-< +1| switch ($foo) { } diff --git a/data/fixtures/scopes/php/condition/condition.switchCase.scope b/data/fixtures/scopes/php/condition/condition.switchCase.scope new file mode 100644 index 0000000000..385845c9a3 --- /dev/null +++ b/data/fixtures/scopes/php/condition/condition.switchCase.scope @@ -0,0 +1,23 @@ +-< +2| case 0: break; + +[Removal] = 2:8-2:10 + >--< +2| case 0: break; + +[Leading delimiter] = 2:8-2:9 + >-< +2| case 0: break; + +[Domain] = 2:4-2:18 + >--------------< +2| case 0: break; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/condition/condition.ternary.scope b/data/fixtures/scopes/php/condition/condition.ternary.scope new file mode 100644 index 0000000000..55b2de65f4 --- /dev/null +++ b/data/fixtures/scopes/php/condition/condition.ternary.scope @@ -0,0 +1,21 @@ +----< +1| true ? 0 : 1 + +[Removal] = 1:0-1:5 + >-----< +1| true ? 0 : 1 + +[Trailing delimiter] = 1:4-1:5 + >-< +1| true ? 0 : 1 + +[Domain] = 1:0-1:12 + >------------< +1| true ? 0 : 1 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/condition/condition.while.scope b/data/fixtures/scopes/php/condition/condition.while.scope new file mode 100644 index 0000000000..4e1103ce27 --- /dev/null +++ b/data/fixtures/scopes/php/condition/condition.while.scope @@ -0,0 +1,14 @@ +----< +1| while (true) {} + +[Domain] = 1:0-1:15 + >---------------< +1| while (true) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCall/functionCall.chain.scope b/data/fixtures/scopes/php/functionCall/functionCall.chain.scope new file mode 100644 index 0000000000..377dcc7e65 --- /dev/null +++ b/data/fixtures/scopes/php/functionCall/functionCall.chain.scope @@ -0,0 +1,20 @@ +bar(); +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 1:0-1:5 + >-----< +1| foo()->bar(); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:0-1:12 + >------------< +1| foo()->bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCall/functionCall.constructor.scope b/data/fixtures/scopes/php/functionCall/functionCall.constructor.scope new file mode 100644 index 0000000000..fad3277d22 --- /dev/null +++ b/data/fixtures/scopes/php/functionCall/functionCall.constructor.scope @@ -0,0 +1,11 @@ +---------< +1| new Foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCall/functionCall.method.scope b/data/fixtures/scopes/php/functionCall/functionCall.method.scope new file mode 100644 index 0000000000..d9bca919a2 --- /dev/null +++ b/data/fixtures/scopes/php/functionCall/functionCall.method.scope @@ -0,0 +1,11 @@ +bar(); +--- + +[Content] = +[Removal] = +[Domain] = 1:0-1:11 + >-----------< +1| $foo->bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCall/functionCall.method2.scope b/data/fixtures/scopes/php/functionCall/functionCall.method2.scope new file mode 100644 index 0000000000..3bb6dcf906 --- /dev/null +++ b/data/fixtures/scopes/php/functionCall/functionCall.method2.scope @@ -0,0 +1,11 @@ +bar(); +--- + +[Content] = +[Removal] = +[Domain] = 1:0-1:12 + >------------< +1| $foo?->bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCall/functionCall.scope b/data/fixtures/scopes/php/functionCall/functionCall.scope new file mode 100644 index 0000000000..3d8f6efec0 --- /dev/null +++ b/data/fixtures/scopes/php/functionCall/functionCall.scope @@ -0,0 +1,11 @@ +-----< +1| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCallee/functionCallee.chain.scope b/data/fixtures/scopes/php/functionCallee/functionCallee.chain.scope new file mode 100644 index 0000000000..dd55efae14 --- /dev/null +++ b/data/fixtures/scopes/php/functionCallee/functionCallee.chain.scope @@ -0,0 +1,26 @@ +bar(); +--- + +[#1 Content] = +[#1 Removal] = 1:0-1:3 + >---< +1| foo()->bar(); + +[#1 Domain] = 1:0-1:5 + >-----< +1| foo()->bar(); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:0-1:10 + >----------< +1| foo()->bar(); + +[#2 Domain] = 1:0-1:12 + >------------< +1| foo()->bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCallee/functionCallee.constructor.scope b/data/fixtures/scopes/php/functionCallee/functionCallee.constructor.scope new file mode 100644 index 0000000000..71e6291354 --- /dev/null +++ b/data/fixtures/scopes/php/functionCallee/functionCallee.constructor.scope @@ -0,0 +1,14 @@ +-------< +1| new Foo(); + +[Domain] = 1:0-1:9 + >---------< +1| new Foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCallee/functionCallee.method.scope b/data/fixtures/scopes/php/functionCallee/functionCallee.method.scope new file mode 100644 index 0000000000..312f1b5313 --- /dev/null +++ b/data/fixtures/scopes/php/functionCallee/functionCallee.method.scope @@ -0,0 +1,14 @@ +bar(); +--- + +[Content] = +[Removal] = 1:0-1:9 + >---------< +1| $foo->bar(); + +[Domain] = 1:0-1:11 + >-----------< +1| $foo->bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCallee/functionCallee.method2.scope b/data/fixtures/scopes/php/functionCallee/functionCallee.method2.scope new file mode 100644 index 0000000000..550dd1557d --- /dev/null +++ b/data/fixtures/scopes/php/functionCallee/functionCallee.method2.scope @@ -0,0 +1,14 @@ +bar(); +--- + +[Content] = +[Removal] = 1:0-1:10 + >----------< +1| $foo?->bar(); + +[Domain] = 1:0-1:12 + >------------< +1| $foo?->bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/functionCallee/functionCallee.scope b/data/fixtures/scopes/php/functionCallee/functionCallee.scope new file mode 100644 index 0000000000..0f3018b578 --- /dev/null +++ b/data/fixtures/scopes/php/functionCallee/functionCallee.scope @@ -0,0 +1,14 @@ +---< +1| foo(); + +[Domain] = 1:0-1:5 + >-----< +1| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/ifStatement.scope b/data/fixtures/scopes/php/ifStatement.scope new file mode 100644 index 0000000000..7cff4f10ee --- /dev/null +++ b/data/fixtures/scopes/php/ifStatement.scope @@ -0,0 +1,23 @@ +------------ +1| if (true) {} +2| else if (false) {} +3| else {} + -------< + +[Removal] = 0:5-3:7 + > +0| -< +1| class Foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.constructor.scope b/data/fixtures/scopes/php/interior/interior.constructor.scope new file mode 100644 index 0000000000..17f0ef4b0e --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.constructor.scope @@ -0,0 +1,28 @@ +--------------------------< +2| function __construct() { } + +[#1 Removal] = +[#1 Domain] = 1:11-3:0 + > +1| class Foo { +2| function __construct() { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 2:28-2:29 + >-< +2| function __construct() { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.doWhile.scope b/data/fixtures/scopes/php/interior/interior.doWhile.scope new file mode 100644 index 0000000000..f474dd202c --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.doWhile.scope @@ -0,0 +1,11 @@ +-< +1| do { } while (true); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.enum.scope b/data/fixtures/scopes/php/interior/interior.enum.scope new file mode 100644 index 0000000000..73130b1772 --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.enum.scope @@ -0,0 +1,11 @@ +-< +1| enum Foo: int { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.for.scope b/data/fixtures/scopes/php/interior/interior.for.scope new file mode 100644 index 0000000000..d6b08144c3 --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.for.scope @@ -0,0 +1,11 @@ +-< +1| for ($i = 0; $i < $size; ++$i) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.foreach.scope b/data/fixtures/scopes/php/interior/interior.foreach.scope new file mode 100644 index 0000000000..16387c8b15 --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.foreach.scope @@ -0,0 +1,11 @@ +-< +1| foreach ($values as $v) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.function.scope b/data/fixtures/scopes/php/interior/interior.function.scope new file mode 100644 index 0000000000..a1ab073b17 --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.function.scope @@ -0,0 +1,11 @@ +-< +1| function foo() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.if.scope b/data/fixtures/scopes/php/interior/interior.if.scope new file mode 100644 index 0000000000..1954c0dbae --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.if.scope @@ -0,0 +1,31 @@ +-< +1| if (true) { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 2:17-2:18 + >-< +2| else if (false) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 3:6-3:7 + >-< +3| else { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.interface.scope b/data/fixtures/scopes/php/interior/interior.interface.scope new file mode 100644 index 0000000000..daec607460 --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.interface.scope @@ -0,0 +1,11 @@ +-< +1| interface Foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.lambda.scope b/data/fixtures/scopes/php/interior/interior.lambda.scope new file mode 100644 index 0000000000..910115d565 --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.lambda.scope @@ -0,0 +1,11 @@ +-< +1| function() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.method.scope b/data/fixtures/scopes/php/interior/interior.method.scope new file mode 100644 index 0000000000..017786fd5f --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.method.scope @@ -0,0 +1,28 @@ +------------------< +2| function bar() { } + +[#1 Removal] = +[#1 Domain] = 1:11-3:0 + > +1| class Foo { +2| function bar() { } +3| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 2:20-2:21 + >-< +2| function bar() { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.namespace.scope b/data/fixtures/scopes/php/interior/interior.namespace.scope new file mode 100644 index 0000000000..dc7c24e36a --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.namespace.scope @@ -0,0 +1,11 @@ +-< +1| namespace Foo\Bar { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.switch.scope b/data/fixtures/scopes/php/interior/interior.switch.scope new file mode 100644 index 0000000000..f1a43658ad --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.switch.scope @@ -0,0 +1,11 @@ +-< +1| switch ($foo) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.switchCase.scope b/data/fixtures/scopes/php/interior/interior.switchCase.scope new file mode 100644 index 0000000000..404fe2ad9c --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.switchCase.scope @@ -0,0 +1,69 @@ +------- +2| case 0: +3| bar; +4| break; +5| default: +6| bar; +7| break; + --------------< + +[#1 Removal] = +[#1 Domain] = 1:15-8:0 + > +1| switch ($foo) { +2| case 0: +3| bar; +4| break; +5| default: +6| bar; +7| break; +8| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 3:8-4:14 + >---- +3| bar; +4| break; + --------------< + +[#2 Removal] = +[#2 Domain] = 2:11-4:14 + > +2| case 0: +3| bar; +4| break; + --------------< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 6:8-7:14 + >---- +6| bar; +7| break; + --------------< + +[#3 Removal] = +[#3 Domain] = 5:12-7:14 + > +5| default: +6| bar; +7| break; + --------------< + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.switchCase2.scope b/data/fixtures/scopes/php/interior/interior.switchCase2.scope new file mode 100644 index 0000000000..f2a518ba6e --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.switchCase2.scope @@ -0,0 +1,41 @@ +----------- +2| case 0: { } +3| default: { } + ----------------< + +[#1 Removal] = +[#1 Domain] = 1:15-4:0 + > +1| switch ($foo) { +2| case 0: { } +3| default: { } +4| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 2:13-2:14 + >-< +2| case 0: { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 3:14-3:15 + >-< +3| default: { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.try.scope b/data/fixtures/scopes/php/interior/interior.try.scope new file mode 100644 index 0000000000..4ba0c6ce4d --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.try.scope @@ -0,0 +1,31 @@ +-< +1| try { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 2:22-2:23 + >-< +2| catch (Exception $e) { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 3:9-3:10 + >-< +3| finally { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/interior/interior.while.scope b/data/fixtures/scopes/php/interior/interior.while.scope new file mode 100644 index 0000000000..8a892e955d --- /dev/null +++ b/data/fixtures/scopes/php/interior/interior.while.scope @@ -0,0 +1,11 @@ +-< +1| while (true) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/key/key.mapPair.iteration.scope b/data/fixtures/scopes/php/key/key.mapPair.iteration.scope new file mode 100644 index 0000000000..22acf5bb40 --- /dev/null +++ b/data/fixtures/scopes/php/key/key.mapPair.iteration.scope @@ -0,0 +1,8 @@ + 0, "bbb" => 1] +--- + +[Content] = +[Domain] = 1:1-1:23 + >----------------------< +1| ["aaa" => 0, "bbb" => 1] diff --git a/data/fixtures/scopes/php/list.scope b/data/fixtures/scopes/php/list.scope new file mode 100644 index 0000000000..b475672847 --- /dev/null +++ b/data/fixtures/scopes/php/list.scope @@ -0,0 +1,16 @@ +----------< +1| [aaa, bbb] + +[Removal] = 0:5-1:10 + > +0| 0, "bbb" => 1] +--- + +[Content] = +[Domain] = 1:0-1:24 + >------------------------< +1| ["aaa" => 0, "bbb" => 1] + +[Removal] = 0:5-1:24 + > +0| 0, "bbb" => 1] + ------------------------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.argument.actual.iteration.scope b/data/fixtures/scopes/php/name/name.argument.actual.iteration.scope new file mode 100644 index 0000000000..611503e6d4 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.actual.iteration.scope @@ -0,0 +1,16 @@ +----- +0| --------------< +1| foo(aaa: 0, bbb: 1); diff --git a/data/fixtures/scopes/php/name/name.argument.actual.scope b/data/fixtures/scopes/php/name/name.argument.actual.scope new file mode 100644 index 0000000000..a71ab38090 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.actual.scope @@ -0,0 +1,40 @@ +---< +1| foo(aaa: 0, bbb: 1); + +[#1 Removal] = 1:4-1:9 + >-----< +1| foo(aaa: 0, bbb: 1); + +[#1 Trailing delimiter] = 1:7-1:9 + >--< +1| foo(aaa: 0, bbb: 1); + +[#1 Domain] = 1:4-1:10 + >------< +1| foo(aaa: 0, bbb: 1); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:12-1:15 + >---< +1| foo(aaa: 0, bbb: 1); + +[#2 Removal] = 1:12-1:17 + >-----< +1| foo(aaa: 0, bbb: 1); + +[#2 Trailing delimiter] = 1:15-1:17 + >--< +1| foo(aaa: 0, bbb: 1); + +[#2 Domain] = 1:12-1:18 + >------< +1| foo(aaa: 0, bbb: 1); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/php/name/name.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..8ff0a3da3f --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.formal.constructor.iteration.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| function __construct($aaa, $bbb = 0) {} +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:25-2:39 + >--------------< +2| function __construct($aaa, $bbb = 0) {} diff --git a/data/fixtures/scopes/php/name/name.argument.formal.constructor.scope b/data/fixtures/scopes/php/name/name.argument.formal.constructor.scope new file mode 100644 index 0000000000..32beb6003c --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.formal.constructor.scope @@ -0,0 +1,78 @@ +---< +1| class Foo { + +[#1 Removal] = 1:6-1:10 + >----< +1| class Foo { + +[#1 Leading delimiter] = 1:5-1:6 + >-< +1| class Foo { + +[#1 Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo { + +[#1 Domain] = 1:0-3:1 + >----------- +1| class Foo { +2| function __construct($aaa, $bbb = 0) {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:13-2:24 + >-----------< +2| function __construct($aaa, $bbb = 0) {} + +[#2 Leading delimiter] = 2:12-2:13 + >-< +2| function __construct($aaa, $bbb = 0) {} + +[#2 Domain] = 2:4-2:43 + >---------------------------------------< +2| function __construct($aaa, $bbb = 0) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:25-2:29 + >----< +2| function __construct($aaa, $bbb = 0) {} + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 2:31-2:35 + >----< +2| function __construct($aaa, $bbb = 0) {} + +[#4 Removal] = 2:31-2:36 + >-----< +2| function __construct($aaa, $bbb = 0) {} + +[#4 Leading delimiter] = 2:30-2:31 + >-< +2| function __construct($aaa, $bbb = 0) {} + +[#4 Trailing delimiter] = 2:35-2:36 + >-< +2| function __construct($aaa, $bbb = 0) {} + +[#4 Domain] = 2:31-2:39 + >--------< +2| function __construct($aaa, $bbb = 0) {} + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/php/name/name.argument.formal.iteration.scope index 49c858ecaf..8d15e705ba 100644 --- a/data/fixtures/scopes/php/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/php/name/name.argument.formal.iteration.scope @@ -2,7 +2,15 @@ function foo(int $aaa, int $bbb) {} --- -[Content] = -[Domain] = 1:13-1:31 +[#1 Content] = +[#1 Domain] = 0:0-1:35 + >----- +0| ------------------< 1| function foo(int $aaa, int $bbb) {} diff --git a/data/fixtures/scopes/php/name/name.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/php/name/name.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..01edba0cb6 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.formal.lambda.iteration.scope @@ -0,0 +1,16 @@ +----- +0| --------------< +1| function($aaa, $bbb = 0) {}; diff --git a/data/fixtures/scopes/php/name/name.argument.formal.lambda.scope b/data/fixtures/scopes/php/name/name.argument.formal.lambda.scope new file mode 100644 index 0000000000..09f7cc851f --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.formal.lambda.scope @@ -0,0 +1,34 @@ +----< +1| function($aaa, $bbb = 0) {}; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:15-1:19 + >----< +1| function($aaa, $bbb = 0) {}; + +[#2 Removal] = 1:15-1:20 + >-----< +1| function($aaa, $bbb = 0) {}; + +[#2 Leading delimiter] = 1:14-1:15 + >-< +1| function($aaa, $bbb = 0) {}; + +[#2 Trailing delimiter] = 1:19-1:20 + >-< +1| function($aaa, $bbb = 0) {}; + +[#2 Domain] = 1:15-1:23 + >--------< +1| function($aaa, $bbb = 0) {}; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/php/name/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..91880ef713 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.formal.method.iteration.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| function bar($aaa, $bbb = 0) {} +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:17-2:31 + >--------------< +2| function bar($aaa, $bbb = 0) {} diff --git a/data/fixtures/scopes/php/name/name.argument.formal.method.scope b/data/fixtures/scopes/php/name/name.argument.formal.method.scope new file mode 100644 index 0000000000..87ad34461e --- /dev/null +++ b/data/fixtures/scopes/php/name/name.argument.formal.method.scope @@ -0,0 +1,78 @@ +---< +1| class Foo { + +[#1 Removal] = 1:6-1:10 + >----< +1| class Foo { + +[#1 Leading delimiter] = 1:5-1:6 + >-< +1| class Foo { + +[#1 Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo { + +[#1 Domain] = 1:0-3:1 + >----------- +1| class Foo { +2| function bar($aaa, $bbb = 0) {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:13-2:16 + >---< +2| function bar($aaa, $bbb = 0) {} + +[#2 Leading delimiter] = 2:12-2:13 + >-< +2| function bar($aaa, $bbb = 0) {} + +[#2 Domain] = 2:4-2:35 + >-------------------------------< +2| function bar($aaa, $bbb = 0) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:17-2:21 + >----< +2| function bar($aaa, $bbb = 0) {} + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 2:23-2:27 + >----< +2| function bar($aaa, $bbb = 0) {} + +[#4 Removal] = 2:23-2:28 + >-----< +2| function bar($aaa, $bbb = 0) {} + +[#4 Leading delimiter] = 2:22-2:23 + >-< +2| function bar($aaa, $bbb = 0) {} + +[#4 Trailing delimiter] = 2:27-2:28 + >-< +2| function bar($aaa, $bbb = 0) {} + +[#4 Domain] = 2:23-2:31 + >--------< +2| function bar($aaa, $bbb = 0) {} + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.assignment.compound.scope b/data/fixtures/scopes/php/name/name.assignment.compound.scope new file mode 100644 index 0000000000..944388ef15 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.assignment.compound.scope @@ -0,0 +1,21 @@ +----< +1| $foo += 0; + +[Removal] = 1:0-1:8 + >--------< +1| $foo += 0; + +[Trailing delimiter] = 1:4-1:8 + >----< +1| $foo += 0; + +[Domain] = 1:0-1:10 + >----------< +1| $foo += 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.class.scope b/data/fixtures/scopes/php/name/name.class.scope new file mode 100644 index 0000000000..9e8d0416ea --- /dev/null +++ b/data/fixtures/scopes/php/name/name.class.scope @@ -0,0 +1,25 @@ +---< +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] = 1:0-1:12 + >------------< +1| class Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.constructor.scope b/data/fixtures/scopes/php/name/name.constructor.scope new file mode 100644 index 0000000000..015e884f5c --- /dev/null +++ b/data/fixtures/scopes/php/name/name.constructor.scope @@ -0,0 +1,46 @@ +---< +1| class Foo { + +[#1 Removal] = 1:6-1:10 + >----< +1| class Foo { + +[#1 Leading delimiter] = 1:5-1:6 + >-< +1| class Foo { + +[#1 Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo { + +[#1 Domain] = 1:0-3:1 + >----------- +1| class Foo { +2| function __construct() {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:13-2:24 + >-----------< +2| function __construct() {} + +[#2 Leading delimiter] = 2:12-2:13 + >-< +2| function __construct() {} + +[#2 Domain] = 2:4-2:29 + >-------------------------< +2| function __construct() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.enum.scope b/data/fixtures/scopes/php/name/name.enum.scope new file mode 100644 index 0000000000..9a163eb1f9 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.enum.scope @@ -0,0 +1,25 @@ +---< +1| enum Foo {} + +[Removal] = 1:5-1:9 + >----< +1| enum Foo {} + +[Leading delimiter] = 1:4-1:5 + >-< +1| enum Foo {} + +[Trailing delimiter] = 1:8-1:9 + >-< +1| enum Foo {} + +[Domain] = 1:0-1:11 + >-----------< +1| enum Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.field.enum.scope b/data/fixtures/scopes/php/name/name.field.enum.scope new file mode 100644 index 0000000000..4703e20cc0 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.field.enum.scope @@ -0,0 +1,49 @@ +---< +1| enum Foo: int { + +[#1 Removal] = 1:4-1:8 + >----< +1| enum Foo: int { + +[#1 Leading delimiter] = 1:4-1:5 + >-< +1| enum Foo: int { + +[#1 Domain] = 1:0-3:1 + >--------------- +1| enum Foo: int { +2| case Bar = 1; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:9-2:12 + >---< +2| case Bar = 1; + +[#2 Removal] = 2:4-2:15 + >-----------< +2| case Bar = 1; + +[#2 Leading delimiter] = 2:8-2:9 + >-< +2| case Bar = 1; + +[#2 Trailing delimiter] = 2:12-2:13 + >-< +2| case Bar = 1; + +[#2 Domain] = 2:4-2:17 + >-------------< +2| case Bar = 1; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.field.interface.scope b/data/fixtures/scopes/php/name/name.field.interface.scope new file mode 100644 index 0000000000..d8d23a8f93 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.field.interface.scope @@ -0,0 +1,53 @@ +---< +1| interface Foo { + +[#1 Removal] = 1:10-1:14 + >----< +1| interface Foo { + +[#1 Leading delimiter] = 1:9-1:10 + >-< +1| interface Foo { + +[#1 Trailing delimiter] = 1:13-1:14 + >-< +1| interface Foo { + +[#1 Domain] = 1:0-3:1 + >--------------- +1| interface Foo { +2| public const bar = 1; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:17-2:20 + >---< +2| public const bar = 1; + +[#2 Removal] = 2:4-2:23 + >-------------------< +2| public const bar = 1; + +[#2 Leading delimiter] = 2:16-2:17 + >-< +2| public const bar = 1; + +[#2 Trailing delimiter] = 2:20-2:21 + >-< +2| public const bar = 1; + +[#2 Domain] = 2:4-2:25 + >---------------------< +2| public const bar = 1; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.foreach.scope b/data/fixtures/scopes/php/name/name.foreach.scope new file mode 100644 index 0000000000..42e7d4227f --- /dev/null +++ b/data/fixtures/scopes/php/name/name.foreach.scope @@ -0,0 +1,21 @@ +--< +1| foreach ($values as $v) {} + +[Removal] = 1:19-1:22 + >---< +1| foreach ($values as $v) {} + +[Leading delimiter] = 1:19-1:20 + >-< +1| foreach ($values as $v) {} + +[Domain] = 1:0-1:26 + >--------------------------< +1| foreach ($values as $v) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.function.scope b/data/fixtures/scopes/php/name/name.function.scope new file mode 100644 index 0000000000..a20e5c20bd --- /dev/null +++ b/data/fixtures/scopes/php/name/name.function.scope @@ -0,0 +1,18 @@ +---< +1| function foo() {} + +[Leading delimiter] = 1:8-1:9 + >-< +1| function foo() {} + +[Domain] = 1:0-1:17 + >-----------------< +1| function foo() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.interface.scope b/data/fixtures/scopes/php/name/name.interface.scope new file mode 100644 index 0000000000..9b11f0aaef --- /dev/null +++ b/data/fixtures/scopes/php/name/name.interface.scope @@ -0,0 +1,25 @@ +---< +1| interface Foo {} + +[Removal] = 1:10-1:14 + >----< +1| interface Foo {} + +[Leading delimiter] = 1:9-1:10 + >-< +1| interface Foo {} + +[Trailing delimiter] = 1:13-1:14 + >-< +1| interface Foo {} + +[Domain] = 1:0-1:16 + >----------------< +1| interface Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.iteration.block.scope b/data/fixtures/scopes/php/name/name.iteration.block.scope new file mode 100644 index 0000000000..39725a0bb0 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.block.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| function bar() { } +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:20-2:21 + >-< +2| function bar() { } diff --git a/data/fixtures/scopes/php/name/name.iteration.block2.scope b/data/fixtures/scopes/php/name/name.iteration.block2.scope new file mode 100644 index 0000000000..5dfac32c5e --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.block2.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| function foo() { } diff --git a/data/fixtures/scopes/php/name/name.iteration.block3.scope b/data/fixtures/scopes/php/name/name.iteration.block3.scope new file mode 100644 index 0000000000..0393267d7d --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.block3.scope @@ -0,0 +1,32 @@ +----- +0| -< +1| if (true) { } + + +[#3 Content] = +[#3 Domain] = 2:17-2:18 + >-< +2| else if (false) { } + + +[#4 Content] = +[#4 Domain] = 3:6-3:7 + >-< +3| else { } diff --git a/data/fixtures/scopes/php/name/name.iteration.block4.scope b/data/fixtures/scopes/php/name/name.iteration.block4.scope new file mode 100644 index 0000000000..cc0bcdb62e --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.block4.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| while (true) { } diff --git a/data/fixtures/scopes/php/name/name.iteration.class.scope b/data/fixtures/scopes/php/name/name.iteration.class.scope new file mode 100644 index 0000000000..98de453bf1 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.class.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| class Foo { } diff --git a/data/fixtures/scopes/php/name/name.iteration.document.scope b/data/fixtures/scopes/php/name/name.iteration.document.scope new file mode 100644 index 0000000000..1b5039a3ff --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.document.scope @@ -0,0 +1,14 @@ + + +0| +1| ----- +0| -< +1| enum Foo { } diff --git a/data/fixtures/scopes/php/name/name.iteration.interface.scope b/data/fixtures/scopes/php/name/name.iteration.interface.scope new file mode 100644 index 0000000000..c4a2eaf7ba --- /dev/null +++ b/data/fixtures/scopes/php/name/name.iteration.interface.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| interface Foo { } diff --git a/data/fixtures/scopes/php/name/name.method.scope b/data/fixtures/scopes/php/name/name.method.scope new file mode 100644 index 0000000000..87da0c9e58 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.method.scope @@ -0,0 +1,46 @@ +---< +1| class Foo { + +[#1 Removal] = 1:6-1:10 + >----< +1| class Foo { + +[#1 Leading delimiter] = 1:5-1:6 + >-< +1| class Foo { + +[#1 Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo { + +[#1 Domain] = 1:0-3:1 + >----------- +1| class Foo { +2| function bar() {} +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:13-2:16 + >---< +2| function bar() {} + +[#2 Leading delimiter] = 2:12-2:13 + >-< +2| function bar() {} + +[#2 Domain] = 2:4-2:21 + >-----------------< +2| function bar() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name/name.namespace.scope b/data/fixtures/scopes/php/name/name.namespace.scope new file mode 100644 index 0000000000..9939a73102 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.namespace.scope @@ -0,0 +1,25 @@ +-------< +1| namespace Foo\Bar {} + +[Removal] = 1:10-1:18 + >--------< +1| namespace Foo\Bar {} + +[Leading delimiter] = 1:9-1:10 + >-< +1| namespace Foo\Bar {} + +[Trailing delimiter] = 1:17-1:18 + >-< +1| namespace Foo\Bar {} + +[Domain] = 1:0-1:20 + >--------------------< +1| namespace Foo\Bar {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/namedFunction.constructor.scope b/data/fixtures/scopes/php/namedFunction.constructor.scope new file mode 100644 index 0000000000..a101e2e071 --- /dev/null +++ b/data/fixtures/scopes/php/namedFunction.constructor.scope @@ -0,0 +1,22 @@ +-------------------------< +2| function __construct() {} + +[Removal] = 2:0-3:0 + >----------------------------- +2| function __construct() {} +3| } + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| function __construct() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/php/namedFunction.iteration.class.scope b/data/fixtures/scopes/php/namedFunction.iteration.class.scope new file mode 100644 index 0000000000..98de453bf1 --- /dev/null +++ b/data/fixtures/scopes/php/namedFunction.iteration.class.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| class Foo { } diff --git a/data/fixtures/scopes/php/namedFunction.iteration.document.scope b/data/fixtures/scopes/php/namedFunction.iteration.document.scope new file mode 100644 index 0000000000..a82b6dc83e --- /dev/null +++ b/data/fixtures/scopes/php/namedFunction.iteration.document.scope @@ -0,0 +1,14 @@ + + +0| +1| -----------------< +2| function bar() {} + +[Removal] = 2:0-3:0 + >--------------------- +2| function bar() {} +3| } + < + +[Leading delimiter] = 2:0-2:4 + >----< +2| function bar() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/php/namedFunction.scope b/data/fixtures/scopes/php/namedFunction.scope new file mode 100644 index 0000000000..a82d4e0ad7 --- /dev/null +++ b/data/fixtures/scopes/php/namedFunction.scope @@ -0,0 +1,16 @@ +-----------------< +1| function foo() {} + +[Removal] = 0:5-1:17 + > +0| ----------< +1| $foo += 0; + +[Removal] = 0:5-1:10 + > +0| ---------< +1| $foo = 0; + +[Removal] = 0:5-1:9 + > +0| -------------- +1| while (true) { +2| break; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ------< +2| break; + +[#2 Removal] = 2:0-3:0 + >---------- +2| break; +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| break; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.class.scope b/data/fixtures/scopes/php/statement/statement.class.scope new file mode 100644 index 0000000000..3705617a44 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.class.scope @@ -0,0 +1,16 @@ +------------< +1| class Foo {} + +[Removal] = 0:5-1:12 + > +0| ----------- +1| class Foo { +2| function __construct() {} +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| -------------------------< +2| function __construct() {} + +[#2 Removal] = 2:0-3:0 + >----------------------------- +2| function __construct() {} +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| function __construct() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.continue.scope b/data/fixtures/scopes/php/statement/statement.continue.scope new file mode 100644 index 0000000000..539eb93876 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.continue.scope @@ -0,0 +1,41 @@ +-------------- +1| while (true) { +2| continue; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---------< +2| continue; + +[#2 Removal] = 2:0-3:0 + >------------- +2| continue; +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| continue; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.doWhile.scope b/data/fixtures/scopes/php/statement/statement.doWhile.scope new file mode 100644 index 0000000000..ab0d105f20 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.doWhile.scope @@ -0,0 +1,16 @@ +-------------------< +1| do {} while (true); + +[Removal] = 0:5-1:19 + > +0| -----------< +1| enum Foo {} + +[Removal] = 0:5-1:11 + > +0| ----------- +1| class Foo { +2| public $bar; +3| public $baz = 0; +4| } + -< + +[#1 Removal] = 0:5-4:1 + > +0| ------------< +2| public $bar; + +[#2 Removal] = 2:0-3:0 + >---------------- +2| public $bar; +3| public $baz = 0; + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| public $bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 3:4-3:20 + >----------------< +3| public $baz = 0; + +[#3 Removal] = 3:0-4:0 + >-------------------- +3| public $baz = 0; +4| } + < + +[#3 Leading delimiter] = 3:0-3:4 + >----< +3| public $baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.field.interface.scope b/data/fixtures/scopes/php/statement/statement.field.interface.scope new file mode 100644 index 0000000000..7136723c1c --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.field.interface.scope @@ -0,0 +1,41 @@ +--------------- +1| interface Foo { +2| public const bar = 0; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---------------------< +2| public const bar = 0; + +[#2 Removal] = 2:0-3:0 + >------------------------- +2| public const bar = 0; +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| public const bar = 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.field.interface2.scope b/data/fixtures/scopes/php/statement/statement.field.interface2.scope new file mode 100644 index 0000000000..3daf6e24e5 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.field.interface2.scope @@ -0,0 +1,41 @@ +--------------- +1| interface Foo { +2| public const int bar = 0; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| -------------------------< +2| public const int bar = 0; + +[#2 Removal] = 2:0-3:0 + >----------------------------- +2| public const int bar = 0; +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| public const int bar = 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.for.scope b/data/fixtures/scopes/php/statement/statement.for.scope new file mode 100644 index 0000000000..0aa01989b7 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.for.scope @@ -0,0 +1,16 @@ +---------------------------------< +1| for ($i = 0; $i < $size; $i++) {} + +[Removal] = 0:5-1:33 + > +0| --------------------------< +1| foreach ($values as $v) {} + +[Removal] = 0:5-1:26 + > +0| -----------------< +1| function foo() {} + +[Removal] = 0:5-1:17 + > +0| ------< +1| foo(); + +[Removal] = 0:5-1:6 + > +0| ------------ +1| if (true) {} +2| else if (false) {} +3| else {} + -------< + +[Removal] = 0:5-3:7 + > +0| ------------< +1| use foo\bar; + +[Removal] = 0:5-1:12 + > +0| ----------------< +1| interface Foo {} + +[Removal] = 0:5-1:16 + > +0| ----- +0| +1| class Foo { +2| function bar() { } +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:20-2:21 + >-< +2| function bar() { } diff --git a/data/fixtures/scopes/php/statement/statement.iteration.block2.scope b/data/fixtures/scopes/php/statement/statement.iteration.block2.scope new file mode 100644 index 0000000000..5dfac32c5e --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.iteration.block2.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| function foo() { } diff --git a/data/fixtures/scopes/php/statement/statement.iteration.block3.scope b/data/fixtures/scopes/php/statement/statement.iteration.block3.scope new file mode 100644 index 0000000000..0393267d7d --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.iteration.block3.scope @@ -0,0 +1,32 @@ +----- +0| -< +1| if (true) { } + + +[#3 Content] = +[#3 Domain] = 2:17-2:18 + >-< +2| else if (false) { } + + +[#4 Content] = +[#4 Domain] = 3:6-3:7 + >-< +3| else { } diff --git a/data/fixtures/scopes/php/statement/statement.iteration.block4.scope b/data/fixtures/scopes/php/statement/statement.iteration.block4.scope new file mode 100644 index 0000000000..cc0bcdb62e --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.iteration.block4.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| while (true) { } diff --git a/data/fixtures/scopes/php/statement/statement.iteration.class.scope b/data/fixtures/scopes/php/statement/statement.iteration.class.scope new file mode 100644 index 0000000000..98de453bf1 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.iteration.class.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| class Foo { } diff --git a/data/fixtures/scopes/php/statement/statement.iteration.document.scope b/data/fixtures/scopes/php/statement/statement.iteration.document.scope new file mode 100644 index 0000000000..1b5039a3ff --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.iteration.document.scope @@ -0,0 +1,14 @@ + + +0| +1| ----- +0| -< +1| interface Foo { } diff --git a/data/fixtures/scopes/php/statement/statement.method.scope b/data/fixtures/scopes/php/statement/statement.method.scope new file mode 100644 index 0000000000..3d4d11df87 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.method.scope @@ -0,0 +1,41 @@ +----------- +1| class Foo { +2| function bar() {} +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| -----------------< +2| function bar() {} + +[#2 Removal] = 2:0-3:0 + >--------------------- +2| function bar() {} +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| function bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.namespace.scope b/data/fixtures/scopes/php/statement/statement.namespace.scope new file mode 100644 index 0000000000..bff35a99c3 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.namespace.scope @@ -0,0 +1,16 @@ +--------------------< +1| namespace Foo\Bar {} + +[Removal] = 0:5-1:20 + > +0| ---------------- +1| function foo() { +2| return 0; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---------< +2| return 0; + +[#2 Removal] = 2:0-3:0 + >------------- +2| return 0; +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| return 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/statement/statement.switch.scope b/data/fixtures/scopes/php/statement/statement.switch.scope new file mode 100644 index 0000000000..95bcbe5c72 --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.switch.scope @@ -0,0 +1,16 @@ +----------------< +1| switch ($foo) {} + +[Removal] = 0:5-1:16 + > +0| -----------< +1| throw $foo; + +[Removal] = 0:5-1:11 + > +0| ------ +1| try {} +2| catch (Exception $e) {} +3| finally {} + ----------< + +[Removal] = 0:5-3:10 + > +0| -------< +1| $foo++; + +[Removal] = 0:5-1:7 + > +0| ---------< +1| $foo = 0; + +[Removal] = 0:5-1:9 + > +0| ---------------< +1| while (true) {} + +[Removal] = 0:5-1:15 + > +0| --------< +1| yield 0; + +[Removal] = 0:5-1:8 + > +0| ------ +1| "Hello +2| world" + ------< + +[Removal] = 0:5-2:6 + > +0| -----------------< +1| /* Hello world */ + +[Removal] = 0:5-1:17 + > +0| --------------< +1| // hello world + +[Removal] = 0:5-1:14 + > +0| ----- +1| "hello +2| world" + -----< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/php/type/type.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..1d0263565c --- /dev/null +++ b/data/fixtures/scopes/php/type/type.argument.formal.constructor.iteration.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| public function __construct(int $aaa, int $bbb) {} +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:32-2:50 + >------------------< +2| public function __construct(int $aaa, int $bbb) {} diff --git a/data/fixtures/scopes/php/type/type.argument.formal.constructor.scope b/data/fixtures/scopes/php/type/type.argument.formal.constructor.scope new file mode 100644 index 0000000000..05d067d1a1 --- /dev/null +++ b/data/fixtures/scopes/php/type/type.argument.formal.constructor.scope @@ -0,0 +1,65 @@ +----------- +1| class Foo { +2| public function __construct(int $aaa, int $bbb) {} +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---< +2| public function __construct(int $aaa, int $bbb) {} + +[#2 Removal] = 2:32-2:36 + >----< +2| public function __construct(int $aaa, int $bbb) {} + +[#2 Trailing delimiter] = 2:35-2:36 + >-< +2| public function __construct(int $aaa, int $bbb) {} + +[#2 Domain] = 2:32-2:40 + >--------< +2| public function __construct(int $aaa, int $bbb) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:42-2:45 + >---< +2| public function __construct(int $aaa, int $bbb) {} + +[#3 Removal] = 2:42-2:46 + >----< +2| public function __construct(int $aaa, int $bbb) {} + +[#3 Leading delimiter] = 2:41-2:42 + >-< +2| public function __construct(int $aaa, int $bbb) {} + +[#3 Trailing delimiter] = 2:45-2:46 + >-< +2| public function __construct(int $aaa, int $bbb) {} + +[#3 Domain] = 2:42-2:50 + >--------< +2| public function __construct(int $aaa, int $bbb) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.argument.formal.iteration.scope b/data/fixtures/scopes/php/type/type.argument.formal.iteration.scope index 49c858ecaf..8d15e705ba 100644 --- a/data/fixtures/scopes/php/type/type.argument.formal.iteration.scope +++ b/data/fixtures/scopes/php/type/type.argument.formal.iteration.scope @@ -2,7 +2,15 @@ function foo(int $aaa, int $bbb) {} --- -[Content] = -[Domain] = 1:13-1:31 +[#1 Content] = +[#1 Domain] = 0:0-1:35 + >----- +0| ------------------< 1| function foo(int $aaa, int $bbb) {} diff --git a/data/fixtures/scopes/php/type/type.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/php/type/type.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..0d7e55e69c --- /dev/null +++ b/data/fixtures/scopes/php/type/type.argument.formal.lambda.iteration.scope @@ -0,0 +1,16 @@ + 0; +--- + +[#1 Content] = +[#1 Domain] = 0:0-1:28 + >----- +0| 0; + ----------------------------< + + +[#2 Content] = +[#2 Domain] = 1:3-1:21 + >------------------< +1| fn(int $aaa, int $bbb) => 0; diff --git a/data/fixtures/scopes/php/type/type.argument.formal.lambda.scope b/data/fixtures/scopes/php/type/type.argument.formal.lambda.scope new file mode 100644 index 0000000000..2d65e4539a --- /dev/null +++ b/data/fixtures/scopes/php/type/type.argument.formal.lambda.scope @@ -0,0 +1,44 @@ + 0; +--- + +[#1 Content] = 1:3-1:6 + >---< +1| fn(int $aaa, int $bbb) => 0; + +[#1 Removal] = 1:3-1:7 + >----< +1| fn(int $aaa, int $bbb) => 0; + +[#1 Trailing delimiter] = 1:6-1:7 + >-< +1| fn(int $aaa, int $bbb) => 0; + +[#1 Domain] = 1:3-1:11 + >--------< +1| fn(int $aaa, int $bbb) => 0; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:13-1:16 + >---< +1| fn(int $aaa, int $bbb) => 0; + +[#2 Removal] = 1:13-1:17 + >----< +1| fn(int $aaa, int $bbb) => 0; + +[#2 Leading delimiter] = 1:12-1:13 + >-< +1| fn(int $aaa, int $bbb) => 0; + +[#2 Trailing delimiter] = 1:16-1:17 + >-< +1| fn(int $aaa, int $bbb) => 0; + +[#2 Domain] = 1:13-1:21 + >--------< +1| fn(int $aaa, int $bbb) => 0; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/php/type/type.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..596c2a36c6 --- /dev/null +++ b/data/fixtures/scopes/php/type/type.argument.formal.method.iteration.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| public function bar(int $aaa, int $bbb) {} +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:24-2:42 + >------------------< +2| public function bar(int $aaa, int $bbb) {} diff --git a/data/fixtures/scopes/php/type/type.argument.formal.method.scope b/data/fixtures/scopes/php/type/type.argument.formal.method.scope new file mode 100644 index 0000000000..7ba2c8b36c --- /dev/null +++ b/data/fixtures/scopes/php/type/type.argument.formal.method.scope @@ -0,0 +1,65 @@ +----------- +1| class Foo { +2| public function bar(int $aaa, int $bbb) {} +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---< +2| public function bar(int $aaa, int $bbb) {} + +[#2 Removal] = 2:24-2:28 + >----< +2| public function bar(int $aaa, int $bbb) {} + +[#2 Trailing delimiter] = 2:27-2:28 + >-< +2| public function bar(int $aaa, int $bbb) {} + +[#2 Domain] = 2:24-2:32 + >--------< +2| public function bar(int $aaa, int $bbb) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:34-2:37 + >---< +2| public function bar(int $aaa, int $bbb) {} + +[#3 Removal] = 2:34-2:38 + >----< +2| public function bar(int $aaa, int $bbb) {} + +[#3 Leading delimiter] = 2:33-2:34 + >-< +2| public function bar(int $aaa, int $bbb) {} + +[#3 Trailing delimiter] = 2:37-2:38 + >-< +2| public function bar(int $aaa, int $bbb) {} + +[#3 Domain] = 2:34-2:42 + >--------< +2| public function bar(int $aaa, int $bbb) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.class.scope b/data/fixtures/scopes/php/type/type.class.scope new file mode 100644 index 0000000000..dbe86809d0 --- /dev/null +++ b/data/fixtures/scopes/php/type/type.class.scope @@ -0,0 +1,16 @@ +------------< +1| class Foo {} + +[Removal] = 0:5-1:12 + > +0| -----------< +1| enum Foo {} + +[Removal] = 0:5-1:11 + > +0| ----------- +1| class Foo { +2| public string $bar; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ------< 2| public string $bar; -[Removal] = 2:11-2:18 +[#2 Removal] = 2:11-2:18 >-------< 2| public string $bar; -[Leading delimiter] = 2:10-2:11 +[#2 Leading delimiter] = 2:10-2:11 >-< 2| public string $bar; -[Trailing delimiter] = 2:17-2:18 +[#2 Trailing delimiter] = 2:17-2:18 >-< 2| public string $bar; -[Domain] = 2:4-2:23 +[#2 Domain] = 2:4-2:23 >-------------------< 2| public string $bar; -[Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.field.interface.scope b/data/fixtures/scopes/php/type/type.field.interface.scope new file mode 100644 index 0000000000..e977980a7a --- /dev/null +++ b/data/fixtures/scopes/php/type/type.field.interface.scope @@ -0,0 +1,46 @@ +--------------- +1| interface Foo { +2| public const int bar = 0; +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---< +2| public const int bar = 0; + +[#2 Removal] = 2:17-2:21 + >----< +2| public const int bar = 0; + +[#2 Leading delimiter] = 2:16-2:17 + >-< +2| public const int bar = 0; + +[#2 Trailing delimiter] = 2:20-2:21 + >-< +2| public const int bar = 0; + +[#2 Domain] = 2:4-2:29 + >-------------------------< +2| public const int bar = 0; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.interface.scope b/data/fixtures/scopes/php/type/type.interface.scope new file mode 100644 index 0000000000..e5a214b7dc --- /dev/null +++ b/data/fixtures/scopes/php/type/type.interface.scope @@ -0,0 +1,16 @@ +----------------< +1| interface Foo {} + +[Removal] = 0:5-1:16 + > +0| ----- +0| -< +1| class Foo { } diff --git a/data/fixtures/scopes/php/type/type.iteration.document.scope b/data/fixtures/scopes/php/type/type.iteration.document.scope new file mode 100644 index 0000000000..ac763c63c2 --- /dev/null +++ b/data/fixtures/scopes/php/type/type.iteration.document.scope @@ -0,0 +1,14 @@ + + +0| +1| ----- +0| -< +1| interface Foo { } diff --git a/data/fixtures/scopes/php/type/type.return.method.scope b/data/fixtures/scopes/php/type/type.return.method.scope new file mode 100644 index 0000000000..f110ae17fc --- /dev/null +++ b/data/fixtures/scopes/php/type/type.return.method.scope @@ -0,0 +1,42 @@ +----------- +1| class Foo { +2| public function bar(): int {} +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ---< +2| public function bar(): int {} + +[#2 Removal] = 2:25-2:30 + >-----< +2| public function bar(): int {} + +[#2 Leading delimiter] = 2:25-2:27 + >--< +2| public function bar(): int {} + +[#2 Domain] = 2:4-2:33 + >-----------------------------< +2| public function bar(): int {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.return.scope b/data/fixtures/scopes/php/type/type.return.scope new file mode 100644 index 0000000000..6ab204a2ea --- /dev/null +++ b/data/fixtures/scopes/php/type/type.return.scope @@ -0,0 +1,21 @@ +---< +1| function foo(): int {} + +[Removal] = 1:14-1:19 + >-----< +1| function foo(): int {} + +[Leading delimiter] = 1:14-1:16 + >--< +1| function foo(): int {} + +[Domain] = 1:0-1:22 + >----------------------< +1| function foo(): int {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.argument.actual.iteration.scope b/data/fixtures/scopes/php/value/value.argument.actual.iteration.scope new file mode 100644 index 0000000000..611503e6d4 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.actual.iteration.scope @@ -0,0 +1,16 @@ +----- +0| --------------< +1| foo(aaa: 0, bbb: 1); diff --git a/data/fixtures/scopes/php/value/value.argument.actual.scope b/data/fixtures/scopes/php/value/value.argument.actual.scope new file mode 100644 index 0000000000..96ccef2d17 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.actual.scope @@ -0,0 +1,40 @@ +-< +1| foo(aaa: 0, bbb: 1); + +[#1 Removal] = 1:7-1:10 + >---< +1| foo(aaa: 0, bbb: 1); + +[#1 Leading delimiter] = 1:7-1:9 + >--< +1| foo(aaa: 0, bbb: 1); + +[#1 Domain] = 1:4-1:10 + >------< +1| foo(aaa: 0, bbb: 1); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:17-1:18 + >-< +1| foo(aaa: 0, bbb: 1); + +[#2 Removal] = 1:15-1:18 + >---< +1| foo(aaa: 0, bbb: 1); + +[#2 Leading delimiter] = 1:15-1:17 + >--< +1| foo(aaa: 0, bbb: 1); + +[#2 Domain] = 1:12-1:18 + >------< +1| foo(aaa: 0, bbb: 1); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.argument.formal.constructor.iteration.scope b/data/fixtures/scopes/php/value/value.argument.formal.constructor.iteration.scope new file mode 100644 index 0000000000..450e857c3f --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.constructor.iteration.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| function __construct($aaa = 0, $bbb = 1) {} +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:25-2:43 + >------------------< +2| function __construct($aaa = 0, $bbb = 1) {} diff --git a/data/fixtures/scopes/php/value/value.argument.formal.constructor.scope b/data/fixtures/scopes/php/value/value.argument.formal.constructor.scope new file mode 100644 index 0000000000..c189c05d5c --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.constructor.scope @@ -0,0 +1,42 @@ +-< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#1 Removal] = 2:29-2:33 + >----< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#1 Leading delimiter] = 2:29-2:32 + >---< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#1 Domain] = 2:25-2:33 + >--------< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:42-2:43 + >-< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#2 Removal] = 2:39-2:43 + >----< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#2 Leading delimiter] = 2:39-2:42 + >---< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#2 Domain] = 2:35-2:43 + >--------< +2| function __construct($aaa = 0, $bbb = 1) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.argument.formal.iteration.scope b/data/fixtures/scopes/php/value/value.argument.formal.iteration.scope new file mode 100644 index 0000000000..0b4336e850 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.iteration.scope @@ -0,0 +1,16 @@ +----- +0| ------------------< +1| function foo($aaa = 0, $bbb = 1) {} diff --git a/data/fixtures/scopes/php/value/value.argument.formal.lambda.iteration.scope b/data/fixtures/scopes/php/value/value.argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..e37c92d3da --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.lambda.iteration.scope @@ -0,0 +1,16 @@ +----- +0| ------------------< +1| function ($aaa = 0, $bbb = 1) {}; diff --git a/data/fixtures/scopes/php/value/value.argument.formal.lambda.scope b/data/fixtures/scopes/php/value/value.argument.formal.lambda.scope new file mode 100644 index 0000000000..1e9de44ec1 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.lambda.scope @@ -0,0 +1,40 @@ +-< +1| function ($aaa = 0, $bbb = 1) {}; + +[#1 Removal] = 1:14-1:18 + >----< +1| function ($aaa = 0, $bbb = 1) {}; + +[#1 Leading delimiter] = 1:14-1:17 + >---< +1| function ($aaa = 0, $bbb = 1) {}; + +[#1 Domain] = 1:10-1:18 + >--------< +1| function ($aaa = 0, $bbb = 1) {}; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:27-1:28 + >-< +1| function ($aaa = 0, $bbb = 1) {}; + +[#2 Removal] = 1:24-1:28 + >----< +1| function ($aaa = 0, $bbb = 1) {}; + +[#2 Leading delimiter] = 1:24-1:27 + >---< +1| function ($aaa = 0, $bbb = 1) {}; + +[#2 Domain] = 1:20-1:28 + >--------< +1| function ($aaa = 0, $bbb = 1) {}; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.argument.formal.method.iteration.scope b/data/fixtures/scopes/php/value/value.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..260c48897f --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.method.iteration.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| function bar($aaa = 0, $bbb = 1) {} +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:17-2:35 + >------------------< +2| function bar($aaa = 0, $bbb = 1) {} diff --git a/data/fixtures/scopes/php/value/value.argument.formal.method.scope b/data/fixtures/scopes/php/value/value.argument.formal.method.scope new file mode 100644 index 0000000000..a56a5a1bb5 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.method.scope @@ -0,0 +1,42 @@ +-< +2| function bar($aaa = 0, $bbb = 1) {} + +[#1 Removal] = 2:21-2:25 + >----< +2| function bar($aaa = 0, $bbb = 1) {} + +[#1 Leading delimiter] = 2:21-2:24 + >---< +2| function bar($aaa = 0, $bbb = 1) {} + +[#1 Domain] = 2:17-2:25 + >--------< +2| function bar($aaa = 0, $bbb = 1) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:34-2:35 + >-< +2| function bar($aaa = 0, $bbb = 1) {} + +[#2 Removal] = 2:31-2:35 + >----< +2| function bar($aaa = 0, $bbb = 1) {} + +[#2 Leading delimiter] = 2:31-2:34 + >---< +2| function bar($aaa = 0, $bbb = 1) {} + +[#2 Domain] = 2:27-2:35 + >--------< +2| function bar($aaa = 0, $bbb = 1) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.argument.formal.scope b/data/fixtures/scopes/php/value/value.argument.formal.scope new file mode 100644 index 0000000000..3f154f636a --- /dev/null +++ b/data/fixtures/scopes/php/value/value.argument.formal.scope @@ -0,0 +1,40 @@ +-< +1| function foo($aaa = 0, $bbb = 1) {} + +[#1 Removal] = 1:17-1:21 + >----< +1| function foo($aaa = 0, $bbb = 1) {} + +[#1 Leading delimiter] = 1:17-1:20 + >---< +1| function foo($aaa = 0, $bbb = 1) {} + +[#1 Domain] = 1:13-1:21 + >--------< +1| function foo($aaa = 0, $bbb = 1) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:30-1:31 + >-< +1| function foo($aaa = 0, $bbb = 1) {} + +[#2 Removal] = 1:27-1:31 + >----< +1| function foo($aaa = 0, $bbb = 1) {} + +[#2 Leading delimiter] = 1:27-1:30 + >---< +1| function foo($aaa = 0, $bbb = 1) {} + +[#2 Domain] = 1:23-1:31 + >--------< +1| function foo($aaa = 0, $bbb = 1) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.assignment.compound.scope b/data/fixtures/scopes/php/value/value.assignment.compound.scope new file mode 100644 index 0000000000..ec8bd19c14 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.assignment.compound.scope @@ -0,0 +1,21 @@ +-< +1| $foo += 0; + +[Removal] = 1:4-1:9 + >-----< +1| $foo += 0; + +[Leading delimiter] = 1:4-1:8 + >----< +1| $foo += 0; + +[Domain] = 1:0-1:10 + >----------< +1| $foo += 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.field.class.scope b/data/fixtures/scopes/php/value/value.field.class.scope new file mode 100644 index 0000000000..7927d23a4b --- /dev/null +++ b/data/fixtures/scopes/php/value/value.field.class.scope @@ -0,0 +1,23 @@ +-< +2| public $bar = 0; + +[Removal] = 2:15-2:19 + >----< +2| public $bar = 0; + +[Leading delimiter] = 2:15-2:18 + >---< +2| public $bar = 0; + +[Domain] = 2:4-2:20 + >----------------< +2| public $bar = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.field.enum.scope b/data/fixtures/scopes/php/value/value.field.enum.scope new file mode 100644 index 0000000000..71749442d1 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.field.enum.scope @@ -0,0 +1,23 @@ +-< +2| case bar = 0; + +[Removal] = 2:12-2:16 + >----< +2| case bar = 0; + +[Leading delimiter] = 2:12-2:15 + >---< +2| case bar = 0; + +[Domain] = 2:4-2:17 + >-------------< +2| case bar = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.field.interface.scope b/data/fixtures/scopes/php/value/value.field.interface.scope new file mode 100644 index 0000000000..c24cbf7264 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.field.interface.scope @@ -0,0 +1,23 @@ +-< +2| public const bar = 0; + +[Removal] = 2:20-2:24 + >----< +2| public const bar = 0; + +[Leading delimiter] = 2:20-2:23 + >---< +2| public const bar = 0; + +[Domain] = 2:4-2:25 + >---------------------< +2| public const bar = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.foreach.scope b/data/fixtures/scopes/php/value/value.foreach.scope new file mode 100644 index 0000000000..303bc7163a --- /dev/null +++ b/data/fixtures/scopes/php/value/value.foreach.scope @@ -0,0 +1,21 @@ +-------< +1| foreach ($values as $v) {} + +[Removal] = 1:9-1:17 + >--------< +1| foreach ($values as $v) {} + +[Trailing delimiter] = 1:16-1:17 + >-< +1| foreach ($values as $v) {} + +[Domain] = 1:0-1:26 + >--------------------------< +1| foreach ($values as $v) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.iteration.block.scope b/data/fixtures/scopes/php/value/value.iteration.block.scope new file mode 100644 index 0000000000..39725a0bb0 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.iteration.block.scope @@ -0,0 +1,29 @@ +----- +0| +1| class Foo { +2| function bar() { } +3| } + < + + +[#3 Content] = +[#3 Domain] = 2:20-2:21 + >-< +2| function bar() { } diff --git a/data/fixtures/scopes/php/value/value.iteration.block2.scope b/data/fixtures/scopes/php/value/value.iteration.block2.scope new file mode 100644 index 0000000000..5dfac32c5e --- /dev/null +++ b/data/fixtures/scopes/php/value/value.iteration.block2.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| function foo() { } diff --git a/data/fixtures/scopes/php/value/value.iteration.block3.scope b/data/fixtures/scopes/php/value/value.iteration.block3.scope new file mode 100644 index 0000000000..0393267d7d --- /dev/null +++ b/data/fixtures/scopes/php/value/value.iteration.block3.scope @@ -0,0 +1,32 @@ +----- +0| -< +1| if (true) { } + + +[#3 Content] = +[#3 Domain] = 2:17-2:18 + >-< +2| else if (false) { } + + +[#4 Content] = +[#4 Domain] = 3:6-3:7 + >-< +3| else { } diff --git a/data/fixtures/scopes/php/value/value.iteration.block4.scope b/data/fixtures/scopes/php/value/value.iteration.block4.scope new file mode 100644 index 0000000000..cc0bcdb62e --- /dev/null +++ b/data/fixtures/scopes/php/value/value.iteration.block4.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| while (true) { } diff --git a/data/fixtures/scopes/php/value/value.iteration.class.scope b/data/fixtures/scopes/php/value/value.iteration.class.scope new file mode 100644 index 0000000000..98de453bf1 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.iteration.class.scope @@ -0,0 +1,16 @@ +----- +0| -< +1| class Foo { } diff --git a/data/fixtures/scopes/php/value/value.iteration.document.scope b/data/fixtures/scopes/php/value/value.iteration.document.scope new file mode 100644 index 0000000000..1b5039a3ff --- /dev/null +++ b/data/fixtures/scopes/php/value/value.iteration.document.scope @@ -0,0 +1,14 @@ + + +0| +1| ----- +0| -< +1| enum Foo { } diff --git a/data/fixtures/scopes/php/value/value.mapPair.iteration.scope b/data/fixtures/scopes/php/value/value.mapPair.iteration.scope new file mode 100644 index 0000000000..be607fcbf5 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.mapPair.iteration.scope @@ -0,0 +1,16 @@ + 0, "bbb" => 1] +--- + +[#1 Content] = +[#1 Domain] = 0:0-1:24 + >----- +0| 0, "bbb" => 1] + ------------------------< + + +[#2 Content] = +[#2 Domain] = 1:1-1:23 + >----------------------< +1| ["aaa" => 0, "bbb" => 1] diff --git a/data/fixtures/scopes/php/value/value.return.lambda.scope b/data/fixtures/scopes/php/value/value.return.lambda.scope new file mode 100644 index 0000000000..4aa2dcbae0 --- /dev/null +++ b/data/fixtures/scopes/php/value/value.return.lambda.scope @@ -0,0 +1,21 @@ + 0; +--- + +[Content] = 1:8-1:9 + >-< +1| fn() => 0; + +[Removal] = 1:7-1:9 + >--< +1| fn() => 0; + +[Leading delimiter] = 1:7-1:8 + >-< +1| fn() => 0; + +[Domain] = 1:0-1:9 + >---------< +1| fn() => 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.switch.scope b/data/fixtures/scopes/php/value/value.switch.scope new file mode 100644 index 0000000000..37cfe5982a --- /dev/null +++ b/data/fixtures/scopes/php/value/value.switch.scope @@ -0,0 +1,14 @@ +----< +1| switch ($foo) {} + +[Domain] = 1:0-1:16 + >----------------< +1| switch ($foo) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/value/value.throw.scope b/data/fixtures/scopes/php/value/value.throw.scope new file mode 100644 index 0000000000..4daab86bee --- /dev/null +++ b/data/fixtures/scopes/php/value/value.throw.scope @@ -0,0 +1,21 @@ +----< +1| throw $foo; + +[Removal] = 1:5-1:10 + >-----< +1| throw $foo; + +[Leading delimiter] = 1:5-1:6 + >-< +1| throw $foo; + +[Domain] = 1:0-1:10 + >----------< +1| throw $foo; + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 013f0bb1e8..ad0a41da3b 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -195,7 +195,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.foreach": supported, "type.field.class": supported, "type.field.interface": supported, - "type.return": supported, "type.return.method": supported, "type.constant": supported, "type.variable.uninitialized": supported, @@ -251,6 +250,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal": notApplicable, "type.argument.formal.iteration": notApplicable, "interior.function": notApplicable, + "type.return": notApplicable, // Element and tags element: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index 9d88b3eaa0..dd2e3220eb 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -1,13 +1,42 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported, notApplicable } = ScopeSupportFacetLevel; +const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const phpScopeSupport: LanguageScopeSupportFacetMap = { - "comment.line": supported, - "comment.block": supported, - "textFragment.string.singleLine": supported, + disqualifyDelimiter: supported, + list: supported, + map: supported, + ifStatement: supported, + anonymousFunction: supported, + class: supported, + "class.iteration.document": supported, + + namedFunction: supported, + "namedFunction.constructor": supported, + "namedFunction.method": supported, + "namedFunction.iteration.document": supported, + "namedFunction.iteration.class": supported, + + functionCall: supported, + "functionCall.constructor": supported, + "functionCall.method": supported, + "functionCall.chain": supported, + functionCallee: supported, + "functionCallee.constructor": supported, + "functionCallee.method": supported, + "functionCallee.chain": supported, + + "argument.actual.singleLine": supported, + "argument.actual.multiLine": supported, + "argument.actual.iteration": supported, + "argument.actual.constructor.singleLine": supported, + "argument.actual.constructor.multiLine": supported, + "argument.actual.constructor.iteration": supported, + "argument.actual.method.singleLine": supported, + "argument.actual.method.multiLine": supported, + "argument.actual.method.iteration": supported, "argument.formal.singleLine": supported, "argument.formal.multiLine": supported, "argument.formal.iteration": supported, @@ -17,55 +46,288 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.method.singleLine": supported, "argument.formal.method.multiLine": supported, "argument.formal.method.iteration": supported, + "argument.formal.lambda.singleLine": supported, + "argument.formal.lambda.multiLine": supported, + "argument.formal.lambda.iteration": supported, + "argument.catch": supported, - "argument.actual.constructor.singleLine": supported, - "argument.actual.constructor.multiLine": supported, - "argument.actual.constructor.iteration": supported, - "argument.actual.method.singleLine": supported, - "argument.actual.method.multiLine": supported, - "argument.actual.method.iteration": supported, - "argument.actual.singleLine": supported, - "argument.actual.multiLine": supported, - "argument.actual.iteration": supported, + "argumentList.actual.empty": supported, + "argumentList.actual.singleLine": supported, + "argumentList.actual.multiLine": supported, + "argumentList.actual.constructor.empty": supported, + "argumentList.actual.constructor.singleLine": supported, + "argumentList.actual.constructor.multiLine": supported, + "argumentList.actual.method.empty": supported, + "argumentList.actual.method.singleLine": supported, + "argumentList.actual.method.multiLine": supported, + "argumentList.formal.empty": supported, + "argumentList.formal.singleLine": supported, + "argumentList.formal.multiLine": supported, + "argumentList.formal.constructor.empty": supported, + "argumentList.formal.constructor.singleLine": supported, + "argumentList.formal.constructor.multiLine": supported, + "argumentList.formal.method.empty": supported, + "argumentList.formal.method.singleLine": supported, + "argumentList.formal.method.multiLine": supported, + "argumentList.formal.lambda.empty": supported, + "argumentList.formal.lambda.singleLine": supported, + "argumentList.formal.lambda.multiLine": supported, - "name.variable.initialized": supported, + "branch.if": supported, + "branch.if.elif.else": supported, + "branch.if.else": supported, + "branch.if.iteration": supported, + "branch.try": supported, + "branch.try.iteration": supported, + "branch.switchCase": supported, + "branch.switchCase.iteration": supported, + "branch.ternary": supported, + "branch.ternary.iteration": supported, + + "comment.line": supported, + "comment.block": supported, + + "condition.if": supported, + "condition.while": supported, + "condition.doWhile": supported, + "condition.for": supported, + "condition.switchCase": supported, + "condition.switchCase.iteration": supported, + "condition.ternary": supported, + + "statement.class": supported, + "statement.interface": supported, + "statement.enum": supported, + "statement.field.class": supported, + "statement.field.interface": supported, + "statement.function": supported, + "statement.constructor": supported, + "statement.method": supported, + "statement.functionCall": supported, + "statement.if": supported, + "statement.try": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.doWhile": supported, + "statement.assignment": supported, + "statement.assignment.compound": supported, + "statement.update": supported, + "statement.variable.initialized": supported, + "statement.return": supported, + "statement.yield": supported, + "statement.throw": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.import": supported, + "statement.namespace": supported, + "statement.iteration.document": supported, + "statement.iteration.class": supported, + "statement.iteration.interface": supported, + "statement.iteration.block": supported, + + "string.singleLine": supported, + "string.multiLine": supported, + + "textFragment.comment.line": supported, + "textFragment.comment.block": supported, + "textFragment.string.singleLine": supported, + "textFragment.string.multiLine": supported, + + "name.argument.actual": supported, + "name.argument.actual.iteration": supported, + "name.argument.formal": supported, + "name.argument.formal.iteration": supported, + "name.argument.formal.constructor": supported, + "name.argument.formal.constructor.iteration": supported, + "name.argument.formal.method": supported, + "name.argument.formal.method.iteration": supported, + "name.argument.formal.lambda": supported, + "name.argument.formal.lambda.iteration": supported, + "name.argument.catch": supported, "name.assignment": supported, + "name.assignment.compound": supported, + "name.variable.initialized": supported, + "name.foreach": supported, + "name.function": supported, + "name.constructor": supported, + "name.method": supported, + "name.class": supported, + "name.interface": supported, + "name.enum": supported, + "name.field.class": supported, + "name.field.interface": supported, + "name.field.enum": supported, + "name.namespace": supported, + "name.iteration.document": supported, + "name.iteration.class": supported, + "name.iteration.interface": supported, + "name.iteration.enum": supported, + "name.iteration.block": supported, "key.mapPair": supported, + "key.mapPair.iteration": supported, - "value.variable": supported, - "value.assignment": supported, + "value.argument.actual": supported, + "value.argument.actual.iteration": supported, + "value.argument.formal": supported, + "value.argument.formal.iteration": supported, + "value.argument.formal.constructor": supported, + "value.argument.formal.constructor.iteration": supported, + "value.argument.formal.lambda": supported, + "value.argument.formal.lambda.iteration": supported, + "value.argument.formal.method": supported, + "value.argument.formal.method.iteration": supported, "value.mapPair": supported, + "value.mapPair.iteration": supported, + "value.assignment": supported, + "value.assignment.compound": supported, + "value.variable": supported, + "value.foreach": supported, "value.return": supported, + "value.return.lambda": supported, "value.yield": supported, + "value.throw": supported, + "value.switch": supported, + "value.field.class": supported, + "value.field.interface": supported, + "value.field.enum": supported, + "value.iteration.document": supported, + "value.iteration.class": supported, + "value.iteration.enum": supported, + "value.iteration.block": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, + "type.argument.formal.constructor": supported, + "type.argument.formal.constructor.iteration": supported, + "type.argument.formal.method": supported, + "type.argument.formal.method.iteration": supported, + "type.argument.formal.lambda": supported, + "type.argument.formal.lambda.iteration": supported, "type.argument.catch": supported, - "type.cast": supported, + "type.return": supported, + "type.return.method": supported, "type.field.class": supported, + "type.field.interface": supported, + "type.class": supported, + "type.interface": supported, + "type.enum": supported, + "type.cast": supported, + "type.iteration.document": supported, + "type.iteration.class": supported, + "type.iteration.interface": supported, - "name.argument.formal": supported, - "name.argument.formal.iteration": supported, - "name.argument.catch": supported, - "name.field.class": supported, + "interior.class": supported, + "interior.interface": supported, + "interior.enum": supported, + "interior.function": supported, + "interior.constructor": supported, + "interior.method": supported, + "interior.lambda": supported, + "interior.if": supported, + "interior.try": supported, + "interior.switch": supported, + "interior.switchCase": supported, + "interior.for": supported, + "interior.foreach": supported, + "interior.while": supported, + "interior.doWhile": supported, + "interior.namespace": supported, - "string.singleLine": supported, + /* UNSUPPORTED */ - disqualifyDelimiter: supported, + fieldAccess: unsupported, + + /* NOT APPLunICABLE */ + + // Not a language construct in PHP + "type.typeArgument": notApplicable, + "type.typeArgument.iteration": notApplicable, + "type.alias": notApplicable, + "statement.typeAlias": notApplicable, + "name.typeAlias": notApplicable, + "value.typeAlias": notApplicable, + + // Not used by PHP syntax + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + notebookCell: notApplicable, + "interior.cell": notApplicable, + environment: notApplicable, + selector: notApplicable, + unit: notApplicable, + pairDelimiter: notApplicable, - /* NOT APPLICABLE */ + // XML/HTML facets + element: notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + "interior.element": notApplicable, + "textFragment.element": notApplicable, + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, - // Constant + // Unsupported branch kind + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // Unsupported statement categories + "statement.resource": notApplicable, + "statement.package": notApplicable, + "name.resource": notApplicable, + "value.resource": notApplicable, + "type.resource": notApplicable, + "interior.resource": notApplicable, + + // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "name.assignment.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, + "value.assignment.destructuring": notApplicable, + + // Const declaration style "statement.constant": notApplicable, "name.constant": notApplicable, "value.constant": notApplicable, "type.constant": notApplicable, - // Throw statement - "statement.throw": notApplicable, - "value.throw": notApplicable, + // Unenclosed collection items + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, - // Miscellaneous + // Generic / enum call variants + "functionCall.generic": notApplicable, + "functionCallee.generic": notApplicable, + "functionCall.enum": notApplicable, + "functionCallee.enum": notApplicable, + + // Uninitialized variables + "statement.variable.uninitialized": notApplicable, "name.variable.uninitialized": notApplicable, + "type.variable.uninitialized": notApplicable, + + // Static statement + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, + "type.variable.initialized": notApplicable, + "type.foreach": notApplicable, + "type.iteration.block": notApplicable, + "class.iteration.class": notApplicable, + regularExpression: notApplicable, }; diff --git a/queries/php.scm b/queries/php.scm index 6e762e1c67..0ab470dcc7 100644 --- a/queries/php.scm +++ b/queries/php.scm @@ -6,7 +6,6 @@ [ (break_statement) (class_declaration) - (compound_statement) (const_declaration) (continue_statement) (declare_statement) @@ -21,7 +20,6 @@ (function_static_declaration) (global_declaration) (goto_statement) - (if_statement) (interface_declaration) (named_label_statement) (namespace_definition) @@ -32,8 +30,41 @@ (try_statement) (unset_statement) (while_statement) + (method_declaration) + + ;; Disabled on purpose. We don't consider these to be statements. + ;; (compound_statement) + + ;; Disabled on purpose. We have a better definition of these below. + ;; (if_statement) ] @statement +( + (program) @class.iteration @statement.iteration @namedFunction.iteration + (#document-range! @class.iteration @statement.iteration @namedFunction.iteration) +) + +( + (program) @name.iteration @value.iteration @type.iteration + (#document-range! @name.iteration @value.iteration @type.iteration) +) + +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . +) + +;;!! { } +;;! ^ +(compound_statement + "{" @name.iteration.start.endOf @value.iteration.start.endOf @statement.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @statement.iteration.end.startOf +) + [ (shell_command_expression) (string) @@ -63,20 +94,114 @@ (comment) @comment @textFragment -(if_statement) @ifStatement +;;!! if (true) {} else {} +( + (if_statement) @ifStatement @statement @branch.iteration + (#not-parent-type? @ifStatement else_clause) +) -[ - (array_creation_expression) -] @list +;;!! if (true) {} else {} +;;! ^^^^ +( + (if_statement + "if" @branch.start @branch.removal.start + condition: (_ + (_) @condition + ) + body: (_) @branch.end @branch.removal.end + alternative: (else_clause + "else" @branch.removal.end.startOf + (if_statement)? @branch.removal.end.startOf + )? + ) @condition.domain + (#not-parent-type? @condition.domain else_clause) +) +;;!! else if (true) {} +;;! ^^^^ +(else_clause + "else" @condition.domain.start @branch.start + (if_statement + condition: (_ + (_) @condition + ) + body: (_) @condition.domain.end @branch.end + ) +) + +;;!! else {} +(else_clause + body: (compound_statement) +) @branch + +;;!! [aaa, bbb] +(array_creation_expression) @list + +;;!! ["aaa" => 0, "bbb" => 1]; +(array_creation_expression + "[" @collectionKey.iteration.start.endOf @value.iteration.start.endOf + (array_element_initializer + "=>" + ) + "]" @collectionKey.iteration.end.startOf @value.iteration.end.startOf +) @map + +;;!! ['num' => 1]; +;;! ^^^^^ +;;! ^ +(array_element_initializer + (_) @collectionKey @value.leading.endOf + "=>" + (_) @value @collectionKey.trailing.startOf +) @_.domain + +;;!! class Foo {} (class_declaration name: (_) @name -) @class @name.domain + body: (_ + "{" @namedFunction.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf + ) +) @class @type @name.domain + +;;!! class Foo { } +;;!! interface Foo { } +(declaration_list + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf +) +(declaration_list + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf +) + +;;!! interface Foo {} +(interface_declaration + name: (_) @name +) @type @name.domain +;;!! enum Foo {} +(enum_declaration + name: (_) @name + body: (_ + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf + ) +) @type @name.domain + +;;!! function foo() {} [ - (function_definition) - (method_declaration) -] @namedFunction + (function_definition + name: (_) @name + parameters: (_)? @type.leading.endOf + return_type: (_)? @type + ) + (method_declaration + name: (_) @name + parameters: (_)? @type.leading.endOf + return_type: (_)? @type + ) +] @namedFunction @_.domain (expression_statement (assignment_expression @@ -89,28 +214,154 @@ ";"? @namedFunction.end ) -[ - (anonymous_function) - (arrow_function) -] @anonymousFunction +;;!! function() {} +(anonymous_function) @anonymousFunction + +;;!! fn() => 0; +;;! ^ +(arrow_function + body: (_) @value +) @anonymousFunction @value.domain + +;;!! foo() +(function_call_expression + function: (_) @functionCallee +) @functionCall @functionCallee.domain + +;;!! foo()->bar() +(member_call_expression + object: (_) @functionCallee.start + name: (_) @functionCallee.end +) @functionCall @functionCallee.domain + +;;!! foo()?->bar() +(nullsafe_member_call_expression + object: (_) @functionCallee.start + name: (_) @functionCallee.end +) @functionCall @functionCallee.domain + +;;!! new Foo() +(object_creation_expression + "new" @functionCallee.start + . + (_) @functionCallee.end +) @functionCall @functionCallee.domain + +;;!! namespace Foo\Bar; +;;! ^^^^^^^ +(namespace_definition + name: (_) @name +) @name.domain + +;;!! foreach ($values as $v) {} +;;! ^^^^^^^ +;;! ^^ +(foreach_statement + (_) @value + . + "as" + . + (_) @name +) @_.domain + +;;!! throw $foo; +;;! ^^^^ +(throw_expression + (_) @value +) @value.domain + +;;!! switch ($foo) { } +;;! ^^^^^ +;;! ^ +(switch_statement + condition: (_ + (_) @value + ) + body: (_ + "{" @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @branch.iteration.end.startOf @condition.iteration.end.startOf + ) +) @value.domain + +;;!! case 0: break; +;;! ^ +(case_statement + value: (_) @condition +) @condition.domain + +;;!! case 0: break; +;;! ^ +(case_statement + ":" @interior.start.endOf + (_) @interior.end.endOf @_dummy + (_)? @interior.end.endOf + . + (#not-type? @_dummy compound_statement) +) + +;;!! default: break; +;;! ^ +(default_statement + ":" @interior.start.endOf + (_) @interior.end.endOf @_dummy + (_)? @interior.end.endOf + . + (#not-type? @_dummy compound_statement) +) [ - (function_definition - name: (_) @name + (case_statement) + (default_statement) +] @branch + +;;!! do {} while (true); +;;! ^^^^ +(do_statement + condition: (_ + (_) @condition ) - (method_declaration - name: (_) @name +) @condition.domain + +;;!! while (true) {} +;;! ^^^^ +(while_statement + condition: (_ + (_) @condition ) -] @name.domain +) @condition.domain + +;;!! for ($i = 0; $i < $size; $i++) {} +;;! ^^^^^^^^^^ +(for_statement + condition: (_) @condition +) @condition.domain + +;;!! true ? 0 : 1 +;;! ^^^^ +;;! ^ ^ +(conditional_expression + condition: (_) @condition + body: (_) @branch +) @condition.domain @branch.iteration + +(conditional_expression + alternative: (_) @branch +) + +;;!! try {} catch () {} finally {} +(try_statement + "try" @branch.start + body: (_) @branch.end +) @branch.iteration [ - (function_call_expression) - (object_creation_expression) -] @functionCall + (catch_clause) + (finally_clause) +] @branch -;;!! $value = 2; -;;! ^^^^^^ -;;! ^ +;;!! $foo = 0; +;;! ^^^ +;;! ^ (_ (assignment_expression left: (_) @name @value.leading.endOf @@ -120,9 +371,9 @@ ";"? @_.domain.end ) -;;!! $value += 2; -;;! ^^^^^^ -;;! ^ +;;!! $foo += 0; +;;! ^^^ +;;! ^ (_ (augmented_assignment_expression left: (_) @name @value.leading.endOf @@ -142,8 +393,8 @@ name: (_) @name ) @_.domain -;;!! function foo($name) {} -;;! ^^^^^ +;;!! function foo($aaa, $bbb) {} +;;! ^^^^ ^^^^ ( (formal_parameters (_)? @_.leading.endOf @@ -170,52 +421,75 @@ (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n") ) +;;!! function foo($aaa, $bbb) {} +;;! ^^^^^^^^^^ (_ (formal_parameters - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf - ) -) @argumentOrParameter.iteration.domain - -;;!! foo.bar(a, b); -;;! ^^^^ + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) +) @argumentList.domain @argumentOrParameter.iteration.domain + +;;!! foo.bar(aaa, bbb); +;;! ^^^^^^^^ (binary_expression (function_call_expression (arguments - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf - ) + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) ) -) @argumentOrParameter.iteration.domain +) @argumentList.domain @argumentOrParameter.iteration.domain -;;!! foo(a, b); -;;! ^^^^ +;;!! foo(aaa, bbb); +;;! ^^^^^^^^ ( (_ (arguments - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf - ) - ) @argumentOrParameter.iteration.domain - (#not-parent-type? @argumentOrParameter.iteration.domain binary_expression) + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) + ) @argumentList.domain @argumentOrParameter.iteration.domain + (#not-parent-type? @argumentList.domain binary_expression) ) -;;!! ['num' => 1]; -;;! ^^^^^ -;;! ^ -(array_element_initializer - (_) @collectionKey @value.leading.endOf - (_) @value @collectionKey.trailing.startOf +(arguments + "(" @name.iteration.start.endOf @value.iteration.start.endOf + ")" @name.iteration.end.startOf @value.iteration.end.startOf +) + +;;!! foo(aaa: 0, bbb: 1); +;;! ^^^ ^^^ +;;! ^ ^ +(argument + name: (_) @name @value.leading.endOf + (_) @value @name.trailing.startOf +) @_.domain + +;;!! (int $aaa = 0) +;;! ^^^ +;;! ^^^^ +;;! ^ +(simple_parameter + type: (_)? @type + name: (_) @name @value.leading.endOf + default_value: (_)? @value ) @_.domain -;;!! return 2; +;;!! return 0; ;;! ^ (return_statement "return" @_.leading.endOf (_) @value ) @_.domain -;;!! yield 2; +;;!! yield 0; ;;! ^ (_ (yield_expression @@ -226,14 +500,6 @@ ";"? @_.domain.end ) -;;!! (string $str) -;;! ^^^^^^ -;;! ^^^^ -(simple_parameter - type: (_) @type - name: (_) @name -) @_.domain - ;;!! (array ...$nums) ;;! ^^^^^ ;;! ^^^^^ @@ -243,10 +509,12 @@ ) @_.domain ;;!! catch (Exception $e) {} +;;! ^^^^^^^^^^^^ ;;! ^^^^^^^^^ +;;! ^^ (catch_clause - type: (_) @type @_.domain.start - name: (_) @name @_.domain.end + type: (_) @type @argumentOrParameter.start @_.domain.start + name: (_) @name @argumentOrParameter.end @_.domain.end ) (formal_parameters @@ -254,16 +522,16 @@ ")" @type.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf ) @_.domain -;;!! (string) $str; -;;! ^^^^^^ +;;!! (int) $str; +;;! ^^^ (cast_expression type: (_) @type value: (_) @_.removal.end.startOf ) @_.removal.start.startOf @_.domain -;;!! public string $value; -;;! ^^^^^^ -;;! ^^^^^^ +;;!! public int $foo; +;;! ^^^ +;;! ^^^^ (property_declaration (_)? @name.removal.start.startOf type: (_)? @type @name.removal.start.startOf @@ -271,6 +539,27 @@ name: (_) @name @name.removal.end.endOf @value.leading.endOf default_value: (_)? @value @name.removal.end.startOf ) @name.removal.start.startOf +) @_.domain @statement + +;;!! const int foo = 0; +;;! ^^^ +;;! ^^^ +;;! ^ +(const_declaration + type: (_)? @type + (const_element + (name) @name @value.leading.endOf + (_) @value @name.removal.end.startOf + ) +) @name.removal.start.startOf @_.domain + +;;!! case foo = 0; +;;! ^^^ +;;! ^ +(enum_case + "case" @name.removal.start.startOf + name: (_) @name @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf ) @_.domain (_