diff --git a/data/fixtures/recorded/languages/rust/clearValue4.yml b/data/fixtures/recorded/languages/rust/clearValue4.yml index 1b0787f23f..70999694dc 100644 --- a/data/fixtures/recorded/languages/rust/clearValue4.yml +++ b/data/fixtures/recorded/languages/rust/clearValue4.yml @@ -13,7 +13,7 @@ command: initialState: documentContents: |- fn foo() -> i32 { - return 3 + return 3; } selections: - anchor: {line: 1, character: 11} @@ -22,7 +22,7 @@ initialState: finalState: documentContents: |- fn foo() -> i32 { - return + return ; } selections: - anchor: {line: 1, character: 11} diff --git a/data/fixtures/recorded/languages/rust/clearValue5.yml b/data/fixtures/recorded/languages/rust/clearValue5.yml index 0d5366ace2..63eeb2df50 100644 --- a/data/fixtures/recorded/languages/rust/clearValue5.yml +++ b/data/fixtures/recorded/languages/rust/clearValue5.yml @@ -13,7 +13,7 @@ command: initialState: documentContents: |- fn foo() -> i32 { - return 3 + return 3; } selections: - anchor: {line: 1, character: 4} @@ -22,7 +22,7 @@ initialState: finalState: documentContents: |- fn foo() -> i32 { - return + return ; } selections: - anchor: {line: 1, character: 11} diff --git a/data/fixtures/scopes/rust/anonymousFunction.scope b/data/fixtures/scopes/rust/anonymousFunction.scope new file mode 100644 index 0000000000..80d49da26c --- /dev/null +++ b/data/fixtures/scopes/rust/anonymousFunction.scope @@ -0,0 +1,10 @@ +|| {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:5 + >-----< +0| || {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/anonymousFunction2.scope b/data/fixtures/scopes/rust/anonymousFunction2.scope new file mode 100644 index 0000000000..cc09713a22 --- /dev/null +++ b/data/fixtures/scopes/rust/anonymousFunction2.scope @@ -0,0 +1,10 @@ +|x| x * x; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| |x| x * x; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/argument/argument.actual.iteration.scope b/data/fixtures/scopes/rust/argument/argument.actual.iteration.scope new file mode 100644 index 0000000000..3f067b0c64 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.iteration.scope @@ -0,0 +1,10 @@ +foo(aaa, bbb); +--- + +[Content] = 0:4-0:12 + >--------< +0| foo(aaa, bbb); + +[Domain] = 0:0-0:13 + >-------------< +0| foo(aaa, bbb); diff --git a/data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope b/data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope new file mode 100644 index 0000000000..7dc906b75a --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope @@ -0,0 +1,10 @@ +foo.bar(aaa, bbb); +--- + +[Content] = 0:8-0:16 + >--------< +0| foo.bar(aaa, bbb); + +[Domain] = 0:0-0:17 + >-----------------< +0| foo.bar(aaa, bbb); diff --git a/data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope b/data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope new file mode 100644 index 0000000000..f75aaa48de --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope @@ -0,0 +1,44 @@ +foo.bar( + aaa, + bbb +); +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:7 + >---< +1| aaa, + +[#1 Removal] = 1:4-2:4 + >---- +1| aaa, +2| bbb + ----< + +[#1 Trailing delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:7 + >---< +2| bbb + +[#2 Removal] = 1:7-2:7 + >- +1| aaa, +2| bbb + -------< + +[#2 Leading delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope b/data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope new file mode 100644 index 0000000000..46548a2c6c --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope @@ -0,0 +1,33 @@ +foo.bar(aaa, bbb); +--- + +[#1 Content] = +[#1 Domain] = 0:8-0:11 + >---< +0| foo.bar(aaa, bbb); + +[#1 Removal] = 0:8-0:13 + >-----< +0| foo.bar(aaa, bbb); + +[#1 Trailing delimiter] = 0:11-0:13 + >--< +0| foo.bar(aaa, bbb); + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:13-0:16 + >---< +0| foo.bar(aaa, bbb); + +[#2 Removal] = 0:11-0:16 + >-----< +0| foo.bar(aaa, bbb); + +[#2 Leading delimiter] = 0:11-0:13 + >--< +0| foo.bar(aaa, bbb); + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope b/data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope new file mode 100644 index 0000000000..6f7ea31f22 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope @@ -0,0 +1,44 @@ +foo( + aaa, + bbb +); +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:7 + >---< +1| aaa, + +[#1 Removal] = 1:4-2:4 + >---- +1| aaa, +2| bbb + ----< + +[#1 Trailing delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:7 + >---< +2| bbb + +[#2 Removal] = 1:7-2:7 + >- +1| aaa, +2| bbb + -------< + +[#2 Leading delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope b/data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope new file mode 100644 index 0000000000..2e62d177c3 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope @@ -0,0 +1,33 @@ +foo(aaa, bbb); +--- + +[#1 Content] = +[#1 Domain] = 0:4-0:7 + >---< +0| foo(aaa, bbb); + +[#1 Removal] = 0:4-0:9 + >-----< +0| foo(aaa, bbb); + +[#1 Trailing delimiter] = 0:7-0:9 + >--< +0| foo(aaa, bbb); + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:9-0:12 + >---< +0| foo(aaa, bbb); + +[#2 Removal] = 0:7-0:12 + >-----< +0| foo(aaa, bbb); + +[#2 Leading delimiter] = 0:7-0:9 + >--< +0| foo(aaa, bbb); + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argument/argument.formal.iteration.scope b/data/fixtures/scopes/rust/argument/argument.formal.iteration.scope new file mode 100644 index 0000000000..9fc48cbd24 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.iteration.scope @@ -0,0 +1,10 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[Content] = 0:7-0:25 + >------------------< +0| fn foo(aaa: i32, bbb: i32) {} + +[Domain] = 0:0-0:29 + >-----------------------------< +0| fn foo(aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..529f969dd4 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope @@ -0,0 +1,10 @@ +|aaa, bbb| {} +--- + +[Content] = 0:1-0:9 + >--------< +0| |aaa, bbb| {} + +[Domain] = 0:0-0:13 + >-------------< +0| |aaa, bbb| {} diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope new file mode 100644 index 0000000000..2261b4db1d --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope @@ -0,0 +1,10 @@ +|aaa: i32, bbb: i32| {} +--- + +[Content] = 0:1-0:19 + >------------------< +0| |aaa: i32, bbb: i32| {} + +[Domain] = 0:0-0:23 + >-----------------------< +0| |aaa: i32, bbb: i32| {} diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..82d072b3c5 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope @@ -0,0 +1,44 @@ +| + aaa, + bbb +| {} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:7 + >---< +1| aaa, + +[#1 Removal] = 1:4-2:4 + >---- +1| aaa, +2| bbb + ----< + +[#1 Trailing delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:7 + >---< +2| bbb + +[#2 Removal] = 1:7-2:7 + >- +1| aaa, +2| bbb + -------< + +[#2 Leading delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope new file mode 100644 index 0000000000..d3c2034111 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope @@ -0,0 +1,44 @@ +| + aaa: i32, + bbb: i32 +| {} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:12 + >--------< +1| aaa: i32, + +[#1 Removal] = 1:4-2:4 + >--------- +1| aaa: i32, +2| bbb: i32 + ----< + +[#1 Trailing delimiter] = 1:12-2:4 + >- +1| aaa: i32, +2| bbb: i32 + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:12 + >--------< +2| bbb: i32 + +[#2 Removal] = 1:12-2:12 + >- +1| aaa: i32, +2| bbb: i32 + ------------< + +[#2 Leading delimiter] = 1:12-2:4 + >- +1| aaa: i32, +2| bbb: i32 + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..92523a0ee0 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope @@ -0,0 +1,33 @@ +|aaa, bbb| {} +--- + +[#1 Content] = +[#1 Domain] = 0:1-0:4 + >---< +0| |aaa, bbb| {} + +[#1 Removal] = 0:1-0:6 + >-----< +0| |aaa, bbb| {} + +[#1 Trailing delimiter] = 0:4-0:6 + >--< +0| |aaa, bbb| {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:6-0:9 + >---< +0| |aaa, bbb| {} + +[#2 Removal] = 0:4-0:9 + >-----< +0| |aaa, bbb| {} + +[#2 Leading delimiter] = 0:4-0:6 + >--< +0| |aaa, bbb| {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope new file mode 100644 index 0000000000..2fad9ab3c9 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope @@ -0,0 +1,33 @@ +|aaa: i32, bbb: i32| {} +--- + +[#1 Content] = +[#1 Domain] = 0:1-0:9 + >--------< +0| |aaa: i32, bbb: i32| {} + +[#1 Removal] = 0:1-0:11 + >----------< +0| |aaa: i32, bbb: i32| {} + +[#1 Trailing delimiter] = 0:9-0:11 + >--< +0| |aaa: i32, bbb: i32| {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:11-0:19 + >--------< +0| |aaa: i32, bbb: i32| {} + +[#2 Removal] = 0:9-0:19 + >----------< +0| |aaa: i32, bbb: i32| {} + +[#2 Leading delimiter] = 0:9-0:11 + >--< +0| |aaa: i32, bbb: i32| {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope new file mode 100644 index 0000000000..454b53a574 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope @@ -0,0 +1,12 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[Content] = 1:11-1:36 + >-------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[Domain] = 1:4-1:40 + >------------------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope b/data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope new file mode 100644 index 0000000000..2c2af36616 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope @@ -0,0 +1,73 @@ +impl Foo { + fn bar( + &self, + aaa: i32, + bbb: i32 + ) {} +} +--- + +[#1 Content] = +[#1 Domain] = 2:8-2:13 + >-----< +2| &self, + +[#1 Removal] = 2:8-3:8 + >------ +2| &self, +3| aaa: i32, + --------< + +[#1 Trailing delimiter] = 2:13-3:8 + >- +2| &self, +3| aaa: i32, + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:8-3:16 + >--------< +3| aaa: i32, + +[#2 Removal] = 3:8-4:8 + >--------- +3| aaa: i32, +4| bbb: i32 + --------< + +[#2 Leading delimiter] = 2:13-3:8 + >- +2| &self, +3| aaa: i32, + --------< + +[#2 Trailing delimiter] = 3:16-4:8 + >- +3| aaa: i32, +4| bbb: i32 + --------< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 4:8-4:16 + >--------< +4| bbb: i32 + +[#3 Removal] = 3:16-4:16 + >- +3| aaa: i32, +4| bbb: i32 + ----------------< + +[#3 Leading delimiter] = 3:16-4:8 + >- +3| aaa: i32, +4| bbb: i32 + --------< + +[#3 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope b/data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope new file mode 100644 index 0000000000..91942d4c51 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope @@ -0,0 +1,55 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[#1 Content] = +[#1 Domain] = 1:11-1:16 + >-----< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#1 Removal] = 1:11-1:18 + >-------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#1 Trailing delimiter] = 1:16-1:18 + >--< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:18-1:26 + >--------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Removal] = 1:18-1:28 + >----------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Leading delimiter] = 1:16-1:18 + >--< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Trailing delimiter] = 1:26-1:28 + >--< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 1:28-1:36 + >--------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Removal] = 1:26-1:36 + >----------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Leading delimiter] = 1:26-1:28 + >--< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope b/data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope new file mode 100644 index 0000000000..6f12ef5327 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope @@ -0,0 +1,44 @@ +fn foo( + aaa: i32, + bbb: i32 +) {} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:12 + >--------< +1| aaa: i32, + +[#1 Removal] = 1:4-2:4 + >--------- +1| aaa: i32, +2| bbb: i32 + ----< + +[#1 Trailing delimiter] = 1:12-2:4 + >- +1| aaa: i32, +2| bbb: i32 + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:12 + >--------< +2| bbb: i32 + +[#2 Removal] = 1:12-2:12 + >- +1| aaa: i32, +2| bbb: i32 + ------------< + +[#2 Leading delimiter] = 1:12-2:4 + >- +1| aaa: i32, +2| bbb: i32 + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope b/data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope new file mode 100644 index 0000000000..a54502db79 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope @@ -0,0 +1,33 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[#1 Content] = +[#1 Domain] = 0:7-0:15 + >--------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Removal] = 0:7-0:17 + >----------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Trailing delimiter] = 0:15-0:17 + >--< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:17-0:25 + >--------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Removal] = 0:15-0:25 + >----------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Leading delimiter] = 0:15-0:17 + >--< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope new file mode 100644 index 0000000000..539138bcb6 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope @@ -0,0 +1,13 @@ +foo(); +--- + +[Content] = +[Removal] = 0:4-0:4 + >< +0| foo(); + +[Domain] = 0:0-0:5 + >-----< +0| foo(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope new file mode 100644 index 0000000000..91d34a15d7 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope @@ -0,0 +1,13 @@ +foo.bar(); +--- + +[Content] = +[Removal] = 0:8-0:8 + >< +0| foo.bar(); + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope new file mode 100644 index 0000000000..8b52ebf6c7 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope @@ -0,0 +1,33 @@ +foo.bar( + aaa, + bbb +); +--- + +[Content] = 1:4-2:7 + >---- +1| aaa, +2| bbb + -------< + +[Removal] = 0:8-3:0 + > +0| foo.bar( +1| aaa, +2| bbb +3| ); + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:1 + >-------- +0| foo.bar( +1| aaa, +2| bbb +3| ); + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope new file mode 100644 index 0000000000..9a937e7bf7 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope @@ -0,0 +1,13 @@ +foo.bar(aaa, bbb); +--- + +[Content] = +[Removal] = 0:8-0:16 + >--------< +0| foo.bar(aaa, bbb); + +[Domain] = 0:0-0:17 + >-----------------< +0| foo.bar(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope new file mode 100644 index 0000000000..419764ac56 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope @@ -0,0 +1,33 @@ +foo( + aaa, + bbb +); +--- + +[Content] = 1:4-2:7 + >---- +1| aaa, +2| bbb + -------< + +[Removal] = 0:4-3:0 + > +0| foo( +1| aaa, +2| bbb +3| ); + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:1 + >---- +0| foo( +1| aaa, +2| bbb +3| ); + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope new file mode 100644 index 0000000000..d649112ab5 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope @@ -0,0 +1,13 @@ +foo(aaa, bbb); +--- + +[Content] = +[Removal] = 0:4-0:12 + >--------< +0| foo(aaa, bbb); + +[Domain] = 0:0-0:13 + >-------------< +0| foo(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope new file mode 100644 index 0000000000..161eaa8d90 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope @@ -0,0 +1,13 @@ +fn foo() {} +--- + +[Content] = +[Removal] = 0:7-0:7 + >< +0| fn foo() {} + +[Domain] = 0:0-0:11 + >-----------< +0| fn foo() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope new file mode 100644 index 0000000000..6bd1a60020 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope @@ -0,0 +1,13 @@ +|| {} +--- + +[Content] = +[Removal] = 0:1-0:1 + >< +0| || {} + +[Domain] = 0:0-0:5 + >-----< +0| || {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..201c377182 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope @@ -0,0 +1,33 @@ +| + aaa: i32, + bbb: i32, +|{} +--- + +[Content] = 1:4-2:13 + >--------- +1| aaa: i32, +2| bbb: i32, + -------------< + +[Removal] = 0:1-3:0 + > +0| | +1| aaa: i32, +2| bbb: i32, +3| |{} + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa: i32, + +[Domain] = 0:0-3:3 + >- +0| | +1| aaa: i32, +2| bbb: i32, +3| |{} + ---< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..82ed677057 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope @@ -0,0 +1,13 @@ +|aaa: i32, bbb: i32| {} +--- + +[Content] = +[Removal] = 0:1-0:19 + >------------------< +0| |aaa: i32, bbb: i32| {} + +[Domain] = 0:0-0:23 + >-----------------------< +0| |aaa: i32, bbb: i32| {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope new file mode 100644 index 0000000000..a91f2deb2a --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope @@ -0,0 +1,15 @@ +impl Foo { + fn bar() {} +} +--- + +[Content] = +[Removal] = 1:11-1:11 + >< +1| fn bar() {} + +[Domain] = 1:4-1:15 + >-----------< +1| fn bar() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope new file mode 100644 index 0000000000..5148923082 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope @@ -0,0 +1,39 @@ +impl Foo { + fn bar( + &self, + aaa: i32, + bbb: i32 + ) {} +} +--- + +[Content] = 2:8-4:16 + >------ +2| &self, +3| aaa: i32, +4| bbb: i32 + ----------------< + +[Removal] = 1:11-5:4 + > +1| fn bar( +2| &self, +3| aaa: i32, +4| bbb: i32 +5| ) {} + ----< + +[Leading delimiter] = 2:0-2:8 + >--------< +2| &self, + +[Domain] = 1:4-5:8 + >------- +1| fn bar( +2| &self, +3| aaa: i32, +4| bbb: i32 +5| ) {} + --------< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope new file mode 100644 index 0000000000..7544b94745 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope @@ -0,0 +1,15 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[Content] = +[Removal] = 1:11-1:36 + >-------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[Domain] = 1:4-1:40 + >------------------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope new file mode 100644 index 0000000000..2d0364c1a0 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope @@ -0,0 +1,33 @@ +fn foo( + aaa: i32, + bbb: i32, +) {} +--- + +[Content] = 1:4-2:13 + >--------- +1| aaa: i32, +2| bbb: i32, + -------------< + +[Removal] = 0:7-3:0 + > +0| fn foo( +1| aaa: i32, +2| bbb: i32, +3| ) {} + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa: i32, + +[Domain] = 0:0-3:4 + >------- +0| fn foo( +1| aaa: i32, +2| bbb: i32, +3| ) {} + ----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope new file mode 100644 index 0000000000..3f91b34248 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope @@ -0,0 +1,13 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[Content] = +[Removal] = 0:7-0:25 + >------------------< +0| fn foo(aaa: i32, bbb: i32) {} + +[Domain] = 0:0-0:29 + >-----------------------------< +0| fn foo(aaa: i32, bbb: i32) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/branch/branch.if.elif.else.scope b/data/fixtures/scopes/rust/branch/branch.if.elif.else.scope new file mode 100644 index 0000000000..1ecccdc533 --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.if.elif.else.scope @@ -0,0 +1,45 @@ +if true {} +else if false {} +else {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:10 + >----------< +0| if true {} + +[#1 Removal] = 0:0-1:5 + >---------- +0| if true {} +1| else if false {} + -----< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:0-1:16 + >----------------< +1| else if false {} + +[#2 Removal] = 1:0-2:0 + >---------------- +1| else if false {} +2| else {} + < + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:0-2:7 + >-------< +2| else {} + +[#3 Removal] = 1:16-2:7 + > +1| else if false {} +2| else {} + -------< + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/branch/branch.if.else.scope b/data/fixtures/scopes/rust/branch/branch.if.else.scope new file mode 100644 index 0000000000..66e50525a9 --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.if.else.scope @@ -0,0 +1,25 @@ +if true {} +else {} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:10 + >----------< +0| if true {} + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:0-1:7 + >-------< +1| else {} + +[#2 Removal] = 0:10-1:7 + > +0| if true {} +1| else {} + -------< + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/branch/branch.if.iteration.scope b/data/fixtures/scopes/rust/branch/branch.if.iteration.scope new file mode 100644 index 0000000000..5a5ed880ea --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.if.iteration.scope @@ -0,0 +1,12 @@ +if true {} +else if false {} +else {} +--- + +[Content] = +[Domain] = 0:0-2:7 + >---------- +0| if true {} +1| else if false {} +2| else {} + -------< diff --git a/data/fixtures/scopes/rust/branch/branch.if.scope b/data/fixtures/scopes/rust/branch/branch.if.scope new file mode 100644 index 0000000000..95d75aa3fb --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.if.scope @@ -0,0 +1,10 @@ +if true {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:10 + >----------< +0| if true {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope new file mode 100644 index 0000000000..44a54b84db --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope @@ -0,0 +1,10 @@ +match foo { } +--- + +[Content] = 0:11-0:12 + >-< +0| match foo { } + +[Domain] = 0:0-0:13 + >-------------< +0| match foo { } diff --git a/data/fixtures/scopes/rust/branch/branch.switchCase.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.scope new file mode 100644 index 0000000000..26ac8d3a4e --- /dev/null +++ b/data/fixtures/scopes/rust/branch/branch.switchCase.scope @@ -0,0 +1,40 @@ +match foo { + 0 => "0", + _ => "_", +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:13 + >---------< +1| 0 => "0", + +[#1 Removal] = 1:0-2:0 + >------------- +1| 0 => "0", +2| _ => "_", + < + +[#1 Leading delimiter] = 1:0-1:4 + >----< +1| 0 => "0", + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:13 + >---------< +2| _ => "_", + +[#2 Removal] = 2:0-3:0 + >------------- +2| _ => "_", +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| _ => "_", + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/class.iteration.document.scope b/data/fixtures/scopes/rust/class.iteration.document.scope new file mode 100644 index 0000000000..c3d14f02e1 --- /dev/null +++ b/data/fixtures/scopes/rust/class.iteration.document.scope @@ -0,0 +1,12 @@ + +struct Foo {} + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| struct Foo {} +2| + < diff --git a/data/fixtures/scopes/rust/class.scope b/data/fixtures/scopes/rust/class.scope new file mode 100644 index 0000000000..752cf34874 --- /dev/null +++ b/data/fixtures/scopes/rust/class.scope @@ -0,0 +1,10 @@ +impl Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| impl Foo {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/rust/comment.block.scope b/data/fixtures/scopes/rust/comment.block.scope new file mode 100644 index 0000000000..5e8b51111c --- /dev/null +++ b/data/fixtures/scopes/rust/comment.block.scope @@ -0,0 +1,10 @@ +/* Hello world */ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| /* Hello world */ + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/comment.line.scope b/data/fixtures/scopes/rust/comment.line.scope new file mode 100644 index 0000000000..7d1477b8a1 --- /dev/null +++ b/data/fixtures/scopes/rust/comment.line.scope @@ -0,0 +1,10 @@ +// Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| // Hello world + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/condition.if.scope b/data/fixtures/scopes/rust/condition.if.scope new file mode 100644 index 0000000000..c4bc11ae65 --- /dev/null +++ b/data/fixtures/scopes/rust/condition.if.scope @@ -0,0 +1,52 @@ +if true {} +else if false {} +else {} +--- + +[#1 Content] = 0:3-0:7 + >----< +0| if true {} + +[#1 Removal] = 0:3-0:8 + >-----< +0| if true {} + +[#1 Leading delimiter] = 0:2-0:3 + >-< +0| if true {} + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| if true {} + +[#1 Domain] = 0:0-2:7 + >---------- +0| if true {} +1| else if false {} +2| else {} + -------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:13 + >-----< +1| else if false {} + +[#2 Removal] = 1:8-1:14 + >------< +1| else if false {} + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| else if false {} + +[#2 Trailing delimiter] = 1:13-1:14 + >-< +1| else if false {} + +[#2 Domain] = 1:0-1:16 + >----------------< +1| else if false {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/condition.switchCase.iteration.scope b/data/fixtures/scopes/rust/condition.switchCase.iteration.scope new file mode 100644 index 0000000000..44a54b84db --- /dev/null +++ b/data/fixtures/scopes/rust/condition.switchCase.iteration.scope @@ -0,0 +1,10 @@ +match foo { } +--- + +[Content] = 0:11-0:12 + >-< +0| match foo { } + +[Domain] = 0:0-0:13 + >-------------< +0| match foo { } diff --git a/data/fixtures/scopes/rust/condition.switchCase.scope b/data/fixtures/scopes/rust/condition.switchCase.scope new file mode 100644 index 0000000000..b5b8ebae3a --- /dev/null +++ b/data/fixtures/scopes/rust/condition.switchCase.scope @@ -0,0 +1,50 @@ +match foo { + 0 => "0", + _ => "_" +} +--- + +[#1 Content] = 1:4-1:5 + >-< +1| 0 => "0", + +[#1 Removal] = 1:4-1:6 + >--< +1| 0 => "0", + +[#1 Leading delimiter] = 1:0-1:4 + >----< +1| 0 => "0", + +[#1 Trailing delimiter] = 1:5-1:6 + >-< +1| 0 => "0", + +[#1 Domain] = 1:4-1:13 + >---------< +1| 0 => "0", + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:4-2:5 + >-< +2| _ => "_" + +[#2 Removal] = 2:4-2:6 + >--< +2| _ => "_" + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| _ => "_" + +[#2 Trailing delimiter] = 2:5-2:6 + >-< +2| _ => "_" + +[#2 Domain] = 2:4-2:12 + >--------< +2| _ => "_" + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/condition.while.scope b/data/fixtures/scopes/rust/condition.while.scope new file mode 100644 index 0000000000..c060b822ff --- /dev/null +++ b/data/fixtures/scopes/rust/condition.while.scope @@ -0,0 +1,24 @@ +while true {} +--- + +[Content] = 0:6-0:10 + >----< +0| while true {} + +[Removal] = 0:6-0:11 + >-----< +0| while true {} + +[Leading delimiter] = 0:5-0:6 + >-< +0| while true {} + +[Trailing delimiter] = 0:10-0:11 + >-< +0| while true {} + +[Domain] = 0:0-0:13 + >-------------< +0| while true {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/functionCall.chain.scope b/data/fixtures/scopes/rust/functionCall.chain.scope new file mode 100644 index 0000000000..6297108ea1 --- /dev/null +++ b/data/fixtures/scopes/rust/functionCall.chain.scope @@ -0,0 +1,19 @@ +foo().bar(); +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:5 + >-----< +0| foo().bar(); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 0:0-0:11 + >-----------< +0| foo().bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/functionCall.method.scope b/data/fixtures/scopes/rust/functionCall.method.scope new file mode 100644 index 0000000000..87d426d2ed --- /dev/null +++ b/data/fixtures/scopes/rust/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/functionCall.scope b/data/fixtures/scopes/rust/functionCall.scope new file mode 100644 index 0000000000..633f02ca5e --- /dev/null +++ b/data/fixtures/scopes/rust/functionCall.scope @@ -0,0 +1,10 @@ +foo(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:5 + >-----< +0| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/functionCallee.chain.scope b/data/fixtures/scopes/rust/functionCallee.chain.scope new file mode 100644 index 0000000000..b4a1e073a1 --- /dev/null +++ b/data/fixtures/scopes/rust/functionCallee.chain.scope @@ -0,0 +1,25 @@ +foo().bar(); +--- + +[#1 Content] = +[#1 Removal] = 0:0-0:3 + >---< +0| foo().bar(); + +[#1 Domain] = 0:0-0:5 + >-----< +0| foo().bar(); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:0-0:9 + >---------< +0| foo().bar(); + +[#2 Domain] = 0:0-0:11 + >-----------< +0| foo().bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/functionCallee.method.scope b/data/fixtures/scopes/rust/functionCallee.method.scope new file mode 100644 index 0000000000..f30f0f7536 --- /dev/null +++ b/data/fixtures/scopes/rust/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar(); +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar(); + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/functionCallee.scope b/data/fixtures/scopes/rust/functionCallee.scope new file mode 100644 index 0000000000..3071a48ae9 --- /dev/null +++ b/data/fixtures/scopes/rust/functionCallee.scope @@ -0,0 +1,13 @@ +foo(); +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo(); + +[Domain] = 0:0-0:5 + >-----< +0| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.class.scope b/data/fixtures/scopes/rust/interior/interior.class.scope new file mode 100644 index 0000000000..f391190cee --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.class.scope @@ -0,0 +1,10 @@ +impl Foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:10-0:11 + >-< +0| impl Foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.class2.scope b/data/fixtures/scopes/rust/interior/interior.class2.scope new file mode 100644 index 0000000000..a55e2a0d9f --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.class2.scope @@ -0,0 +1,10 @@ +struct Foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:12-0:13 + >-< +0| struct Foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.class3.scope b/data/fixtures/scopes/rust/interior/interior.class3.scope new file mode 100644 index 0000000000..15d6d40b91 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.class3.scope @@ -0,0 +1,10 @@ +trait Foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:11-0:12 + >-< +0| trait Foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.enum.scope b/data/fixtures/scopes/rust/interior/interior.enum.scope new file mode 100644 index 0000000000..d96875b078 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.enum.scope @@ -0,0 +1,10 @@ +enum Foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:10-0:11 + >-< +0| enum Foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.foreach.scope b/data/fixtures/scopes/rust/interior/interior.foreach.scope new file mode 100644 index 0000000000..b1842875b3 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.foreach.scope @@ -0,0 +1,10 @@ +for v in values { } +--- + +[Content] = +[Removal] = +[Domain] = 0:17-0:18 + >-< +0| for v in values { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.function.scope b/data/fixtures/scopes/rust/interior/interior.function.scope new file mode 100644 index 0000000000..e8ecdcb34f --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.function.scope @@ -0,0 +1,10 @@ +fn foo() { } +--- + +[Content] = +[Removal] = +[Domain] = 0:10-0:11 + >-< +0| fn foo() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.if.scope b/data/fixtures/scopes/rust/interior/interior.if.scope new file mode 100644 index 0000000000..17d16599d5 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.if.scope @@ -0,0 +1,30 @@ +if true { } +else if false { } +else { } +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:9-0:10 + >-< +0| if true { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:15-1:16 + >-< +1| else if false { } + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:6-2:7 + >-< +2| else { } + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.lambda.scope b/data/fixtures/scopes/rust/interior/interior.lambda.scope new file mode 100644 index 0000000000..37a2c33c14 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.lambda.scope @@ -0,0 +1,10 @@ +|| { } +--- + +[Content] = +[Removal] = +[Domain] = 0:4-0:5 + >-< +0| || { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.method.scope b/data/fixtures/scopes/rust/interior/interior.method.scope new file mode 100644 index 0000000000..ecd527e87b --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.method.scope @@ -0,0 +1,27 @@ +impl Foo { + fn bar() { } +} +--- + +[#1 Content] = 1:4-1:16 + >------------< +1| fn bar() { } + +[#1 Removal] = +[#1 Domain] = 0:10-2:0 + > +0| impl Foo { +1| fn bar() { } +2| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:14-1:15 + >-< +1| fn bar() { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.namespace.scope b/data/fixtures/scopes/rust/interior/interior.namespace.scope new file mode 100644 index 0000000000..6afc6655d5 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.namespace.scope @@ -0,0 +1,10 @@ +mod foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:9-0:10 + >-< +0| mod foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.switch.scope b/data/fixtures/scopes/rust/interior/interior.switch.scope new file mode 100644 index 0000000000..30aba7513d --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.switch.scope @@ -0,0 +1,10 @@ +match foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:11-0:12 + >-< +0| match foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.switchCase.scope b/data/fixtures/scopes/rust/interior/interior.switchCase.scope new file mode 100644 index 0000000000..4d3fa56172 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.switchCase.scope @@ -0,0 +1,55 @@ +match foo { + 0 => 0, + 1 => { } + _ => { } +} +--- + +[#1 Content] = 1:4-3:12 + >------- +1| 0 => 0, +2| 1 => { } +3| _ => { } + ------------< + +[#1 Removal] = +[#1 Domain] = 0:11-4:0 + > +0| match foo { +1| 0 => 0, +2| 1 => { } +3| _ => { } +4| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:9-1:11 + >--< +1| 0 => 0, + +[#2 Removal] = +[#2 Domain] = 1:8-1:11 + >---< +1| 0 => 0, + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:10-2:11 + >-< +2| 1 => { } + +[#3 Insertion delimiter] = " " + + +[#4 Content] = +[#4 Removal] = +[#4 Domain] = 3:10-3:11 + >-< +3| _ => { } + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/interior/interior.while.scope b/data/fixtures/scopes/rust/interior/interior.while.scope new file mode 100644 index 0000000000..6dfa42367e --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.while.scope @@ -0,0 +1,10 @@ +while true { } +--- + +[Content] = +[Removal] = +[Domain] = 0:12-0:13 + >-< +0| while true { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/list.scope b/data/fixtures/scopes/rust/list.scope new file mode 100644 index 0000000000..2671d6c135 --- /dev/null +++ b/data/fixtures/scopes/rust/list.scope @@ -0,0 +1,17 @@ +let foo = [1, 2, 3]; +--- + +[Content] = +[Domain] = 0:10-0:19 + >---------< +0| let foo = [1, 2, 3]; + +[Removal] = 0:9-0:19 + >----------< +0| let foo = [1, 2, 3]; + +[Leading delimiter] = 0:9-0:10 + >-< +0| let foo = [1, 2, 3]; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/list2.scope b/data/fixtures/scopes/rust/list2.scope new file mode 100644 index 0000000000..1689e4bd5a --- /dev/null +++ b/data/fixtures/scopes/rust/list2.scope @@ -0,0 +1,17 @@ +let foo = (1, "2", true); +--- + +[Content] = +[Domain] = 0:10-0:24 + >--------------< +0| let foo = (1, "2", true); + +[Removal] = 0:9-0:24 + >---------------< +0| let foo = (1, "2", true); + +[Leading delimiter] = 0:9-0:10 + >-< +0| let foo = (1, "2", true); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope new file mode 100644 index 0000000000..ec682e0119 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope @@ -0,0 +1,13 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| fn foo(aaa: i32, bbb: i32) {} + + +[#2 Content] = +[#2 Domain] = 0:7-0:25 + >------------------< +0| fn foo(aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..f6b915c7da --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope @@ -0,0 +1,27 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:1 + >---------- +0| impl Foo { +1| fn bar(&self, aaa: i32, bbb: i32) {} +2| } + -< + + +[#2 Content] = +[#2 Domain] = 0:10-2:0 + > +0| impl Foo { +1| fn bar(&self, aaa: i32, bbb: i32) {} +2| } + < + + +[#3 Content] = +[#3 Domain] = 1:11-1:36 + >-------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/name/name.argument.formal.method.scope b/data/fixtures/scopes/rust/name/name.argument.formal.method.scope new file mode 100644 index 0000000000..aaf0b5ad56 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.argument.formal.method.scope @@ -0,0 +1,83 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[#1 Content] = 0:5-0:8 + >---< +0| impl Foo { + +[#1 Removal] = 0:5-0:9 + >----< +0| impl Foo { + +[#1 Leading delimiter] = 0:4-0:5 + >-< +0| impl Foo { + +[#1 Trailing delimiter] = 0:8-0:9 + >-< +0| impl Foo { + +[#1 Domain] = 0:0-2:1 + >---------- +0| impl Foo { +1| fn bar(&self, aaa: i32, bbb: i32) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:7-1:10 + >---< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Leading delimiter] = 1:6-1:7 + >-< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Domain] = 1:4-1:40 + >------------------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:18-1:21 + >---< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Removal] = 1:17-1:21 + >----< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Leading delimiter] = 1:17-1:18 + >-< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Domain] = 1:18-1:26 + >--------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 1:28-1:31 + >---< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#4 Removal] = 1:27-1:31 + >----< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#4 Leading delimiter] = 1:27-1:28 + >-< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#4 Domain] = 1:28-1:36 + >--------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.argument.formal.scope b/data/fixtures/scopes/rust/name/name.argument.formal.scope new file mode 100644 index 0000000000..5f8b25f7e9 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.argument.formal.scope @@ -0,0 +1,48 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[#1 Content] = +[#1 Removal] = 0:3-0:6 + >---< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Leading delimiter] = 0:2-0:3 + >-< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:7-0:10 + >---< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Domain] = 0:7-0:15 + >--------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:17-0:20 + >---< +0| fn foo(aaa: i32, bbb: i32) {} + +[#3 Removal] = 0:16-0:20 + >----< +0| fn foo(aaa: i32, bbb: i32) {} + +[#3 Leading delimiter] = 0:16-0:17 + >-< +0| fn foo(aaa: i32, bbb: i32) {} + +[#3 Domain] = 0:17-0:25 + >--------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.assignment.pattern.scope b/data/fixtures/scopes/rust/name/name.assignment.pattern.scope new file mode 100644 index 0000000000..a28aa961ee --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.assignment.pattern.scope @@ -0,0 +1,20 @@ +{ foo: bar } = baz; +--- + +[Content] = 0:0-0:12 + >------------< +0| { foo: bar } = baz; + +[Removal] = 0:0-0:15 + >---------------< +0| { foo: bar } = baz; + +[Trailing delimiter] = 0:12-0:15 + >---< +0| { foo: bar } = baz; + +[Domain] = 0:0-0:19 + >-------------------< +0| { foo: bar } = baz; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.assignment.scope b/data/fixtures/scopes/rust/name/name.assignment.scope new file mode 100644 index 0000000000..d516138753 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.assignment.scope @@ -0,0 +1,20 @@ +foo = 0; +--- + +[Content] = 0:0-0:3 + >---< +0| foo = 0; + +[Removal] = 0:0-0:6 + >------< +0| foo = 0; + +[Trailing delimiter] = 0:3-0:6 + >---< +0| foo = 0; + +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.class.scope b/data/fixtures/scopes/rust/name/name.class.scope new file mode 100644 index 0000000000..dedafe1ef0 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.class.scope @@ -0,0 +1,24 @@ +impl Foo {} +--- + +[Content] = 0:5-0:8 + >---< +0| impl Foo {} + +[Removal] = 0:5-0:9 + >----< +0| impl Foo {} + +[Leading delimiter] = 0:4-0:5 + >-< +0| impl Foo {} + +[Trailing delimiter] = 0:8-0:9 + >-< +0| impl Foo {} + +[Domain] = 0:0-0:11 + >-----------< +0| impl Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.class2.scope b/data/fixtures/scopes/rust/name/name.class2.scope new file mode 100644 index 0000000000..e727dcc514 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.class2.scope @@ -0,0 +1,24 @@ +impl Foo for Bar {} +--- + +[Content] = 0:5-0:8 + >---< +0| impl Foo for Bar {} + +[Removal] = 0:5-0:9 + >----< +0| impl Foo for Bar {} + +[Leading delimiter] = 0:4-0:5 + >-< +0| impl Foo for Bar {} + +[Trailing delimiter] = 0:8-0:9 + >-< +0| impl Foo for Bar {} + +[Domain] = 0:0-0:19 + >-------------------< +0| impl Foo for Bar {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.enum.scope b/data/fixtures/scopes/rust/name/name.enum.scope new file mode 100644 index 0000000000..09d2849071 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.enum.scope @@ -0,0 +1,24 @@ +enum Foo {} +--- + +[Content] = 0:5-0:8 + >---< +0| enum Foo {} + +[Removal] = 0:5-0:9 + >----< +0| enum Foo {} + +[Leading delimiter] = 0:4-0:5 + >-< +0| enum Foo {} + +[Trailing delimiter] = 0:8-0:9 + >-< +0| enum Foo {} + +[Domain] = 0:0-0:11 + >-----------< +0| enum Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.field.class.scope b/data/fixtures/scopes/rust/name/name.field.class.scope new file mode 100644 index 0000000000..4b850b0b22 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.field.class.scope @@ -0,0 +1,48 @@ +struct Foo { + bar: i32 +} +--- + +[#1 Content] = 0:7-0:10 + >---< +0| struct Foo { + +[#1 Removal] = 0:7-0:11 + >----< +0| struct Foo { + +[#1 Leading delimiter] = 0:6-0:7 + >-< +0| struct Foo { + +[#1 Trailing delimiter] = 0:10-0:11 + >-< +0| struct Foo { + +[#1 Domain] = 0:0-2:1 + >------------ +0| struct Foo { +1| bar: i32 +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar: i32 + +[#2 Removal] = 1:0-1:7 + >-------< +1| bar: i32 + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: i32 + +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: i32 + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.field.enum.scope b/data/fixtures/scopes/rust/name/name.field.enum.scope new file mode 100644 index 0000000000..375c265add --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.field.enum.scope @@ -0,0 +1,65 @@ +enum Foo { + bar, + baz +} +--- + +[#1 Content] = 0:5-0:8 + >---< +0| enum Foo { + +[#1 Removal] = 0:5-0:9 + >----< +0| enum Foo { + +[#1 Leading delimiter] = 0:4-0:5 + >-< +0| enum Foo { + +[#1 Trailing delimiter] = 0:8-0:9 + >-< +0| enum Foo { + +[#1 Domain] = 0:0-3:1 + >---------- +0| enum Foo { +1| bar, +2| baz +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Domain] = 1:4-1:7 + >---< +1| bar, + +[#2 Removal] = 1:0-1:7 + >-------< +1| bar, + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar, + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Domain] = 2:4-2:7 + >---< +2| baz + +[#3 Removal] = 2:0-3:0 + >------- +2| baz +3| } + < + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| baz + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.foreach.scope b/data/fixtures/scopes/rust/name/name.foreach.scope new file mode 100644 index 0000000000..76a1dd8dda --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.foreach.scope @@ -0,0 +1,24 @@ +for v in values {} +--- + +[Content] = 0:4-0:5 + >-< +0| for v in values {} + +[Removal] = 0:4-0:6 + >--< +0| for v in values {} + +[Leading delimiter] = 0:3-0:4 + >-< +0| for v in values {} + +[Trailing delimiter] = 0:5-0:6 + >-< +0| for v in values {} + +[Domain] = 0:0-0:18 + >------------------< +0| for v in values {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.function.scope b/data/fixtures/scopes/rust/name/name.function.scope new file mode 100644 index 0000000000..9220e11ce3 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.function.scope @@ -0,0 +1,17 @@ +fn foo() {} +--- + +[Content] = +[Removal] = 0:3-0:6 + >---< +0| fn foo() {} + +[Leading delimiter] = 0:2-0:3 + >-< +0| fn foo() {} + +[Domain] = 0:0-0:11 + >-----------< +0| fn foo() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.iteration.block.scope b/data/fixtures/scopes/rust/name/name.iteration.block.scope new file mode 100644 index 0000000000..0dd2679954 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.block.scope @@ -0,0 +1,13 @@ +fn foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| fn foo() { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| fn foo() { } diff --git a/data/fixtures/scopes/rust/name/name.iteration.block2.scope b/data/fixtures/scopes/rust/name/name.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/rust/name/name.iteration.block3.scope b/data/fixtures/scopes/rust/name/name.iteration.block3.scope new file mode 100644 index 0000000000..e7b3236d45 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.block3.scope @@ -0,0 +1,13 @@ +while true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| while true { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| while true { } diff --git a/data/fixtures/scopes/rust/name/name.iteration.class.scope b/data/fixtures/scopes/rust/name/name.iteration.class.scope new file mode 100644 index 0000000000..cc995e40df --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.class.scope @@ -0,0 +1,13 @@ +impl Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| impl Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| impl Foo { } diff --git a/data/fixtures/scopes/rust/name/name.iteration.class2.scope b/data/fixtures/scopes/rust/name/name.iteration.class2.scope new file mode 100644 index 0000000000..10699070e9 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.class2.scope @@ -0,0 +1,13 @@ +struct Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| struct Foo { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| struct Foo { } diff --git a/data/fixtures/scopes/rust/name/name.iteration.class3.scope b/data/fixtures/scopes/rust/name/name.iteration.class3.scope new file mode 100644 index 0000000000..4c8fb724a6 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.class3.scope @@ -0,0 +1,13 @@ +trait Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| trait Foo { } + + +[#2 Content] = +[#2 Domain] = 0:11-0:12 + >-< +0| trait Foo { } diff --git a/data/fixtures/scopes/rust/name/name.iteration.document.scope b/data/fixtures/scopes/rust/name/name.iteration.document.scope new file mode 100644 index 0000000000..06aef70af3 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.document.scope @@ -0,0 +1,12 @@ + +impl Foo {} + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| impl Foo {} +2| + < diff --git a/data/fixtures/scopes/rust/name/name.iteration.enum.scope b/data/fixtures/scopes/rust/name/name.iteration.enum.scope new file mode 100644 index 0000000000..9034c4ee11 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.enum.scope @@ -0,0 +1,13 @@ +enum Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| enum Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| enum Foo { } diff --git a/data/fixtures/scopes/rust/name/name.method.scope b/data/fixtures/scopes/rust/name/name.method.scope new file mode 100644 index 0000000000..b6a6fe7c56 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.method.scope @@ -0,0 +1,45 @@ +impl Foo { + fn bar() {} +} +--- + +[#1 Content] = 0:5-0:8 + >---< +0| impl Foo { + +[#1 Removal] = 0:5-0:9 + >----< +0| impl Foo { + +[#1 Leading delimiter] = 0:4-0:5 + >-< +0| impl Foo { + +[#1 Trailing delimiter] = 0:8-0:9 + >-< +0| impl Foo { + +[#1 Domain] = 0:0-2:1 + >---------- +0| impl Foo { +1| fn bar() {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:7-1:10 + >---< +1| fn bar() {} + +[#2 Leading delimiter] = 1:6-1:7 + >-< +1| fn bar() {} + +[#2 Domain] = 1:4-1:15 + >-----------< +1| fn bar() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.namespace.scope b/data/fixtures/scopes/rust/name/name.namespace.scope new file mode 100644 index 0000000000..dd3d5a9f27 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.namespace.scope @@ -0,0 +1,24 @@ +mod foo {} +--- + +[Content] = 0:4-0:7 + >---< +0| mod foo {} + +[Removal] = 0:4-0:8 + >----< +0| mod foo {} + +[Leading delimiter] = 0:3-0:4 + >-< +0| mod foo {} + +[Trailing delimiter] = 0:7-0:8 + >-< +0| mod foo {} + +[Domain] = 0:0-0:10 + >----------< +0| mod foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.variable.pattern.scope b/data/fixtures/scopes/rust/name/name.variable.pattern.scope new file mode 100644 index 0000000000..a28aa961ee --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.variable.pattern.scope @@ -0,0 +1,20 @@ +{ foo: bar } = baz; +--- + +[Content] = 0:0-0:12 + >------------< +0| { foo: bar } = baz; + +[Removal] = 0:0-0:15 + >---------------< +0| { foo: bar } = baz; + +[Trailing delimiter] = 0:12-0:15 + >---< +0| { foo: bar } = baz; + +[Domain] = 0:0-0:19 + >-------------------< +0| { foo: bar } = baz; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.variable.scope b/data/fixtures/scopes/rust/name/name.variable.scope new file mode 100644 index 0000000000..9cb426ea51 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.variable.scope @@ -0,0 +1,24 @@ +let foo = 0; +--- + +[Content] = 0:4-0:7 + >---< +0| let foo = 0; + +[Removal] = 0:4-0:8 + >----< +0| let foo = 0; + +[Leading delimiter] = 0:3-0:4 + >-< +0| let foo = 0; + +[Trailing delimiter] = 0:7-0:8 + >-< +0| let foo = 0; + +[Domain] = 0:0-0:12 + >------------< +0| let foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope b/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope new file mode 100644 index 0000000000..cc995e40df --- /dev/null +++ b/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope @@ -0,0 +1,13 @@ +impl Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| impl Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| impl Foo { } diff --git a/data/fixtures/scopes/rust/namedFunction.iteration.class.scope b/data/fixtures/scopes/rust/namedFunction.iteration.class.scope new file mode 100644 index 0000000000..cc995e40df --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.iteration.class.scope @@ -0,0 +1,13 @@ +impl Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| impl Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| impl Foo { } diff --git a/data/fixtures/scopes/rust/namedFunction.iteration.document.scope b/data/fixtures/scopes/rust/namedFunction.iteration.document.scope new file mode 100644 index 0000000000..34670717b3 --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.iteration.document.scope @@ -0,0 +1,12 @@ + +fn foo() {} + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| fn foo() {} +2| + < diff --git a/data/fixtures/scopes/rust/namedFunction.method.scope b/data/fixtures/scopes/rust/namedFunction.method.scope new file mode 100644 index 0000000000..67248e9d40 --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.method.scope @@ -0,0 +1,21 @@ +impl Foo { + fn bar() {} +} +--- + +[Content] = +[Domain] = 1:4-1:15 + >-----------< +1| fn bar() {} + +[Removal] = 1:0-2:0 + >--------------- +1| fn bar() {} +2| } + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| fn bar() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/rust/namedFunction.scope b/data/fixtures/scopes/rust/namedFunction.scope new file mode 100644 index 0000000000..d847115c79 --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.scope @@ -0,0 +1,10 @@ +fn foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| fn foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/rust/statement/statement.assignment.scope b/data/fixtures/scopes/rust/statement/statement.assignment.scope new file mode 100644 index 0000000000..552bf9f507 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.break.scope b/data/fixtures/scopes/rust/statement/statement.break.scope new file mode 100644 index 0000000000..5bc394c171 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.break.scope @@ -0,0 +1,10 @@ +break; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:6 + >------< +0| break; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.class.scope b/data/fixtures/scopes/rust/statement/statement.class.scope new file mode 100644 index 0000000000..6031e72b81 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.class.scope @@ -0,0 +1,10 @@ +impl Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| impl Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.class2.scope b/data/fixtures/scopes/rust/statement/statement.class2.scope new file mode 100644 index 0000000000..823d046f92 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.class2.scope @@ -0,0 +1,10 @@ +struct Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| struct Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.class3.scope b/data/fixtures/scopes/rust/statement/statement.class3.scope new file mode 100644 index 0000000000..3f12024ea6 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.class3.scope @@ -0,0 +1,10 @@ +trait Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| trait Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.continue.scope b/data/fixtures/scopes/rust/statement/statement.continue.scope new file mode 100644 index 0000000000..d6ef1a4919 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.continue.scope @@ -0,0 +1,10 @@ +continue; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| continue; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.enum.scope b/data/fixtures/scopes/rust/statement/statement.enum.scope new file mode 100644 index 0000000000..88dd9cd028 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.enum.scope @@ -0,0 +1,10 @@ +enum Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| enum Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.field.class.scope b/data/fixtures/scopes/rust/statement/statement.field.class.scope new file mode 100644 index 0000000000..e9fa5577a4 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.field.class.scope @@ -0,0 +1,33 @@ +struct Foo { + bar: i32 +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------------ +0| struct Foo { +1| bar: i32 +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: i32 + +[#2 Removal] = 1:0-2:0 + >------------ +1| bar: i32 +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: i32 + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.foreach.scope b/data/fixtures/scopes/rust/statement/statement.foreach.scope new file mode 100644 index 0000000000..823a899261 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for v in values {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| for v in values {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.function.scope b/data/fixtures/scopes/rust/statement/statement.function.scope new file mode 100644 index 0000000000..6df3e3378c --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.function.scope @@ -0,0 +1,10 @@ +fn foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| fn foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.if.scope b/data/fixtures/scopes/rust/statement/statement.if.scope new file mode 100644 index 0000000000..e0d492e889 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.if.scope @@ -0,0 +1,15 @@ +if true {} +else if false {} +else {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-2:7 + >---------- +0| if true {} +1| else if false {} +2| else {} + -------< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.block.scope b/data/fixtures/scopes/rust/statement/statement.iteration.block.scope new file mode 100644 index 0000000000..0dd2679954 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block.scope @@ -0,0 +1,13 @@ +fn foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| fn foo() { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| fn foo() { } diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.block2.scope b/data/fixtures/scopes/rust/statement/statement.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.block3.scope b/data/fixtures/scopes/rust/statement/statement.iteration.block3.scope new file mode 100644 index 0000000000..e7b3236d45 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block3.scope @@ -0,0 +1,13 @@ +while true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| while true { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| while true { } diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.class.scope b/data/fixtures/scopes/rust/statement/statement.iteration.class.scope new file mode 100644 index 0000000000..cc995e40df --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.class.scope @@ -0,0 +1,13 @@ +impl Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| impl Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| impl Foo { } diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.class2.scope b/data/fixtures/scopes/rust/statement/statement.iteration.class2.scope new file mode 100644 index 0000000000..10699070e9 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.class2.scope @@ -0,0 +1,13 @@ +struct Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| struct Foo { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| struct Foo { } diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.class3.scope b/data/fixtures/scopes/rust/statement/statement.iteration.class3.scope new file mode 100644 index 0000000000..4c8fb724a6 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.class3.scope @@ -0,0 +1,13 @@ +trait Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| trait Foo { } + + +[#2 Content] = +[#2 Domain] = 0:11-0:12 + >-< +0| trait Foo { } diff --git a/data/fixtures/scopes/rust/statement/statement.iteration.document.scope b/data/fixtures/scopes/rust/statement/statement.iteration.document.scope new file mode 100644 index 0000000000..62106ef21a --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.document.scope @@ -0,0 +1,12 @@ + +let foo = 0; + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| let foo = 0; +2| + < diff --git a/data/fixtures/scopes/rust/statement/statement.method.scope b/data/fixtures/scopes/rust/statement/statement.method.scope new file mode 100644 index 0000000000..77c7c405a9 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.method.scope @@ -0,0 +1,33 @@ +impl Foo { + fn bar() {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------- +0| impl Foo { +1| fn bar() {} +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:15 + >-----------< +1| fn bar() {} + +[#2 Removal] = 1:0-2:0 + >--------------- +1| fn bar() {} +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| fn bar() {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.namespace.scope b/data/fixtures/scopes/rust/statement/statement.namespace.scope new file mode 100644 index 0000000000..5816f83443 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.namespace.scope @@ -0,0 +1,10 @@ +mod foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:10 + >----------< +0| mod foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.return.scope b/data/fixtures/scopes/rust/statement/statement.return.scope new file mode 100644 index 0000000000..4a89bd1051 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.return.scope @@ -0,0 +1,33 @@ +fn foo() { + return 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------- +0| fn foo() { +1| return 0; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| return 0; + +[#2 Removal] = 1:0-2:0 + >------------- +1| return 0; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.switch.scope b/data/fixtures/scopes/rust/statement/statement.switch.scope new file mode 100644 index 0000000000..4514996a58 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.switch.scope @@ -0,0 +1,10 @@ +match foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| match foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.variable.scope b/data/fixtures/scopes/rust/statement/statement.variable.scope new file mode 100644 index 0000000000..cebc33100e --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.variable.scope @@ -0,0 +1,10 @@ +let foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| let foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.while.scope b/data/fixtures/scopes/rust/statement/statement.while.scope new file mode 100644 index 0000000000..fbccae0780 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.while.scope @@ -0,0 +1,10 @@ +while true {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| while true {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/string.multiLine.scope b/data/fixtures/scopes/rust/string.multiLine.scope new file mode 100644 index 0000000000..e8f7baaa0a --- /dev/null +++ b/data/fixtures/scopes/rust/string.multiLine.scope @@ -0,0 +1,13 @@ +"Hello +world" +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:6 + >------ +0| "Hello +1| world" + ------< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/textFragment.comment.block.scope b/data/fixtures/scopes/rust/textFragment.comment.block.scope new file mode 100644 index 0000000000..af33f95d00 --- /dev/null +++ b/data/fixtures/scopes/rust/textFragment.comment.block.scope @@ -0,0 +1,10 @@ +/* Hello world */ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| /* Hello world */ + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/textFragment.comment.line.scope b/data/fixtures/scopes/rust/textFragment.comment.line.scope new file mode 100644 index 0000000000..ea0785d04c --- /dev/null +++ b/data/fixtures/scopes/rust/textFragment.comment.line.scope @@ -0,0 +1,10 @@ +// Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| // Hello world + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/textFragment.string.multiLine.scope b/data/fixtures/scopes/rust/textFragment.string.multiLine.scope new file mode 100644 index 0000000000..e549ddb4cf --- /dev/null +++ b/data/fixtures/scopes/rust/textFragment.string.multiLine.scope @@ -0,0 +1,13 @@ +"Hello +world" +--- + +[Content] = +[Removal] = +[Domain] = 0:1-1:5 + >------ +0| "Hello +1| world" + -----< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.alias.scope b/data/fixtures/scopes/rust/type/type.alias.scope new file mode 100644 index 0000000000..22f28eaf55 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.alias.scope @@ -0,0 +1,10 @@ +type Foo = Bar; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| type Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope b/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope new file mode 100644 index 0000000000..ec682e0119 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope @@ -0,0 +1,13 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| fn foo(aaa: i32, bbb: i32) {} + + +[#2 Content] = +[#2 Domain] = 0:7-0:25 + >------------------< +0| fn foo(aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..f6b915c7da --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope @@ -0,0 +1,27 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:1 + >---------- +0| impl Foo { +1| fn bar(&self, aaa: i32, bbb: i32) {} +2| } + -< + + +[#2 Content] = +[#2 Domain] = 0:10-2:0 + > +0| impl Foo { +1| fn bar(&self, aaa: i32, bbb: i32) {} +2| } + < + + +[#3 Content] = +[#3 Domain] = 1:11-1:36 + >-------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/type/type.argument.formal.method.scope b/data/fixtures/scopes/rust/type/type.argument.formal.method.scope new file mode 100644 index 0000000000..fa5355c4f3 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.argument.formal.method.scope @@ -0,0 +1,53 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------- +0| impl Foo { +1| fn bar(&self, aaa: i32, bbb: i32) {} +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:23-1:26 + >---< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Removal] = 1:21-1:26 + >-----< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Leading delimiter] = 1:21-1:23 + >--< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Domain] = 1:18-1:26 + >--------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 1:33-1:36 + >---< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Removal] = 1:31-1:36 + >-----< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Leading delimiter] = 1:31-1:33 + >--< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Domain] = 1:28-1:36 + >--------< +1| fn bar(&self, aaa: i32, bbb: i32) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.argument.formal.scope b/data/fixtures/scopes/rust/type/type.argument.formal.scope new file mode 100644 index 0000000000..a01af2d6e2 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.argument.formal.scope @@ -0,0 +1,39 @@ +fn foo(aaa: i32, bbb: i32) {} +--- + +[#1 Content] = 0:12-0:15 + >---< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Removal] = 0:10-0:15 + >-----< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Leading delimiter] = 0:10-0:12 + >--< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Domain] = 0:7-0:15 + >--------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:22-0:25 + >---< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Removal] = 0:20-0:25 + >-----< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Leading delimiter] = 0:20-0:22 + >--< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Domain] = 0:17-0:25 + >--------< +0| fn foo(aaa: i32, bbb: i32) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.cast.scope b/data/fixtures/scopes/rust/type/type.cast.scope new file mode 100644 index 0000000000..aba156739b --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.cast.scope @@ -0,0 +1,20 @@ +foo as i32 +--- + +[Content] = 0:7-0:10 + >---< +0| foo as i32 + +[Removal] = 0:3-0:10 + >-------< +0| foo as i32 + +[Leading delimiter] = 0:3-0:7 + >----< +0| foo as i32 + +[Domain] = 0:0-0:10 + >----------< +0| foo as i32 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.class.scope b/data/fixtures/scopes/rust/type/type.class.scope new file mode 100644 index 0000000000..fd99c224a2 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.class.scope @@ -0,0 +1,10 @@ +impl Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| impl Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.class2.scope b/data/fixtures/scopes/rust/type/type.class2.scope new file mode 100644 index 0000000000..3980a2afac --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.class2.scope @@ -0,0 +1,10 @@ +struct Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| struct Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.class3.scope b/data/fixtures/scopes/rust/type/type.class3.scope new file mode 100644 index 0000000000..2489275c89 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.class3.scope @@ -0,0 +1,10 @@ +trait Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| trait Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.class4.scope b/data/fixtures/scopes/rust/type/type.class4.scope new file mode 100644 index 0000000000..c909a1c5c6 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.class4.scope @@ -0,0 +1,30 @@ +impl Foo for Bar {} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:19 + >-------------------< +0| impl Foo for Bar {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Domain] = 0:13-0:16 + >---< +0| impl Foo for Bar {} + +[#2 Removal] = 0:13-0:17 + >----< +0| impl Foo for Bar {} + +[#2 Leading delimiter] = 0:12-0:13 + >-< +0| impl Foo for Bar {} + +[#2 Trailing delimiter] = 0:16-0:17 + >-< +0| impl Foo for Bar {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.enum.scope b/data/fixtures/scopes/rust/type/type.enum.scope new file mode 100644 index 0000000000..70c26e7b58 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.enum.scope @@ -0,0 +1,10 @@ +enum Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| enum Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.field.class.scope b/data/fixtures/scopes/rust/type/type.field.class.scope new file mode 100644 index 0000000000..2c9cea111d --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.field.class.scope @@ -0,0 +1,34 @@ +struct Foo { + bar: i32 +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >------------ +0| struct Foo { +1| bar: i32 +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:9-1:12 + >---< +1| bar: i32 + +[#2 Removal] = 1:7-1:12 + >-----< +1| bar: i32 + +[#2 Leading delimiter] = 1:7-1:9 + >--< +1| bar: i32 + +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: i32 + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.iteration.block.scope b/data/fixtures/scopes/rust/type/type.iteration.block.scope new file mode 100644 index 0000000000..0dd2679954 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.block.scope @@ -0,0 +1,13 @@ +fn foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| fn foo() { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| fn foo() { } diff --git a/data/fixtures/scopes/rust/type/type.iteration.block2.scope b/data/fixtures/scopes/rust/type/type.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/rust/type/type.iteration.block3.scope b/data/fixtures/scopes/rust/type/type.iteration.block3.scope new file mode 100644 index 0000000000..e7b3236d45 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.block3.scope @@ -0,0 +1,13 @@ +while true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| while true { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| while true { } diff --git a/data/fixtures/scopes/rust/type/type.iteration.class.scope b/data/fixtures/scopes/rust/type/type.iteration.class.scope new file mode 100644 index 0000000000..cc995e40df --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.class.scope @@ -0,0 +1,13 @@ +impl Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| impl Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| impl Foo { } diff --git a/data/fixtures/scopes/rust/type/type.iteration.class2.scope b/data/fixtures/scopes/rust/type/type.iteration.class2.scope new file mode 100644 index 0000000000..10699070e9 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.class2.scope @@ -0,0 +1,13 @@ +struct Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| struct Foo { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| struct Foo { } diff --git a/data/fixtures/scopes/rust/type/type.iteration.class3.scope b/data/fixtures/scopes/rust/type/type.iteration.class3.scope new file mode 100644 index 0000000000..4c8fb724a6 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.class3.scope @@ -0,0 +1,13 @@ +trait Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| trait Foo { } + + +[#2 Content] = +[#2 Domain] = 0:11-0:12 + >-< +0| trait Foo { } diff --git a/data/fixtures/scopes/rust/type/type.iteration.document.scope b/data/fixtures/scopes/rust/type/type.iteration.document.scope new file mode 100644 index 0000000000..020c95e845 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.document.scope @@ -0,0 +1,12 @@ + +let foo: i32 = 0; + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| let foo: i32 = 0; +2| + < diff --git a/data/fixtures/scopes/rust/type/type.return.scope b/data/fixtures/scopes/rust/type/type.return.scope new file mode 100644 index 0000000000..7f38760412 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.return.scope @@ -0,0 +1,20 @@ +fn foo() -> i32 {} +--- + +[Content] = 0:12-0:15 + >---< +0| fn foo() -> i32 {} + +[Removal] = 0:8-0:15 + >-------< +0| fn foo() -> i32 {} + +[Leading delimiter] = 0:8-0:12 + >----< +0| fn foo() -> i32 {} + +[Domain] = 0:0-0:18 + >------------------< +0| fn foo() -> i32 {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope b/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope new file mode 100644 index 0000000000..599325eb25 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope @@ -0,0 +1,13 @@ +let foo: Foo; +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:23 + >-----------------------< +0| let foo: Foo; + + +[#2 Content] = +[#2 Domain] = 0:13-0:21 + >--------< +0| let foo: Foo; diff --git a/data/fixtures/scopes/rust/type/type.typeArgument.scope b/data/fixtures/scopes/rust/type/type.typeArgument.scope new file mode 100644 index 0000000000..463399b631 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.typeArgument.scope @@ -0,0 +1,52 @@ +let foo: Foo; +--- + +[#1 Content] = 0:9-0:22 + >-------------< +0| let foo: Foo; + +[#1 Removal] = 0:7-0:22 + >---------------< +0| let foo: Foo; + +[#1 Leading delimiter] = 0:7-0:9 + >--< +0| let foo: Foo; + +[#1 Domain] = 0:0-0:23 + >-----------------------< +0| let foo: Foo; + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Domain] = 0:13-0:16 + >---< +0| let foo: Foo; + +[#2 Removal] = 0:13-0:18 + >-----< +0| let foo: Foo; + +[#2 Trailing delimiter] = 0:16-0:18 + >--< +0| let foo: Foo; + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 0:18-0:21 + >---< +0| let foo: Foo; + +[#3 Removal] = 0:16-0:21 + >-----< +0| let foo: Foo; + +[#3 Leading delimiter] = 0:16-0:18 + >--< +0| let foo: Foo; + +[#3 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/type/type.variable.scope b/data/fixtures/scopes/rust/type/type.variable.scope new file mode 100644 index 0000000000..db655fb406 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.variable.scope @@ -0,0 +1,20 @@ +let foo: i32 = 0; +--- + +[Content] = 0:9-0:12 + >---< +0| let foo: i32 = 0; + +[Removal] = 0:7-0:12 + >-----< +0| let foo: i32 = 0; + +[Leading delimiter] = 0:7-0:9 + >--< +0| let foo: i32 = 0; + +[Domain] = 0:0-0:17 + >-----------------< +0| let foo: i32 = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.assignment.scope b/data/fixtures/scopes/rust/value/value.assignment.scope new file mode 100644 index 0000000000..a614198096 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.assignment.scope @@ -0,0 +1,20 @@ +foo = 0; +--- + +[Content] = 0:6-0:7 + >-< +0| foo = 0; + +[Removal] = 0:3-0:7 + >----< +0| foo = 0; + +[Leading delimiter] = 0:3-0:6 + >---< +0| foo = 0; + +[Domain] = 0:0-0:8 + >--------< +0| foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.foreach.scope b/data/fixtures/scopes/rust/value/value.foreach.scope new file mode 100644 index 0000000000..d89b2cb282 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.foreach.scope @@ -0,0 +1,24 @@ +for v in values {} +--- + +[Content] = 0:9-0:15 + >------< +0| for v in values {} + +[Removal] = 0:9-0:16 + >-------< +0| for v in values {} + +[Leading delimiter] = 0:8-0:9 + >-< +0| for v in values {} + +[Trailing delimiter] = 0:15-0:16 + >-< +0| for v in values {} + +[Domain] = 0:0-0:18 + >------------------< +0| for v in values {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.iteration.block.scope b/data/fixtures/scopes/rust/value/value.iteration.block.scope new file mode 100644 index 0000000000..0dd2679954 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.block.scope @@ -0,0 +1,13 @@ +fn foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| fn foo() { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| fn foo() { } diff --git a/data/fixtures/scopes/rust/value/value.iteration.block2.scope b/data/fixtures/scopes/rust/value/value.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/rust/value/value.iteration.block3.scope b/data/fixtures/scopes/rust/value/value.iteration.block3.scope new file mode 100644 index 0000000000..e7b3236d45 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.block3.scope @@ -0,0 +1,13 @@ +while true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| while true { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| while true { } diff --git a/data/fixtures/scopes/rust/value/value.iteration.class.scope b/data/fixtures/scopes/rust/value/value.iteration.class.scope new file mode 100644 index 0000000000..cc995e40df --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.class.scope @@ -0,0 +1,13 @@ +impl Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:12 + >------------< +0| impl Foo { } + + +[#2 Content] = +[#2 Domain] = 0:10-0:11 + >-< +0| impl Foo { } diff --git a/data/fixtures/scopes/rust/value/value.iteration.class2.scope b/data/fixtures/scopes/rust/value/value.iteration.class2.scope new file mode 100644 index 0000000000..10699070e9 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.class2.scope @@ -0,0 +1,13 @@ +struct Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| struct Foo { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| struct Foo { } diff --git a/data/fixtures/scopes/rust/value/value.iteration.class3.scope b/data/fixtures/scopes/rust/value/value.iteration.class3.scope new file mode 100644 index 0000000000..4c8fb724a6 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.class3.scope @@ -0,0 +1,13 @@ +trait Foo { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:13 + >-------------< +0| trait Foo { } + + +[#2 Content] = +[#2 Domain] = 0:11-0:12 + >-< +0| trait Foo { } diff --git a/data/fixtures/scopes/rust/value/value.iteration.document.scope b/data/fixtures/scopes/rust/value/value.iteration.document.scope new file mode 100644 index 0000000000..62106ef21a --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.document.scope @@ -0,0 +1,12 @@ + +let foo = 0; + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| let foo = 0; +2| + < diff --git a/data/fixtures/scopes/rust/value/value.return.lambda.scope b/data/fixtures/scopes/rust/value/value.return.lambda.scope new file mode 100644 index 0000000000..7a63e59652 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.return.lambda.scope @@ -0,0 +1,17 @@ +|x| 0; +--- + +[Content] = +[Domain] = 0:4-0:5 + >-< +0| |x| 0; + +[Removal] = 0:3-0:5 + >--< +0| |x| 0; + +[Leading delimiter] = 0:3-0:4 + >-< +0| |x| 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.return.scope b/data/fixtures/scopes/rust/value/value.return.scope new file mode 100644 index 0000000000..782baca84f --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.return.scope @@ -0,0 +1,22 @@ +fn foo() { + return 0; +} +--- + +[Content] = 1:11-1:12 + >-< +1| return 0; + +[Removal] = 1:10-1:12 + >--< +1| return 0; + +[Leading delimiter] = 1:10-1:11 + >-< +1| return 0; + +[Domain] = 1:4-1:13 + >---------< +1| return 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.switch.scope b/data/fixtures/scopes/rust/value/value.switch.scope new file mode 100644 index 0000000000..35a0e165ee --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.switch.scope @@ -0,0 +1,24 @@ +match foo {} +--- + +[Content] = 0:6-0:9 + >---< +0| match foo {} + +[Removal] = 0:6-0:10 + >----< +0| match foo {} + +[Leading delimiter] = 0:5-0:6 + >-< +0| match foo {} + +[Trailing delimiter] = 0:9-0:10 + >-< +0| match foo {} + +[Domain] = 0:0-0:12 + >------------< +0| match foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.typeAlias.scope b/data/fixtures/scopes/rust/value/value.typeAlias.scope new file mode 100644 index 0000000000..c62e2987f5 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.typeAlias.scope @@ -0,0 +1,20 @@ +type Foo = Bar; +--- + +[Content] = 0:11-0:14 + >---< +0| type Foo = Bar; + +[Removal] = 0:8-0:14 + >------< +0| type Foo = Bar; + +[Leading delimiter] = 0:8-0:11 + >---< +0| type Foo = Bar; + +[Domain] = 0:0-0:15 + >---------------< +0| type Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.variable.scope b/data/fixtures/scopes/rust/value/value.variable.scope new file mode 100644 index 0000000000..f8b68f4784 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.variable.scope @@ -0,0 +1,20 @@ +let foo = 0; +--- + +[Content] = 0:10-0:11 + >-< +0| let foo = 0; + +[Removal] = 0:7-0:11 + >----< +0| let foo = 0; + +[Leading delimiter] = 0:7-0:10 + >---< +0| let foo = 0; + +[Domain] = 0:0-0:12 + >------------< +0| let foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/value/value.typeAlias.scope b/data/fixtures/scopes/typescript.core/value/value.typeAlias.scope index d40f63850b..c62e2987f5 100644 --- a/data/fixtures/scopes/typescript.core/value/value.typeAlias.scope +++ b/data/fixtures/scopes/typescript.core/value/value.typeAlias.scope @@ -5,12 +5,12 @@ type Foo = Bar; >---< 0| type Foo = Bar; -[Removal] = 0:10-0:14 - >----< +[Removal] = 0:8-0:14 + >------< 0| type Foo = Bar; -[Leading delimiter] = 0:10-0:11 - >-< +[Leading delimiter] = 0:8-0:11 + >---< 0| type Foo = Bar; [Domain] = 0:0-0:15 diff --git a/data/fixtures/scopes/typescript.core/value/value.typeAlias2.scope b/data/fixtures/scopes/typescript.core/value/value.typeAlias2.scope index e5574f747b..92db73b76c 100644 --- a/data/fixtures/scopes/typescript.core/value/value.typeAlias2.scope +++ b/data/fixtures/scopes/typescript.core/value/value.typeAlias2.scope @@ -5,12 +5,12 @@ export type For = Bar; >---< 0| export type For = Bar; -[Removal] = 0:17-0:21 - >----< +[Removal] = 0:15-0:21 + >------< 0| export type For = Bar; -[Leading delimiter] = 0:17-0:18 - >-< +[Leading delimiter] = 0:15-0:18 + >---< 0| export type For = Bar; [Domain] = 0:0-0:22 diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index c8e7f844a8..d94b98261d 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -1,12 +1,317 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -// eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const rustScopeSupport: LanguageScopeSupportFacetMap = { - ifStatement: supported, disqualifyDelimiter: supported, + anonymousFunction: supported, + list: supported, + + "argument.actual.singleLine": supported, + "argument.actual.multiLine": supported, + "argument.actual.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, + "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, + + "argumentList.actual.empty": supported, + "argumentList.actual.singleLine": supported, + "argumentList.actual.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.lambda.empty": supported, + "argumentList.formal.lambda.singleLine": supported, + "argumentList.formal.lambda.multiLine": supported, + "argumentList.formal.method.empty": supported, + "argumentList.formal.method.singleLine": supported, + "argumentList.formal.method.multiLine": supported, + + "branch.if": supported, + "branch.if.elif.else": supported, + "branch.if.else": supported, + "branch.if.iteration": supported, + "branch.switchCase": supported, + "branch.switchCase.iteration": supported, + + class: supported, + "class.iteration.document": supported, + + "comment.block": supported, + "comment.line": supported, + + "condition.if": supported, + "condition.switchCase": supported, + "condition.switchCase.iteration": supported, + "condition.while": supported, + + namedFunction: supported, + "namedFunction.method": supported, + "namedFunction.iteration.document": supported, + "namedFunction.iteration.class": supported, + + functionCall: supported, + "functionCall.method": supported, + "functionCall.chain": supported, + functionCallee: supported, + "functionCallee.method": supported, + "functionCallee.chain": supported, + + ifStatement: supported, + + "statement.class": supported, + "statement.enum": supported, + "statement.field.class": supported, + "statement.function": supported, + "statement.method": supported, + "statement.if": supported, + "statement.switch": supported, + "statement.foreach": supported, + "statement.while": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.namespace": supported, + "statement.iteration.document": supported, + "statement.iteration.class": supported, + "statement.iteration.block": supported, + "string.singleLine": supported, + "string.multiLine": supported, + + "textFragment.comment.block": supported, + "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, + "textFragment.string.multiLine": supported, + + "name.argument.formal": supported, + "name.argument.formal.iteration": supported, + "name.argument.formal.method": supported, + "name.argument.formal.method.iteration": supported, + "name.assignment": supported, + "name.assignment.pattern": supported, + "name.class": supported, + "name.enum": supported, + "name.field.class": supported, + "name.field.enum": supported, + "name.foreach": supported, + "name.function": supported, + "name.method": supported, + "name.namespace": supported, + "name.variable": supported, + "name.variable.pattern": supported, + "name.iteration.block": supported, + "name.iteration.class": supported, + "name.iteration.enum": supported, + "name.iteration.document": supported, + + "value.assignment": supported, + "value.foreach": supported, + "value.return": supported, + "value.return.lambda": supported, + "value.switch": supported, + "value.typeAlias": supported, + "value.variable": supported, + "value.iteration.block": supported, + "value.iteration.class": supported, + "value.iteration.document": supported, + + "type.argument.formal": supported, + "type.argument.formal.iteration": supported, + "type.argument.formal.method": supported, + "type.argument.formal.method.iteration": supported, + "type.class": supported, + "type.enum": supported, + "type.field.class": supported, + "type.return": supported, + "type.variable": supported, + "type.typeArgument": supported, + "type.typeArgument.iteration": supported, + "type.alias": supported, + "type.cast": supported, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.iteration.document": supported, + + "interior.class": supported, + "interior.enum": supported, + "interior.function": supported, + "interior.method": supported, + "interior.lambda": supported, + "interior.if": supported, + "interior.switch": supported, + "interior.switchCase": supported, + "interior.foreach": supported, + "interior.while": supported, + "interior.namespace": supported, + + /* UNSUPPORTED */ + + fieldAccess: unsupported, + + /* NOT APPLICABLE */ + + // Constructors + "namedFunction.constructor": notApplicable, + "statement.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "interior.constructor": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, + + // Element and tags + element: notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + "interior.element": notApplicable, + "textFragment.element": notApplicable, + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Section + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + + // Command + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + + // Resource syntax + "statement.resource": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "interior.resource": notApplicable, + + // Map literal + map: notApplicable, + "key.mapPair": notApplicable, + "key.mapPair.iteration": notApplicable, + "value.mapPair": notApplicable, + "value.mapPair.iteration": notApplicable, + + // Keyword argument + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Default argument value + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + + // For loop + "statement.for": notApplicable, + "condition.for": notApplicable, + "interior.for": notApplicable, + + // Do-while loop + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, + "interior.doWhile": notApplicable, + + // Try / catch + "statement.try": notApplicable, + "branch.try": notApplicable, + "branch.try.iteration": notApplicable, + "interior.try": notApplicable, + "argument.catch": notApplicable, + "name.argument.catch": notApplicable, + "type.argument.catch": notApplicable, + + // Branches and conditions + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + "condition.ternary": notApplicable, + + // Collection items without delimiters + "collectionItem.unenclosed.singleLine": notApplicable, + "collectionItem.unenclosed.multiLine": notApplicable, + "collectionItem.unenclosed.iteration": notApplicable, + + // Yield + "statement.yield": notApplicable, + "value.yield": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Enum field values + "value.field.enum": notApplicable, + "value.iteration.enum": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, + "value.field.class": notApplicable, + "type.foreach": notApplicable, + "class.iteration.block": notApplicable, + "value.variable.pattern": notApplicable, + environment: notApplicable, + regularExpression: notApplicable, + selector: notApplicable, + unit: notApplicable, + pairDelimiter: notApplicable, }; diff --git a/queries/rust.scm b/queries/rust.scm index 93e8cf1c1f..6ea1497fc8 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -9,10 +9,8 @@ (attribute_item) (const_item) (empty_statement) - (enum_item) (extern_crate_declaration) (foreign_mod_item) - (impl_item) (inner_attribute_item) (let_declaration) (macro_definition) @@ -21,8 +19,10 @@ (function_signature_item) (mod_item) (static_item) - (struct_item) (trait_item) + (struct_item) + (impl_item) + (enum_item) (type_item) (union_item) (use_declaration) @@ -32,10 +32,34 @@ (#type? @_dummy source_file block declaration_list) ) +( + (source_file) @statement.iteration @class.iteration @namedFunction.iteration + (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) +) +( + (source_file) @name.iteration @type.iteration @value.iteration + (#document-range! @name.iteration @value.iteration @type.iteration) +) + +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf @statement.iteration.start.endOf + "}" @interior.end.startOf @statement.iteration.end.startOf + . +) +(_ + . + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf + . +) + ;;!! if v < 0 {} ;;! ^^^^^^^^^^^ ( - (if_expression) @ifStatement @statement + (if_expression) @ifStatement @statement @branch.iteration (#not-parent-type? @ifStatement else_clause) ) @@ -96,24 +120,51 @@ (block_comment) ] @comment @textFragment -[ - (struct_item - name: (_) @name - ) - (enum_item - name: (_) @name +;;!! struct Foo {} +(struct_item + name: (_) @name +) @class @type @name.domain + +;;!! impl Foo {} +(impl_item + !trait + type: (_) @name +) @name.domain + +;;!! impl Foo for Bar {} +(impl_item + trait: (_) @name + type: (_) @type +) @name.domain + +;;!! impl Foo {} +(impl_item + body: (_ + "{" @namedFunction.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf ) -] @class @_.domain +) @class @type -(struct_expression) @class +;;!! enum Foo {} +(enum_item + name: (_) @name +) @class @type @name.domain +;;!! enum Foo { Bar, Baz } +;;! ^^^ ^^^ (enum_variant name: (_) @name -) @_.domain +) @name.domain +;;!! trait Foo {} (trait_item name: (_) @name -) @_.domain +) @class @type @name.domain + +;;!! mod foo {} +(mod_item + name: (_) @name +) @name.domain ;;!! fn foo() {} ;;! ^^^^^^^^^^^ @@ -126,7 +177,7 @@ (function_item parameters: (_) @_.leading.endOf return_type: (_)? @type -) @_.domain +) @type.domain ;;!! fn foo() {} ;;! ^ @@ -152,10 +203,11 @@ ) ) @_.domain +;;!! struct Foo { bar: u8 } (field_declaration name: (_) @name @type.leading.endOf type: (_) @type -) @_.domain +) @statement @_.domain ;;!! (t: &T, u: &U) ;;! ^ ^ @@ -176,14 +228,21 @@ (closure_expression) @anonymousFunction +;;!! let foo = [1, 2, 3]; +;;!! let foo = (1, "2", true); [ (array_expression) (tuple_expression) ] @list +;;!! match value {} (match_expression value: (_) @value -) @_.domain + body: (_ + "{" @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @branch.iteration.end.startOf @condition.iteration.end.startOf + ) +) @value.domain @branch.iteration.domain @condition.iteration.domain ;;!! #[derive(Debug)] ;;! ^^^^^^^^^^^^^^^^ @@ -239,6 +298,22 @@ value: (_) @value ) @_.domain +;;!! let foo: u8; +;;! ^^^ +;;! ^ +(let_declaration + pattern: (_) @name @type.leading.endOf + type: (_) @type + !value +) @_.domain + +(expression_statement + (assignment_expression + left: (_) @name @value.leading.start.endOf + right: (_) @value @name.trailing.start.startOf + ) +) @_.domain + ;;!! #[cfg_attr(feature = "foo")] ;;! ^^^^^^^ ;;! ^^^^^ @@ -249,8 +324,10 @@ ;;!! return 2; ;;! ^ -(return_expression - (_) @value +(expression_statement + (return_expression + (_) @value + ) ) @_.domain ;; Implicit return value at end of function body @@ -289,6 +366,13 @@ ) ) +;;!! |x| x + 1 +;;! ^^^^^^ +(closure_expression + body: (_) @value + (#not-type? @value block) +) + ;;!! while v < 0 {} ;;! ^^^^^ (while_expression @@ -302,9 +386,13 @@ value: (_) @condition.end ) @_.domain +;;!! match value { 5 => {} } +;;! ^^^^^^^ +(match_arm) @branch + ;;!! User { value } if value.use() => {} ;;! ^^^^^^^^^^^ -(_ +(match_arm (match_pattern (_) @_.leading.endOf . @@ -314,17 +402,19 @@ ;;!! match value { 5 => {} } ;;! ^^^^^^^ -(match_arm) @branch - -[ - (struct_item) - (trait_item) - (impl_item) -] @type +(match_arm + (match_pattern + !condition + ) @condition +) @condition.domain -(impl_item - type: (_) @type -) +;;!! match value { 5 => 0, } +;;! ^^^ +(match_arm + "=>" @interior.start.endOf + value: (_) @_dummy + (#not-type? @_dummy block) +) @interior.end.endOf (array_type element: (_) @type @@ -332,7 +422,7 @@ ;;!! fn foo(a: u32, b: u32) -> {} ;;! ^^^^^^ ^^^^^^ (_ - (parameters + parameters: (_ (_)? @_.leading.endOf . (_) @argumentOrParameter @@ -345,13 +435,33 @@ ;;!! fn foo(a: u32, b: u32) -> {} ;;! ^^^^^^^^^^^^^^ (_ - (parameters - "(" @argumentList.start.endOf @argumentOrParameter.iteration.start.endOf - ")" @argumentList.end.startOf @argumentOrParameter.iteration.end.startOf - ) @_dummy - (#empty-single-multi-delimiter! @argumentList.start.endOf @_dummy "" ", " ",\n") + parameters: (_ + [ + "(" + "|" + ] @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 +(_ + parameters: (_ + [ + "(" + "|" + ] @name.iteration.start.endOf @type.iteration.start.endOf + [ + ")" + "|" + ] @name.iteration.end.startOf @type.iteration.end.startOf + ) +) + ;;!! foo(aaa, bbb) ;;! ^^^ ^^^ (_ @@ -369,10 +479,11 @@ ;;! ^^^^^^^^ (_ (arguments - "(" @argumentList.start.endOf @argumentOrParameter.iteration.start.endOf - ")" @argumentList.end.startOf @argumentOrParameter.iteration.end.startOf - ) @_dummy - (#empty-single-multi-delimiter! @argumentList.start.endOf @_dummy "" ", " ",\n") + "(" @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 ;;!! enum E { C(u16, u16) } @@ -462,6 +573,43 @@ "where" @type.iteration.start.endOf ) @type.iteration.end.endOf @type.iteration.domain +;;!! for v in values {} +(for_expression + pattern: (_) @name + value: (_) @value +) @_.domain + +;;!! type Foo = Bar; +(type_item + name: (_) @value.leading.endOf + type: (_) @value +) @type @value.domain + +;;!! let foo: Foo; +;;! ^^^ ^^^ +(generic_type + (type_arguments + (_)? @_.leading.endOf + . + (_) @type + . + (_)? @_.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @type @_dummy ", " ",\n") +) + +;;!! ; +(type_arguments + "<" @type.iteration.start.endOf + ">" @type.iteration.end.startOf +) + +;;!! foo as i32 +(type_cast_expression + value: (_) @type.leading.endOf + type: (_) @type +) @_.domain + operator: [ "<" "<<" diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index c07fb24af0..02c8590100 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -213,17 +213,22 @@ ";"? @_.domain.end ) +;;!! type Foo = Bar; ( (type_alias_declaration + name: (_) @value.leading.endOf value: (_) @value - ) @_.domain - (#not-parent-type? @_.domain export_statement) + ) @value.domain + (#not-parent-type? @value.domain export_statement) ) + +;;!! export type Foo = Bar; (export_statement (type_alias_declaration + name: (_) @value.leading.endOf value: (_) @value ) -) @_.domain +) @value.domain [ (interface_declaration)