From 17fc126a31eec86104061aab6f10905992dee945 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 12:16:02 +0100 Subject: [PATCH 01/14] Started working on rust facets --- .../scopes/rust/anonymousFunction.scope | 2 + .../scopes/rust/anonymousFunction2.scope | 2 + .../argument/argument.actual.iteration.scope | 2 + .../argument.actual.method.iteration.scope | 2 + .../argument.actual.method.multiLine.scope | 5 + .../argument.actual.method.singleLine.scope | 2 + .../argument/argument.actual.multiLine.scope | 5 + .../argument/argument.actual.singleLine.scope | 2 + .../argument/argument.formal.iteration.scope | 2 + .../argument.formal.lambda.iteration.scope | 2 + .../argument.formal.lambda.iteration2.scope | 2 + .../argument.formal.lambda.multiLine.scope | 5 + .../argument.formal.lambda.multiLine2.scope | 5 + .../argument.formal.lambda.singleLine.scope | 2 + .../argument.formal.lambda.singleLine2.scope | 2 + .../argument.formal.method.iteration.scope | 4 + .../argument.formal.method.multiLine.scope | 8 + .../argument.formal.method.singleLine.scope | 4 + .../argument/argument.formal.multiLine.scope | 5 + .../argument/argument.formal.singleLine.scope | 2 + .../argumentList.actual.empty.scope | 2 + .../argumentList.actual.method.empty.scope | 2 + ...argumentList.actual.method.multiLine.scope | 5 + ...rgumentList.actual.method.singleLine.scope | 2 + .../argumentList.actual.multiLine.scope | 5 + .../argumentList.actual.singleLine.scope | 2 + .../argumentList.formal.empty.scope | 2 + .../argumentList.formal.lambda.empty.scope | 2 + ...argumentList.formal.lambda.multiLine.scope | 5 + ...rgumentList.formal.lambda.singleLine.scope | 2 + .../argumentList.formal.method.empty.scope | 4 + ...argumentList.formal.method.multiLine.scope | 8 + ...rgumentList.formal.method.singleLine.scope | 4 + .../argumentList.formal.multiLine.scope | 5 + .../argumentList.formal.singleLine.scope | 2 + .../scopes/rust/branch.if.elif.else.scope | 4 + .../fixtures/scopes/rust/branch.if.else.scope | 3 + .../scopes/rust/branch.if.iteration.scope | 4 + data/fixtures/scopes/rust/branch.if.scope | 2 + .../rust/branch.switchCase.iteration.scope | 2 + .../scopes/rust/branch.switchCase.scope | 5 + .../rust/class.iteration.document.scope | 4 + data/fixtures/scopes/rust/class.scope | 2 + data/fixtures/scopes/rust/comment.block.scope | 2 + data/fixtures/scopes/rust/comment.line.scope | 2 + data/fixtures/scopes/rust/condition.if.scope | 4 + .../rust/condition.switchCase.iteration.scope | 2 + .../scopes/rust/condition.switchCase.scope | 5 + .../scopes/rust/condition.while.scope | 2 + .../scopes/rust/functionCall.chain.scope | 2 + .../scopes/rust/functionCall.method.scope | 2 + data/fixtures/scopes/rust/functionCall.scope | 2 + .../scopes/rust/functionCallee.chain.scope | 2 + .../scopes/rust/functionCallee.method.scope | 2 + .../fixtures/scopes/rust/functionCallee.scope | 2 + .../fixtures/scopes/rust/interior.class.scope | 2 + data/fixtures/scopes/rust/interior.enum.scope | 2 + .../scopes/rust/interior.function.scope | 2 + data/fixtures/scopes/rust/interior.if.scope | 4 + .../scopes/rust/interior.interface.scope | 2 + .../scopes/rust/interior.method.scope | 4 + .../scopes/rust/interior.namespace.scope | 2 + .../scopes/rust/interior.switch.scope | 2 + .../fixtures/scopes/rust/interior.while.scope | 2 + data/fixtures/scopes/rust/list.scope | 2 + .../rust/name.argument.formal.iteration.scope | 2 + ...ame.argument.formal.method.iteration.scope | 4 + .../rust/name.argument.formal.method.scope | 4 + .../scopes/rust/name.argument.formal.scope | 2 + .../scopes/rust/name.assignment.pattern.scope | 2 + .../scopes/rust/name.assignment.scope | 2 + data/fixtures/scopes/rust/name.class.scope | 2 + data/fixtures/scopes/rust/name.enum.scope | 2 + .../scopes/rust/name.field.class.scope | 4 + .../scopes/rust/name.field.enum.scope | 5 + data/fixtures/scopes/rust/name.foreach.scope | 2 + data/fixtures/scopes/rust/name.function.scope | 2 + .../fixtures/scopes/rust/name.interface.scope | 2 + .../scopes/rust/name.iteration.class.scope | 2 + .../scopes/rust/name.iteration.document.scope | 4 + .../scopes/rust/name.iteration.enum.scope | 2 + .../rust/name.iteration.interface.scope | 2 + data/fixtures/scopes/rust/name.method.scope | 4 + .../fixtures/scopes/rust/name.namespace.scope | 2 + .../scopes/rust/name.variable.pattern.scope | 2 + data/fixtures/scopes/rust/name.variable.scope | 2 + .../rust/namedFunction.iteration.class.scope | 2 + .../namedFunction.iteration.document.scope | 4 + .../scopes/rust/namedFunction.method.scope | 4 + data/fixtures/scopes/rust/namedFunction.scope | 2 + .../scopes/rust/statement.assignment.scope | 2 + .../scopes/rust/statement.class.scope | 2 + .../fixtures/scopes/rust/statement.enum.scope | 5 + .../scopes/rust/statement.field.class.scope | 4 + .../scopes/rust/statement.foreach.scope | 2 + .../scopes/rust/statement.function.scope | 2 + data/fixtures/scopes/rust/statement.if.scope | 4 + .../scopes/rust/statement.interface.scope | 2 + .../rust/statement.iteration.class.scope | 2 + .../rust/statement.iteration.document.scope | 4 + .../rust/statement.iteration.interface.scope | 2 + .../scopes/rust/statement.method.scope | 4 + .../scopes/rust/statement.switch.scope | 2 + .../scopes/rust/statement.variable.scope | 2 + .../scopes/rust/statement.while.scope | 2 + .../rust/type.argument.formal.iteration.scope | 2 + ...ype.argument.formal.method.iteration.scope | 4 + .../rust/type.argument.formal.method.scope | 4 + .../scopes/rust/type.argument.formal.scope | 2 + data/fixtures/scopes/rust/type.class.scope | 2 + data/fixtures/scopes/rust/type.enum.scope | 2 + .../scopes/rust/type.field.class.scope | 4 + .../fixtures/scopes/rust/type.interface.scope | 2 + .../scopes/rust/type.iteration.class.scope | 2 + .../scopes/rust/type.iteration.document.scope | 4 + .../rust/type.iteration.interface.scope | 2 + data/fixtures/scopes/rust/type.return.scope | 2 + data/fixtures/scopes/rust/type.variable.scope | 2 + .../scopes/rust/value.assignment.scope | 2 + data/fixtures/scopes/rust/value.foreach.scope | 2 + data/fixtures/scopes/rust/value.switch.scope | 2 + .../fixtures/scopes/rust/value.variable.scope | 2 + .../common/src/scopeSupportFacets/rust.ts | 304 +++++++++++++++++- 123 files changed, 648 insertions(+), 2 deletions(-) create mode 100644 data/fixtures/scopes/rust/anonymousFunction.scope create mode 100644 data/fixtures/scopes/rust/anonymousFunction2.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.iteration.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.iteration.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope create mode 100644 data/fixtures/scopes/rust/branch.if.elif.else.scope create mode 100644 data/fixtures/scopes/rust/branch.if.else.scope create mode 100644 data/fixtures/scopes/rust/branch.if.iteration.scope create mode 100644 data/fixtures/scopes/rust/branch.if.scope create mode 100644 data/fixtures/scopes/rust/branch.switchCase.iteration.scope create mode 100644 data/fixtures/scopes/rust/branch.switchCase.scope create mode 100644 data/fixtures/scopes/rust/class.iteration.document.scope create mode 100644 data/fixtures/scopes/rust/class.scope create mode 100644 data/fixtures/scopes/rust/comment.block.scope create mode 100644 data/fixtures/scopes/rust/comment.line.scope create mode 100644 data/fixtures/scopes/rust/condition.if.scope create mode 100644 data/fixtures/scopes/rust/condition.switchCase.iteration.scope create mode 100644 data/fixtures/scopes/rust/condition.switchCase.scope create mode 100644 data/fixtures/scopes/rust/condition.while.scope create mode 100644 data/fixtures/scopes/rust/functionCall.chain.scope create mode 100644 data/fixtures/scopes/rust/functionCall.method.scope create mode 100644 data/fixtures/scopes/rust/functionCall.scope create mode 100644 data/fixtures/scopes/rust/functionCallee.chain.scope create mode 100644 data/fixtures/scopes/rust/functionCallee.method.scope create mode 100644 data/fixtures/scopes/rust/functionCallee.scope create mode 100644 data/fixtures/scopes/rust/interior.class.scope create mode 100644 data/fixtures/scopes/rust/interior.enum.scope create mode 100644 data/fixtures/scopes/rust/interior.function.scope create mode 100644 data/fixtures/scopes/rust/interior.if.scope create mode 100644 data/fixtures/scopes/rust/interior.interface.scope create mode 100644 data/fixtures/scopes/rust/interior.method.scope create mode 100644 data/fixtures/scopes/rust/interior.namespace.scope create mode 100644 data/fixtures/scopes/rust/interior.switch.scope create mode 100644 data/fixtures/scopes/rust/interior.while.scope create mode 100644 data/fixtures/scopes/rust/list.scope create mode 100644 data/fixtures/scopes/rust/name.argument.formal.iteration.scope create mode 100644 data/fixtures/scopes/rust/name.argument.formal.method.iteration.scope create mode 100644 data/fixtures/scopes/rust/name.argument.formal.method.scope create mode 100644 data/fixtures/scopes/rust/name.argument.formal.scope create mode 100644 data/fixtures/scopes/rust/name.assignment.pattern.scope create mode 100644 data/fixtures/scopes/rust/name.assignment.scope create mode 100644 data/fixtures/scopes/rust/name.class.scope create mode 100644 data/fixtures/scopes/rust/name.enum.scope create mode 100644 data/fixtures/scopes/rust/name.field.class.scope create mode 100644 data/fixtures/scopes/rust/name.field.enum.scope create mode 100644 data/fixtures/scopes/rust/name.foreach.scope create mode 100644 data/fixtures/scopes/rust/name.function.scope create mode 100644 data/fixtures/scopes/rust/name.interface.scope create mode 100644 data/fixtures/scopes/rust/name.iteration.class.scope create mode 100644 data/fixtures/scopes/rust/name.iteration.document.scope create mode 100644 data/fixtures/scopes/rust/name.iteration.enum.scope create mode 100644 data/fixtures/scopes/rust/name.iteration.interface.scope create mode 100644 data/fixtures/scopes/rust/name.method.scope create mode 100644 data/fixtures/scopes/rust/name.namespace.scope create mode 100644 data/fixtures/scopes/rust/name.variable.pattern.scope create mode 100644 data/fixtures/scopes/rust/name.variable.scope create mode 100644 data/fixtures/scopes/rust/namedFunction.iteration.class.scope create mode 100644 data/fixtures/scopes/rust/namedFunction.iteration.document.scope create mode 100644 data/fixtures/scopes/rust/namedFunction.method.scope create mode 100644 data/fixtures/scopes/rust/namedFunction.scope create mode 100644 data/fixtures/scopes/rust/statement.assignment.scope create mode 100644 data/fixtures/scopes/rust/statement.class.scope create mode 100644 data/fixtures/scopes/rust/statement.enum.scope create mode 100644 data/fixtures/scopes/rust/statement.field.class.scope create mode 100644 data/fixtures/scopes/rust/statement.foreach.scope create mode 100644 data/fixtures/scopes/rust/statement.function.scope create mode 100644 data/fixtures/scopes/rust/statement.if.scope create mode 100644 data/fixtures/scopes/rust/statement.interface.scope create mode 100644 data/fixtures/scopes/rust/statement.iteration.class.scope create mode 100644 data/fixtures/scopes/rust/statement.iteration.document.scope create mode 100644 data/fixtures/scopes/rust/statement.iteration.interface.scope create mode 100644 data/fixtures/scopes/rust/statement.method.scope create mode 100644 data/fixtures/scopes/rust/statement.switch.scope create mode 100644 data/fixtures/scopes/rust/statement.variable.scope create mode 100644 data/fixtures/scopes/rust/statement.while.scope create mode 100644 data/fixtures/scopes/rust/type.argument.formal.iteration.scope create mode 100644 data/fixtures/scopes/rust/type.argument.formal.method.iteration.scope create mode 100644 data/fixtures/scopes/rust/type.argument.formal.method.scope create mode 100644 data/fixtures/scopes/rust/type.argument.formal.scope create mode 100644 data/fixtures/scopes/rust/type.class.scope create mode 100644 data/fixtures/scopes/rust/type.enum.scope create mode 100644 data/fixtures/scopes/rust/type.field.class.scope create mode 100644 data/fixtures/scopes/rust/type.interface.scope create mode 100644 data/fixtures/scopes/rust/type.iteration.class.scope create mode 100644 data/fixtures/scopes/rust/type.iteration.document.scope create mode 100644 data/fixtures/scopes/rust/type.iteration.interface.scope create mode 100644 data/fixtures/scopes/rust/type.return.scope create mode 100644 data/fixtures/scopes/rust/type.variable.scope create mode 100644 data/fixtures/scopes/rust/value.assignment.scope create mode 100644 data/fixtures/scopes/rust/value.foreach.scope create mode 100644 data/fixtures/scopes/rust/value.switch.scope create mode 100644 data/fixtures/scopes/rust/value.variable.scope diff --git a/data/fixtures/scopes/rust/anonymousFunction.scope b/data/fixtures/scopes/rust/anonymousFunction.scope new file mode 100644 index 0000000000..91ff8b7a39 --- /dev/null +++ b/data/fixtures/scopes/rust/anonymousFunction.scope @@ -0,0 +1,2 @@ +|| {} +--- diff --git a/data/fixtures/scopes/rust/anonymousFunction2.scope b/data/fixtures/scopes/rust/anonymousFunction2.scope new file mode 100644 index 0000000000..aa77ec1f97 --- /dev/null +++ b/data/fixtures/scopes/rust/anonymousFunction2.scope @@ -0,0 +1,2 @@ +|x| x * x; +--- 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..131575792b --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.iteration.scope @@ -0,0 +1,2 @@ +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..24a8fe9f03 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope @@ -0,0 +1,2 @@ +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..026ff44a9d --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope @@ -0,0 +1,5 @@ +foo.bar( + aaa, + bbb +); +--- 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..24a8fe9f03 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope @@ -0,0 +1,2 @@ +foo.bar(aaa, bbb); +--- 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..f5787791ec --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope @@ -0,0 +1,5 @@ +foo( + aaa, + bbb +); +--- 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..131575792b --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope @@ -0,0 +1,2 @@ +foo(aaa, bbb); +--- 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..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.iteration.scope @@ -0,0 +1,2 @@ +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..c5dabe6d01 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope @@ -0,0 +1,2 @@ +|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..3f76ec0a40 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope @@ -0,0 +1,2 @@ +|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..4fb26cb628 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope @@ -0,0 +1,5 @@ +| + aaa, + bbb +| {} +--- 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..c5385d49e7 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope @@ -0,0 +1,5 @@ +| + aaa: i32, + bbb: i32 +| {} +--- 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..c5dabe6d01 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope @@ -0,0 +1,2 @@ +|aaa, bbb| {} +--- 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..3f76ec0a40 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope @@ -0,0 +1,2 @@ +|aaa: i32, bbb: i32| {} +--- 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..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope @@ -0,0 +1,4 @@ +impl Foo { + 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..c0ca23eac0 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope @@ -0,0 +1,8 @@ +impl Foo { + fn bar( + &self, + aaa: i32, + bbb: i32 + ) {} +} +--- 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..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- 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..d2b1c6f00d --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope @@ -0,0 +1,5 @@ +fn foo( + aaa: i32, + bbb: i32 +) {} +--- 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..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope @@ -0,0 +1,2 @@ +fn foo(aaa: i32, bbb: i32) {} +--- 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..2d962ce4fa --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope @@ -0,0 +1,2 @@ +foo(); +--- 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..a797e7b747 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope @@ -0,0 +1,2 @@ +foo.bar(); +--- 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..026ff44a9d --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope @@ -0,0 +1,5 @@ +foo.bar( + aaa, + bbb +); +--- 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..24a8fe9f03 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope @@ -0,0 +1,2 @@ +foo.bar(aaa, bbb); +--- 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..f5787791ec --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope @@ -0,0 +1,5 @@ +foo( + aaa, + bbb +); +--- 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..131575792b --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope @@ -0,0 +1,2 @@ +foo(aaa, bbb); +--- 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..44f86994f4 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope @@ -0,0 +1,2 @@ +fn foo() {} +--- 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..91ff8b7a39 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope @@ -0,0 +1,2 @@ +|| {} +--- 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..5e8ae5ada1 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope @@ -0,0 +1,5 @@ +| + aaa: i32, + bbb: i32, +|{} +--- 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..3f76ec0a40 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope @@ -0,0 +1,2 @@ +|aaa: i32, bbb: i32| {} +--- 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..974ca58ae6 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar() {} +} +--- 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..c0ca23eac0 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope @@ -0,0 +1,8 @@ +impl Foo { + fn bar( + &self, + aaa: i32, + bbb: i32 + ) {} +} +--- 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..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- 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..a3cfe6c09c --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope @@ -0,0 +1,5 @@ +fn foo( + aaa: i32, + bbb: i32, +) {} +--- 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..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope @@ -0,0 +1,2 @@ +fn foo(aaa: i32, bbb: i32) {} +--- diff --git a/data/fixtures/scopes/rust/branch.if.elif.else.scope b/data/fixtures/scopes/rust/branch.if.elif.else.scope new file mode 100644 index 0000000000..b366308c1e --- /dev/null +++ b/data/fixtures/scopes/rust/branch.if.elif.else.scope @@ -0,0 +1,4 @@ +if true {} +else if false {} +else {} +--- diff --git a/data/fixtures/scopes/rust/branch.if.else.scope b/data/fixtures/scopes/rust/branch.if.else.scope new file mode 100644 index 0000000000..ec0727d0b2 --- /dev/null +++ b/data/fixtures/scopes/rust/branch.if.else.scope @@ -0,0 +1,3 @@ +if true {} +else {} +--- diff --git a/data/fixtures/scopes/rust/branch.if.iteration.scope b/data/fixtures/scopes/rust/branch.if.iteration.scope new file mode 100644 index 0000000000..b366308c1e --- /dev/null +++ b/data/fixtures/scopes/rust/branch.if.iteration.scope @@ -0,0 +1,4 @@ +if true {} +else if false {} +else {} +--- diff --git a/data/fixtures/scopes/rust/branch.if.scope b/data/fixtures/scopes/rust/branch.if.scope new file mode 100644 index 0000000000..239d14a8c1 --- /dev/null +++ b/data/fixtures/scopes/rust/branch.if.scope @@ -0,0 +1,2 @@ +if true {} +--- diff --git a/data/fixtures/scopes/rust/branch.switchCase.iteration.scope b/data/fixtures/scopes/rust/branch.switchCase.iteration.scope new file mode 100644 index 0000000000..76d358e35d --- /dev/null +++ b/data/fixtures/scopes/rust/branch.switchCase.iteration.scope @@ -0,0 +1,2 @@ +match foo { } +--- diff --git a/data/fixtures/scopes/rust/branch.switchCase.scope b/data/fixtures/scopes/rust/branch.switchCase.scope new file mode 100644 index 0000000000..6ef5dc4e13 --- /dev/null +++ b/data/fixtures/scopes/rust/branch.switchCase.scope @@ -0,0 +1,5 @@ +match foo { + 0 => "0", + _ => "_", +} +--- 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..e0ab69e3cf --- /dev/null +++ b/data/fixtures/scopes/rust/class.iteration.document.scope @@ -0,0 +1,4 @@ + +struct Foo {} + +--- diff --git a/data/fixtures/scopes/rust/class.scope b/data/fixtures/scopes/rust/class.scope new file mode 100644 index 0000000000..77e974ce62 --- /dev/null +++ b/data/fixtures/scopes/rust/class.scope @@ -0,0 +1,2 @@ +impl Foo {} +--- diff --git a/data/fixtures/scopes/rust/comment.block.scope b/data/fixtures/scopes/rust/comment.block.scope new file mode 100644 index 0000000000..84088c675e --- /dev/null +++ b/data/fixtures/scopes/rust/comment.block.scope @@ -0,0 +1,2 @@ +/* Hello world */ +--- diff --git a/data/fixtures/scopes/rust/comment.line.scope b/data/fixtures/scopes/rust/comment.line.scope new file mode 100644 index 0000000000..b9656a1918 --- /dev/null +++ b/data/fixtures/scopes/rust/comment.line.scope @@ -0,0 +1,2 @@ +// Hello world +--- diff --git a/data/fixtures/scopes/rust/condition.if.scope b/data/fixtures/scopes/rust/condition.if.scope new file mode 100644 index 0000000000..b366308c1e --- /dev/null +++ b/data/fixtures/scopes/rust/condition.if.scope @@ -0,0 +1,4 @@ +if true {} +else if false {} +else {} +--- 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..76d358e35d --- /dev/null +++ b/data/fixtures/scopes/rust/condition.switchCase.iteration.scope @@ -0,0 +1,2 @@ +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..0577518a3e --- /dev/null +++ b/data/fixtures/scopes/rust/condition.switchCase.scope @@ -0,0 +1,5 @@ +match foo { + 0 => "0", + _ => "_" +} +--- diff --git a/data/fixtures/scopes/rust/condition.while.scope b/data/fixtures/scopes/rust/condition.while.scope new file mode 100644 index 0000000000..ce25ab0ad8 --- /dev/null +++ b/data/fixtures/scopes/rust/condition.while.scope @@ -0,0 +1,2 @@ +while true {} +--- diff --git a/data/fixtures/scopes/rust/functionCall.chain.scope b/data/fixtures/scopes/rust/functionCall.chain.scope new file mode 100644 index 0000000000..633f0ca24d --- /dev/null +++ b/data/fixtures/scopes/rust/functionCall.chain.scope @@ -0,0 +1,2 @@ +foo().bar(); +--- diff --git a/data/fixtures/scopes/rust/functionCall.method.scope b/data/fixtures/scopes/rust/functionCall.method.scope new file mode 100644 index 0000000000..a797e7b747 --- /dev/null +++ b/data/fixtures/scopes/rust/functionCall.method.scope @@ -0,0 +1,2 @@ +foo.bar(); +--- diff --git a/data/fixtures/scopes/rust/functionCall.scope b/data/fixtures/scopes/rust/functionCall.scope new file mode 100644 index 0000000000..2d962ce4fa --- /dev/null +++ b/data/fixtures/scopes/rust/functionCall.scope @@ -0,0 +1,2 @@ +foo(); +--- diff --git a/data/fixtures/scopes/rust/functionCallee.chain.scope b/data/fixtures/scopes/rust/functionCallee.chain.scope new file mode 100644 index 0000000000..633f0ca24d --- /dev/null +++ b/data/fixtures/scopes/rust/functionCallee.chain.scope @@ -0,0 +1,2 @@ +foo().bar(); +--- diff --git a/data/fixtures/scopes/rust/functionCallee.method.scope b/data/fixtures/scopes/rust/functionCallee.method.scope new file mode 100644 index 0000000000..a797e7b747 --- /dev/null +++ b/data/fixtures/scopes/rust/functionCallee.method.scope @@ -0,0 +1,2 @@ +foo.bar(); +--- diff --git a/data/fixtures/scopes/rust/functionCallee.scope b/data/fixtures/scopes/rust/functionCallee.scope new file mode 100644 index 0000000000..2d962ce4fa --- /dev/null +++ b/data/fixtures/scopes/rust/functionCallee.scope @@ -0,0 +1,2 @@ +foo(); +--- diff --git a/data/fixtures/scopes/rust/interior.class.scope b/data/fixtures/scopes/rust/interior.class.scope new file mode 100644 index 0000000000..dc0488fdba --- /dev/null +++ b/data/fixtures/scopes/rust/interior.class.scope @@ -0,0 +1,2 @@ +impl Foo { } +--- diff --git a/data/fixtures/scopes/rust/interior.enum.scope b/data/fixtures/scopes/rust/interior.enum.scope new file mode 100644 index 0000000000..f14a727bf6 --- /dev/null +++ b/data/fixtures/scopes/rust/interior.enum.scope @@ -0,0 +1,2 @@ +enum Foo { } +--- diff --git a/data/fixtures/scopes/rust/interior.function.scope b/data/fixtures/scopes/rust/interior.function.scope new file mode 100644 index 0000000000..e9b223dfe5 --- /dev/null +++ b/data/fixtures/scopes/rust/interior.function.scope @@ -0,0 +1,2 @@ +fn foo() { } +--- diff --git a/data/fixtures/scopes/rust/interior.if.scope b/data/fixtures/scopes/rust/interior.if.scope new file mode 100644 index 0000000000..e3bd0a7c5e --- /dev/null +++ b/data/fixtures/scopes/rust/interior.if.scope @@ -0,0 +1,4 @@ +if true { } +else if false { } +else { } +--- diff --git a/data/fixtures/scopes/rust/interior.interface.scope b/data/fixtures/scopes/rust/interior.interface.scope new file mode 100644 index 0000000000..e213f6379e --- /dev/null +++ b/data/fixtures/scopes/rust/interior.interface.scope @@ -0,0 +1,2 @@ +struct Foo { } +--- diff --git a/data/fixtures/scopes/rust/interior.method.scope b/data/fixtures/scopes/rust/interior.method.scope new file mode 100644 index 0000000000..801ac7fa16 --- /dev/null +++ b/data/fixtures/scopes/rust/interior.method.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar() { } +} +--- diff --git a/data/fixtures/scopes/rust/interior.namespace.scope b/data/fixtures/scopes/rust/interior.namespace.scope new file mode 100644 index 0000000000..e1f1bb141d --- /dev/null +++ b/data/fixtures/scopes/rust/interior.namespace.scope @@ -0,0 +1,2 @@ +mod foo { } +--- diff --git a/data/fixtures/scopes/rust/interior.switch.scope b/data/fixtures/scopes/rust/interior.switch.scope new file mode 100644 index 0000000000..76d358e35d --- /dev/null +++ b/data/fixtures/scopes/rust/interior.switch.scope @@ -0,0 +1,2 @@ +match foo { } +--- diff --git a/data/fixtures/scopes/rust/interior.while.scope b/data/fixtures/scopes/rust/interior.while.scope new file mode 100644 index 0000000000..6d96e6a130 --- /dev/null +++ b/data/fixtures/scopes/rust/interior.while.scope @@ -0,0 +1,2 @@ +while true { } +--- diff --git a/data/fixtures/scopes/rust/list.scope b/data/fixtures/scopes/rust/list.scope new file mode 100644 index 0000000000..836cae8f3e --- /dev/null +++ b/data/fixtures/scopes/rust/list.scope @@ -0,0 +1,2 @@ +vec![aaa, bbb]; +--- diff --git a/data/fixtures/scopes/rust/name.argument.formal.iteration.scope b/data/fixtures/scopes/rust/name.argument.formal.iteration.scope new file mode 100644 index 0000000000..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/name.argument.formal.iteration.scope @@ -0,0 +1,2 @@ +fn foo(aaa: i32, bbb: i32) {} +--- diff --git a/data/fixtures/scopes/rust/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/name.argument.formal.method.iteration.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- diff --git a/data/fixtures/scopes/rust/name.argument.formal.method.scope b/data/fixtures/scopes/rust/name.argument.formal.method.scope new file mode 100644 index 0000000000..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/name.argument.formal.method.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- diff --git a/data/fixtures/scopes/rust/name.argument.formal.scope b/data/fixtures/scopes/rust/name.argument.formal.scope new file mode 100644 index 0000000000..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/name.argument.formal.scope @@ -0,0 +1,2 @@ +fn foo(aaa: i32, bbb: i32) {} +--- diff --git a/data/fixtures/scopes/rust/name.assignment.pattern.scope b/data/fixtures/scopes/rust/name.assignment.pattern.scope new file mode 100644 index 0000000000..beb212a4f7 --- /dev/null +++ b/data/fixtures/scopes/rust/name.assignment.pattern.scope @@ -0,0 +1,2 @@ +{ foo: bar } = baz; +--- diff --git a/data/fixtures/scopes/rust/name.assignment.scope b/data/fixtures/scopes/rust/name.assignment.scope new file mode 100644 index 0000000000..20f7e72f3d --- /dev/null +++ b/data/fixtures/scopes/rust/name.assignment.scope @@ -0,0 +1,2 @@ +foo = 0; +--- diff --git a/data/fixtures/scopes/rust/name.class.scope b/data/fixtures/scopes/rust/name.class.scope new file mode 100644 index 0000000000..77e974ce62 --- /dev/null +++ b/data/fixtures/scopes/rust/name.class.scope @@ -0,0 +1,2 @@ +impl Foo {} +--- diff --git a/data/fixtures/scopes/rust/name.enum.scope b/data/fixtures/scopes/rust/name.enum.scope new file mode 100644 index 0000000000..aac4cd6aba --- /dev/null +++ b/data/fixtures/scopes/rust/name.enum.scope @@ -0,0 +1,2 @@ +enum Foo {} +--- diff --git a/data/fixtures/scopes/rust/name.field.class.scope b/data/fixtures/scopes/rust/name.field.class.scope new file mode 100644 index 0000000000..68685842e4 --- /dev/null +++ b/data/fixtures/scopes/rust/name.field.class.scope @@ -0,0 +1,4 @@ +struct Foo { + bar: i32 +} +--- diff --git a/data/fixtures/scopes/rust/name.field.enum.scope b/data/fixtures/scopes/rust/name.field.enum.scope new file mode 100644 index 0000000000..e31a653808 --- /dev/null +++ b/data/fixtures/scopes/rust/name.field.enum.scope @@ -0,0 +1,5 @@ +enum Foo { + bar, + baz +} +--- diff --git a/data/fixtures/scopes/rust/name.foreach.scope b/data/fixtures/scopes/rust/name.foreach.scope new file mode 100644 index 0000000000..7d64e5d97f --- /dev/null +++ b/data/fixtures/scopes/rust/name.foreach.scope @@ -0,0 +1,2 @@ +for v in values {} +--- diff --git a/data/fixtures/scopes/rust/name.function.scope b/data/fixtures/scopes/rust/name.function.scope new file mode 100644 index 0000000000..44f86994f4 --- /dev/null +++ b/data/fixtures/scopes/rust/name.function.scope @@ -0,0 +1,2 @@ +fn foo() {} +--- diff --git a/data/fixtures/scopes/rust/name.interface.scope b/data/fixtures/scopes/rust/name.interface.scope new file mode 100644 index 0000000000..50e7a22284 --- /dev/null +++ b/data/fixtures/scopes/rust/name.interface.scope @@ -0,0 +1,2 @@ +struct Foo {} +--- diff --git a/data/fixtures/scopes/rust/name.iteration.class.scope b/data/fixtures/scopes/rust/name.iteration.class.scope new file mode 100644 index 0000000000..dc0488fdba --- /dev/null +++ b/data/fixtures/scopes/rust/name.iteration.class.scope @@ -0,0 +1,2 @@ +impl Foo { } +--- diff --git a/data/fixtures/scopes/rust/name.iteration.document.scope b/data/fixtures/scopes/rust/name.iteration.document.scope new file mode 100644 index 0000000000..1837707f91 --- /dev/null +++ b/data/fixtures/scopes/rust/name.iteration.document.scope @@ -0,0 +1,4 @@ + +impl Foo {} + +--- diff --git a/data/fixtures/scopes/rust/name.iteration.enum.scope b/data/fixtures/scopes/rust/name.iteration.enum.scope new file mode 100644 index 0000000000..f14a727bf6 --- /dev/null +++ b/data/fixtures/scopes/rust/name.iteration.enum.scope @@ -0,0 +1,2 @@ +enum Foo { } +--- diff --git a/data/fixtures/scopes/rust/name.iteration.interface.scope b/data/fixtures/scopes/rust/name.iteration.interface.scope new file mode 100644 index 0000000000..e213f6379e --- /dev/null +++ b/data/fixtures/scopes/rust/name.iteration.interface.scope @@ -0,0 +1,2 @@ +struct Foo { } +--- diff --git a/data/fixtures/scopes/rust/name.method.scope b/data/fixtures/scopes/rust/name.method.scope new file mode 100644 index 0000000000..974ca58ae6 --- /dev/null +++ b/data/fixtures/scopes/rust/name.method.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar() {} +} +--- diff --git a/data/fixtures/scopes/rust/name.namespace.scope b/data/fixtures/scopes/rust/name.namespace.scope new file mode 100644 index 0000000000..b04aa31f7a --- /dev/null +++ b/data/fixtures/scopes/rust/name.namespace.scope @@ -0,0 +1,2 @@ +mod foo {} +--- diff --git a/data/fixtures/scopes/rust/name.variable.pattern.scope b/data/fixtures/scopes/rust/name.variable.pattern.scope new file mode 100644 index 0000000000..beb212a4f7 --- /dev/null +++ b/data/fixtures/scopes/rust/name.variable.pattern.scope @@ -0,0 +1,2 @@ +{ foo: bar } = baz; +--- diff --git a/data/fixtures/scopes/rust/name.variable.scope b/data/fixtures/scopes/rust/name.variable.scope new file mode 100644 index 0000000000..79e524940f --- /dev/null +++ b/data/fixtures/scopes/rust/name.variable.scope @@ -0,0 +1,2 @@ +let foo = 0; +--- 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..dc0488fdba --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.iteration.class.scope @@ -0,0 +1,2 @@ +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..1837707f91 --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.iteration.document.scope @@ -0,0 +1,4 @@ + +impl Foo {} + +--- diff --git a/data/fixtures/scopes/rust/namedFunction.method.scope b/data/fixtures/scopes/rust/namedFunction.method.scope new file mode 100644 index 0000000000..974ca58ae6 --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.method.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar() {} +} +--- diff --git a/data/fixtures/scopes/rust/namedFunction.scope b/data/fixtures/scopes/rust/namedFunction.scope new file mode 100644 index 0000000000..8ccb0511f5 --- /dev/null +++ b/data/fixtures/scopes/rust/namedFunction.scope @@ -0,0 +1,2 @@ +fn add() {} +--- diff --git a/data/fixtures/scopes/rust/statement.assignment.scope b/data/fixtures/scopes/rust/statement.assignment.scope new file mode 100644 index 0000000000..20f7e72f3d --- /dev/null +++ b/data/fixtures/scopes/rust/statement.assignment.scope @@ -0,0 +1,2 @@ +foo = 0; +--- diff --git a/data/fixtures/scopes/rust/statement.class.scope b/data/fixtures/scopes/rust/statement.class.scope new file mode 100644 index 0000000000..77e974ce62 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.class.scope @@ -0,0 +1,2 @@ +impl Foo {} +--- diff --git a/data/fixtures/scopes/rust/statement.enum.scope b/data/fixtures/scopes/rust/statement.enum.scope new file mode 100644 index 0000000000..ffbaae62e0 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.enum.scope @@ -0,0 +1,5 @@ +enum Foo { + Bar, + Baz +} +--- diff --git a/data/fixtures/scopes/rust/statement.field.class.scope b/data/fixtures/scopes/rust/statement.field.class.scope new file mode 100644 index 0000000000..68685842e4 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.field.class.scope @@ -0,0 +1,4 @@ +struct Foo { + bar: i32 +} +--- diff --git a/data/fixtures/scopes/rust/statement.foreach.scope b/data/fixtures/scopes/rust/statement.foreach.scope new file mode 100644 index 0000000000..7d64e5d97f --- /dev/null +++ b/data/fixtures/scopes/rust/statement.foreach.scope @@ -0,0 +1,2 @@ +for v in values {} +--- diff --git a/data/fixtures/scopes/rust/statement.function.scope b/data/fixtures/scopes/rust/statement.function.scope new file mode 100644 index 0000000000..44f86994f4 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.function.scope @@ -0,0 +1,2 @@ +fn foo() {} +--- diff --git a/data/fixtures/scopes/rust/statement.if.scope b/data/fixtures/scopes/rust/statement.if.scope new file mode 100644 index 0000000000..b366308c1e --- /dev/null +++ b/data/fixtures/scopes/rust/statement.if.scope @@ -0,0 +1,4 @@ +if true {} +else if false {} +else {} +--- diff --git a/data/fixtures/scopes/rust/statement.interface.scope b/data/fixtures/scopes/rust/statement.interface.scope new file mode 100644 index 0000000000..50e7a22284 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.interface.scope @@ -0,0 +1,2 @@ +struct Foo {} +--- diff --git a/data/fixtures/scopes/rust/statement.iteration.class.scope b/data/fixtures/scopes/rust/statement.iteration.class.scope new file mode 100644 index 0000000000..dc0488fdba --- /dev/null +++ b/data/fixtures/scopes/rust/statement.iteration.class.scope @@ -0,0 +1,2 @@ +impl Foo { } +--- diff --git a/data/fixtures/scopes/rust/statement.iteration.document.scope b/data/fixtures/scopes/rust/statement.iteration.document.scope new file mode 100644 index 0000000000..3aab0af0e0 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.iteration.document.scope @@ -0,0 +1,4 @@ + +let foo = 0; + +--- diff --git a/data/fixtures/scopes/rust/statement.iteration.interface.scope b/data/fixtures/scopes/rust/statement.iteration.interface.scope new file mode 100644 index 0000000000..e213f6379e --- /dev/null +++ b/data/fixtures/scopes/rust/statement.iteration.interface.scope @@ -0,0 +1,2 @@ +struct Foo { } +--- diff --git a/data/fixtures/scopes/rust/statement.method.scope b/data/fixtures/scopes/rust/statement.method.scope new file mode 100644 index 0000000000..974ca58ae6 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.method.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar() {} +} +--- diff --git a/data/fixtures/scopes/rust/statement.switch.scope b/data/fixtures/scopes/rust/statement.switch.scope new file mode 100644 index 0000000000..76d358e35d --- /dev/null +++ b/data/fixtures/scopes/rust/statement.switch.scope @@ -0,0 +1,2 @@ +match foo { } +--- diff --git a/data/fixtures/scopes/rust/statement.variable.scope b/data/fixtures/scopes/rust/statement.variable.scope new file mode 100644 index 0000000000..79e524940f --- /dev/null +++ b/data/fixtures/scopes/rust/statement.variable.scope @@ -0,0 +1,2 @@ +let foo = 0; +--- diff --git a/data/fixtures/scopes/rust/statement.while.scope b/data/fixtures/scopes/rust/statement.while.scope new file mode 100644 index 0000000000..ce25ab0ad8 --- /dev/null +++ b/data/fixtures/scopes/rust/statement.while.scope @@ -0,0 +1,2 @@ +while true {} +--- diff --git a/data/fixtures/scopes/rust/type.argument.formal.iteration.scope b/data/fixtures/scopes/rust/type.argument.formal.iteration.scope new file mode 100644 index 0000000000..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/type.argument.formal.iteration.scope @@ -0,0 +1,2 @@ +fn foo(aaa: i32, bbb: i32) {} +--- diff --git a/data/fixtures/scopes/rust/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/type.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/type.argument.formal.method.iteration.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- diff --git a/data/fixtures/scopes/rust/type.argument.formal.method.scope b/data/fixtures/scopes/rust/type.argument.formal.method.scope new file mode 100644 index 0000000000..acb0ec6ac6 --- /dev/null +++ b/data/fixtures/scopes/rust/type.argument.formal.method.scope @@ -0,0 +1,4 @@ +impl Foo { + fn bar(&self, aaa: i32, bbb: i32) {} +} +--- diff --git a/data/fixtures/scopes/rust/type.argument.formal.scope b/data/fixtures/scopes/rust/type.argument.formal.scope new file mode 100644 index 0000000000..b880325366 --- /dev/null +++ b/data/fixtures/scopes/rust/type.argument.formal.scope @@ -0,0 +1,2 @@ +fn foo(aaa: i32, bbb: i32) {} +--- diff --git a/data/fixtures/scopes/rust/type.class.scope b/data/fixtures/scopes/rust/type.class.scope new file mode 100644 index 0000000000..77e974ce62 --- /dev/null +++ b/data/fixtures/scopes/rust/type.class.scope @@ -0,0 +1,2 @@ +impl Foo {} +--- diff --git a/data/fixtures/scopes/rust/type.enum.scope b/data/fixtures/scopes/rust/type.enum.scope new file mode 100644 index 0000000000..aac4cd6aba --- /dev/null +++ b/data/fixtures/scopes/rust/type.enum.scope @@ -0,0 +1,2 @@ +enum Foo {} +--- diff --git a/data/fixtures/scopes/rust/type.field.class.scope b/data/fixtures/scopes/rust/type.field.class.scope new file mode 100644 index 0000000000..68685842e4 --- /dev/null +++ b/data/fixtures/scopes/rust/type.field.class.scope @@ -0,0 +1,4 @@ +struct Foo { + bar: i32 +} +--- diff --git a/data/fixtures/scopes/rust/type.interface.scope b/data/fixtures/scopes/rust/type.interface.scope new file mode 100644 index 0000000000..50e7a22284 --- /dev/null +++ b/data/fixtures/scopes/rust/type.interface.scope @@ -0,0 +1,2 @@ +struct Foo {} +--- diff --git a/data/fixtures/scopes/rust/type.iteration.class.scope b/data/fixtures/scopes/rust/type.iteration.class.scope new file mode 100644 index 0000000000..dc0488fdba --- /dev/null +++ b/data/fixtures/scopes/rust/type.iteration.class.scope @@ -0,0 +1,2 @@ +impl Foo { } +--- diff --git a/data/fixtures/scopes/rust/type.iteration.document.scope b/data/fixtures/scopes/rust/type.iteration.document.scope new file mode 100644 index 0000000000..eeac8cfc86 --- /dev/null +++ b/data/fixtures/scopes/rust/type.iteration.document.scope @@ -0,0 +1,4 @@ + +let foo: i32 = 0; + +--- diff --git a/data/fixtures/scopes/rust/type.iteration.interface.scope b/data/fixtures/scopes/rust/type.iteration.interface.scope new file mode 100644 index 0000000000..e213f6379e --- /dev/null +++ b/data/fixtures/scopes/rust/type.iteration.interface.scope @@ -0,0 +1,2 @@ +struct Foo { } +--- diff --git a/data/fixtures/scopes/rust/type.return.scope b/data/fixtures/scopes/rust/type.return.scope new file mode 100644 index 0000000000..f8da8bcbbb --- /dev/null +++ b/data/fixtures/scopes/rust/type.return.scope @@ -0,0 +1,2 @@ +fn foo() -> i32 {} +--- diff --git a/data/fixtures/scopes/rust/type.variable.scope b/data/fixtures/scopes/rust/type.variable.scope new file mode 100644 index 0000000000..5073e4acc9 --- /dev/null +++ b/data/fixtures/scopes/rust/type.variable.scope @@ -0,0 +1,2 @@ +let foo: i32 = 0; +--- diff --git a/data/fixtures/scopes/rust/value.assignment.scope b/data/fixtures/scopes/rust/value.assignment.scope new file mode 100644 index 0000000000..20f7e72f3d --- /dev/null +++ b/data/fixtures/scopes/rust/value.assignment.scope @@ -0,0 +1,2 @@ +foo = 0; +--- diff --git a/data/fixtures/scopes/rust/value.foreach.scope b/data/fixtures/scopes/rust/value.foreach.scope new file mode 100644 index 0000000000..7d64e5d97f --- /dev/null +++ b/data/fixtures/scopes/rust/value.foreach.scope @@ -0,0 +1,2 @@ +for v in values {} +--- diff --git a/data/fixtures/scopes/rust/value.switch.scope b/data/fixtures/scopes/rust/value.switch.scope new file mode 100644 index 0000000000..9a5a295aaf --- /dev/null +++ b/data/fixtures/scopes/rust/value.switch.scope @@ -0,0 +1,2 @@ +match foo {} +--- diff --git a/data/fixtures/scopes/rust/value.variable.scope b/data/fixtures/scopes/rust/value.variable.scope new file mode 100644 index 0000000000..79e524940f --- /dev/null +++ b/data/fixtures/scopes/rust/value.variable.scope @@ -0,0 +1,2 @@ +let foo = 0; +--- diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index c8e7f844a8..aa6dad1f7d 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -1,12 +1,312 @@ 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.interface": 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.interface": 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.interface": 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.interface": supported, + "name.iteration.enum": supported, + "name.iteration.document": supported, + + "value.assignment": supported, + "value.foreach": supported, + "value.field.class": supported, + "value.field.enum": 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.interface": 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.interface": supported, + "type.iteration.document": supported, + + "interior.class": supported, + "interior.interface": 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, + + // 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, + + // Interface fields + "statement.field.interface": notApplicable, + "name.field.interface": notApplicable, + "type.field.interface": 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, + + // Miscellaneous + "value.iteration.enum": notApplicable, + "statement.static": notApplicable, + "statement.misc": notApplicable, + "type.foreach": notApplicable, + "class.iteration.block": notApplicable, + "value.variable.pattern": notApplicable, + environment: notApplicable, + regularExpression: notApplicable, + selector: notApplicable, + unit: notApplicable, + pairDelimiter: notApplicable, }; From 60150c3dc48e5128c995c9a5cbede87395524255 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 12:59:12 +0100 Subject: [PATCH 02/14] Added more fixtures --- .../rust/{ => branch}/branch.if.elif.else.scope | 0 .../rust/{ => branch}/branch.if.else.scope | 0 .../rust/{ => branch}/branch.if.iteration.scope | 0 .../scopes/rust/{ => branch}/branch.if.scope | 0 .../branch.switchCase.iteration.scope | 0 .../rust/{ => branch}/branch.switchCase.scope | 0 .../rust/{ => interior}/interior.class.scope | 0 .../rust/{ => interior}/interior.enum.scope | 0 .../scopes/rust/interior/interior.foreach.scope | 2 ++ .../rust/{ => interior}/interior.function.scope | 0 .../scopes/rust/{ => interior}/interior.if.scope | 0 .../rust/{ => interior}/interior.interface.scope | 0 .../scopes/rust/interior/interior.lambda.scope | 2 ++ .../rust/{ => interior}/interior.method.scope | 0 .../rust/{ => interior}/interior.namespace.scope | 0 .../rust/{ => interior}/interior.switch.scope | 0 .../rust/interior/interior.switchCase.scope | 6 ++++++ .../rust/{ => interior}/interior.while.scope | 0 .../name.argument.formal.iteration.scope | 0 .../name.argument.formal.method.iteration.scope | 0 .../{ => name}/name.argument.formal.method.scope | 0 .../rust/{ => name}/name.argument.formal.scope | 0 .../{ => name}/name.assignment.pattern.scope | 0 .../scopes/rust/{ => name}/name.assignment.scope | 0 .../scopes/rust/{ => name}/name.class.scope | 0 .../scopes/rust/{ => name}/name.enum.scope | 0 .../rust/{ => name}/name.field.class.scope | 0 .../scopes/rust/{ => name}/name.field.enum.scope | 0 .../name.field.interface.scope} | 0 .../scopes/rust/{ => name}/name.foreach.scope | 0 .../scopes/rust/{ => name}/name.function.scope | 0 .../scopes/rust/{ => name}/name.interface.scope | 0 .../scopes/rust/name/name.iteration.block.scope | 2 ++ .../scopes/rust/name/name.iteration.block2.scope | 2 ++ .../scopes/rust/name/name.iteration.block3.scope | 2 ++ .../rust/{ => name}/name.iteration.class.scope | 0 .../{ => name}/name.iteration.document.scope | 0 .../rust/{ => name}/name.iteration.enum.scope | 0 .../{ => name}/name.iteration.interface.scope | 0 .../scopes/rust/{ => name}/name.method.scope | 0 .../scopes/rust/{ => name}/name.namespace.scope | 0 .../rust/{ => name}/name.variable.pattern.scope | 0 .../scopes/rust/{ => name}/name.variable.scope | 0 .../namedFunction.iteration.class.scope | 0 .../{ => statement}/statement.assignment.scope | 0 .../scopes/rust/statement/statement.break.scope | 2 ++ .../rust/{ => statement}/statement.class.scope | 0 .../rust/statement/statement.continue.scope | 2 ++ .../rust/{ => statement}/statement.enum.scope | 0 .../statement.field.class.scope} | 0 .../statement/statement.field.interface.scope | 4 ++++ .../rust/{ => statement}/statement.foreach.scope | 0 .../{ => statement}/statement.function.scope | 0 .../rust/{ => statement}/statement.if.scope | 0 .../{ => statement}/statement.interface.scope | 0 .../statement/statement.iteration.block.scope | 2 ++ .../statement/statement.iteration.block2.scope | 2 ++ .../statement/statement.iteration.block3.scope | 2 ++ .../statement.iteration.class.scope | 0 .../statement.iteration.document.scope | 0 .../statement.iteration.interface.scope | 0 .../rust/{ => statement}/statement.method.scope | 0 .../rust/statement/statement.namespace.scope | 2 ++ .../scopes/rust/statement/statement.return.scope | 4 ++++ .../rust/{ => statement}/statement.switch.scope | 0 .../{ => statement}/statement.variable.scope | 0 .../rust/{ => statement}/statement.while.scope | 0 data/fixtures/scopes/rust/string.multiLine.scope | 3 +++ .../scopes/rust/textFragment.comment.block.scope | 2 ++ .../scopes/rust/textFragment.comment.line.scope | 2 ++ .../rust/textFragment.string.multiLine.scope | 3 +++ .../rust/textFragment.string.singleLine.scope | 1 + data/fixtures/scopes/rust/type/type.alias.scope | 2 ++ .../type.argument.formal.iteration.scope | 0 .../type.argument.formal.method.iteration.scope | 0 .../{ => type}/type.argument.formal.method.scope | 0 .../rust/{ => type}/type.argument.formal.scope | 0 data/fixtures/scopes/rust/type/type.cast.scope | 2 ++ .../scopes/rust/{ => type}/type.class.scope | 0 .../scopes/rust/{ => type}/type.enum.scope | 0 .../scopes/rust/type/type.field.class.scope | 4 ++++ .../scopes/rust/type/type.field.interface.scope | 4 ++++ .../scopes/rust/{ => type}/type.interface.scope | 0 .../scopes/rust/type/type.iteration.block.scope | 2 ++ .../scopes/rust/type/type.iteration.block2.scope | 2 ++ .../scopes/rust/type/type.iteration.block3.scope | 2 ++ .../rust/{ => type}/type.iteration.class.scope | 0 .../{ => type}/type.iteration.document.scope | 0 .../{ => type}/type.iteration.interface.scope | 0 .../scopes/rust/{ => type}/type.return.scope | 0 .../rust/type/type.typeArgument.iteration.scope | 2 ++ .../scopes/rust/type/type.typeArgument.scope | 2 ++ .../scopes/rust/{ => type}/type.variable.scope | 0 .../rust/{ => value}/value.assignment.scope | 0 .../scopes/rust/{ => value}/value.foreach.scope | 0 .../rust/value/value.iteration.block.scope | 2 ++ .../rust/value/value.iteration.block2.scope | 2 ++ .../rust/value/value.iteration.block3.scope | 2 ++ .../rust/value/value.iteration.class.scope | 2 ++ .../rust/value/value.iteration.document.scope | 4 ++++ .../scopes/rust/value/value.return.lambda.scope | 2 ++ .../scopes/rust/value/value.return.scope | 4 ++++ .../scopes/rust/{ => value}/value.switch.scope | 0 .../scopes/rust/value/value.typeAlias.scope | 2 ++ .../scopes/rust/{ => value}/value.variable.scope | 0 packages/common/src/scopeSupportFacets/rust.ts | 16 ++++++++-------- 106 files changed, 97 insertions(+), 8 deletions(-) rename data/fixtures/scopes/rust/{ => branch}/branch.if.elif.else.scope (100%) rename data/fixtures/scopes/rust/{ => branch}/branch.if.else.scope (100%) rename data/fixtures/scopes/rust/{ => branch}/branch.if.iteration.scope (100%) rename data/fixtures/scopes/rust/{ => branch}/branch.if.scope (100%) rename data/fixtures/scopes/rust/{ => branch}/branch.switchCase.iteration.scope (100%) rename data/fixtures/scopes/rust/{ => branch}/branch.switchCase.scope (100%) rename data/fixtures/scopes/rust/{ => interior}/interior.class.scope (100%) rename data/fixtures/scopes/rust/{ => interior}/interior.enum.scope (100%) create mode 100644 data/fixtures/scopes/rust/interior/interior.foreach.scope rename data/fixtures/scopes/rust/{ => interior}/interior.function.scope (100%) rename data/fixtures/scopes/rust/{ => interior}/interior.if.scope (100%) rename data/fixtures/scopes/rust/{ => interior}/interior.interface.scope (100%) create mode 100644 data/fixtures/scopes/rust/interior/interior.lambda.scope rename data/fixtures/scopes/rust/{ => interior}/interior.method.scope (100%) rename data/fixtures/scopes/rust/{ => interior}/interior.namespace.scope (100%) rename data/fixtures/scopes/rust/{ => interior}/interior.switch.scope (100%) create mode 100644 data/fixtures/scopes/rust/interior/interior.switchCase.scope rename data/fixtures/scopes/rust/{ => interior}/interior.while.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.argument.formal.iteration.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.argument.formal.method.iteration.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.argument.formal.method.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.argument.formal.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.assignment.pattern.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.assignment.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.class.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.enum.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.field.class.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.field.enum.scope (100%) rename data/fixtures/scopes/rust/{statement.field.class.scope => name/name.field.interface.scope} (100%) rename data/fixtures/scopes/rust/{ => name}/name.foreach.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.function.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.interface.scope (100%) create mode 100644 data/fixtures/scopes/rust/name/name.iteration.block.scope create mode 100644 data/fixtures/scopes/rust/name/name.iteration.block2.scope create mode 100644 data/fixtures/scopes/rust/name/name.iteration.block3.scope rename data/fixtures/scopes/rust/{ => name}/name.iteration.class.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.iteration.document.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.iteration.enum.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.iteration.interface.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.method.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.namespace.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.variable.pattern.scope (100%) rename data/fixtures/scopes/rust/{ => name}/name.variable.scope (100%) rename data/fixtures/scopes/rust/{ => name}/namedFunction.iteration.class.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.assignment.scope (100%) create mode 100644 data/fixtures/scopes/rust/statement/statement.break.scope rename data/fixtures/scopes/rust/{ => statement}/statement.class.scope (100%) create mode 100644 data/fixtures/scopes/rust/statement/statement.continue.scope rename data/fixtures/scopes/rust/{ => statement}/statement.enum.scope (100%) rename data/fixtures/scopes/rust/{type.field.class.scope => statement/statement.field.class.scope} (100%) create mode 100644 data/fixtures/scopes/rust/statement/statement.field.interface.scope rename data/fixtures/scopes/rust/{ => statement}/statement.foreach.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.function.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.if.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.interface.scope (100%) create mode 100644 data/fixtures/scopes/rust/statement/statement.iteration.block.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.iteration.block2.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.iteration.block3.scope rename data/fixtures/scopes/rust/{ => statement}/statement.iteration.class.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.iteration.document.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.iteration.interface.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.method.scope (100%) create mode 100644 data/fixtures/scopes/rust/statement/statement.namespace.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.return.scope rename data/fixtures/scopes/rust/{ => statement}/statement.switch.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.variable.scope (100%) rename data/fixtures/scopes/rust/{ => statement}/statement.while.scope (100%) create mode 100644 data/fixtures/scopes/rust/string.multiLine.scope create mode 100644 data/fixtures/scopes/rust/textFragment.comment.block.scope create mode 100644 data/fixtures/scopes/rust/textFragment.comment.line.scope create mode 100644 data/fixtures/scopes/rust/textFragment.string.multiLine.scope create mode 100644 data/fixtures/scopes/rust/type/type.alias.scope rename data/fixtures/scopes/rust/{ => type}/type.argument.formal.iteration.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.argument.formal.method.iteration.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.argument.formal.method.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.argument.formal.scope (100%) create mode 100644 data/fixtures/scopes/rust/type/type.cast.scope rename data/fixtures/scopes/rust/{ => type}/type.class.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.enum.scope (100%) create mode 100644 data/fixtures/scopes/rust/type/type.field.class.scope create mode 100644 data/fixtures/scopes/rust/type/type.field.interface.scope rename data/fixtures/scopes/rust/{ => type}/type.interface.scope (100%) create mode 100644 data/fixtures/scopes/rust/type/type.iteration.block.scope create mode 100644 data/fixtures/scopes/rust/type/type.iteration.block2.scope create mode 100644 data/fixtures/scopes/rust/type/type.iteration.block3.scope rename data/fixtures/scopes/rust/{ => type}/type.iteration.class.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.iteration.document.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.iteration.interface.scope (100%) rename data/fixtures/scopes/rust/{ => type}/type.return.scope (100%) create mode 100644 data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope create mode 100644 data/fixtures/scopes/rust/type/type.typeArgument.scope rename data/fixtures/scopes/rust/{ => type}/type.variable.scope (100%) rename data/fixtures/scopes/rust/{ => value}/value.assignment.scope (100%) rename data/fixtures/scopes/rust/{ => value}/value.foreach.scope (100%) create mode 100644 data/fixtures/scopes/rust/value/value.iteration.block.scope create mode 100644 data/fixtures/scopes/rust/value/value.iteration.block2.scope create mode 100644 data/fixtures/scopes/rust/value/value.iteration.block3.scope create mode 100644 data/fixtures/scopes/rust/value/value.iteration.class.scope create mode 100644 data/fixtures/scopes/rust/value/value.iteration.document.scope create mode 100644 data/fixtures/scopes/rust/value/value.return.lambda.scope create mode 100644 data/fixtures/scopes/rust/value/value.return.scope rename data/fixtures/scopes/rust/{ => value}/value.switch.scope (100%) create mode 100644 data/fixtures/scopes/rust/value/value.typeAlias.scope rename data/fixtures/scopes/rust/{ => value}/value.variable.scope (100%) diff --git a/data/fixtures/scopes/rust/branch.if.elif.else.scope b/data/fixtures/scopes/rust/branch/branch.if.elif.else.scope similarity index 100% rename from data/fixtures/scopes/rust/branch.if.elif.else.scope rename to data/fixtures/scopes/rust/branch/branch.if.elif.else.scope diff --git a/data/fixtures/scopes/rust/branch.if.else.scope b/data/fixtures/scopes/rust/branch/branch.if.else.scope similarity index 100% rename from data/fixtures/scopes/rust/branch.if.else.scope rename to data/fixtures/scopes/rust/branch/branch.if.else.scope diff --git a/data/fixtures/scopes/rust/branch.if.iteration.scope b/data/fixtures/scopes/rust/branch/branch.if.iteration.scope similarity index 100% rename from data/fixtures/scopes/rust/branch.if.iteration.scope rename to data/fixtures/scopes/rust/branch/branch.if.iteration.scope diff --git a/data/fixtures/scopes/rust/branch.if.scope b/data/fixtures/scopes/rust/branch/branch.if.scope similarity index 100% rename from data/fixtures/scopes/rust/branch.if.scope rename to data/fixtures/scopes/rust/branch/branch.if.scope diff --git a/data/fixtures/scopes/rust/branch.switchCase.iteration.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope similarity index 100% rename from data/fixtures/scopes/rust/branch.switchCase.iteration.scope rename to data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope diff --git a/data/fixtures/scopes/rust/branch.switchCase.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.scope similarity index 100% rename from data/fixtures/scopes/rust/branch.switchCase.scope rename to data/fixtures/scopes/rust/branch/branch.switchCase.scope diff --git a/data/fixtures/scopes/rust/interior.class.scope b/data/fixtures/scopes/rust/interior/interior.class.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.class.scope rename to data/fixtures/scopes/rust/interior/interior.class.scope diff --git a/data/fixtures/scopes/rust/interior.enum.scope b/data/fixtures/scopes/rust/interior/interior.enum.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.enum.scope rename to data/fixtures/scopes/rust/interior/interior.enum.scope 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..325f87f8ee --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.foreach.scope @@ -0,0 +1,2 @@ +for v in values { } +--- diff --git a/data/fixtures/scopes/rust/interior.function.scope b/data/fixtures/scopes/rust/interior/interior.function.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.function.scope rename to data/fixtures/scopes/rust/interior/interior.function.scope diff --git a/data/fixtures/scopes/rust/interior.if.scope b/data/fixtures/scopes/rust/interior/interior.if.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.if.scope rename to data/fixtures/scopes/rust/interior/interior.if.scope diff --git a/data/fixtures/scopes/rust/interior.interface.scope b/data/fixtures/scopes/rust/interior/interior.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.interface.scope rename to data/fixtures/scopes/rust/interior/interior.interface.scope 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..d5e8139dfe --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.lambda.scope @@ -0,0 +1,2 @@ +|| { } +--- diff --git a/data/fixtures/scopes/rust/interior.method.scope b/data/fixtures/scopes/rust/interior/interior.method.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.method.scope rename to data/fixtures/scopes/rust/interior/interior.method.scope diff --git a/data/fixtures/scopes/rust/interior.namespace.scope b/data/fixtures/scopes/rust/interior/interior.namespace.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.namespace.scope rename to data/fixtures/scopes/rust/interior/interior.namespace.scope diff --git a/data/fixtures/scopes/rust/interior.switch.scope b/data/fixtures/scopes/rust/interior/interior.switch.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.switch.scope rename to data/fixtures/scopes/rust/interior/interior.switch.scope 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..8576467456 --- /dev/null +++ b/data/fixtures/scopes/rust/interior/interior.switchCase.scope @@ -0,0 +1,6 @@ +match foo { + 0 => "0": + 1 => { } + _ => { } +} +--- diff --git a/data/fixtures/scopes/rust/interior.while.scope b/data/fixtures/scopes/rust/interior/interior.while.scope similarity index 100% rename from data/fixtures/scopes/rust/interior.while.scope rename to data/fixtures/scopes/rust/interior/interior.while.scope diff --git a/data/fixtures/scopes/rust/name.argument.formal.iteration.scope b/data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope similarity index 100% rename from data/fixtures/scopes/rust/name.argument.formal.iteration.scope rename to data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope diff --git a/data/fixtures/scopes/rust/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope similarity index 100% rename from data/fixtures/scopes/rust/name.argument.formal.method.iteration.scope rename to data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope diff --git a/data/fixtures/scopes/rust/name.argument.formal.method.scope b/data/fixtures/scopes/rust/name/name.argument.formal.method.scope similarity index 100% rename from data/fixtures/scopes/rust/name.argument.formal.method.scope rename to data/fixtures/scopes/rust/name/name.argument.formal.method.scope diff --git a/data/fixtures/scopes/rust/name.argument.formal.scope b/data/fixtures/scopes/rust/name/name.argument.formal.scope similarity index 100% rename from data/fixtures/scopes/rust/name.argument.formal.scope rename to data/fixtures/scopes/rust/name/name.argument.formal.scope diff --git a/data/fixtures/scopes/rust/name.assignment.pattern.scope b/data/fixtures/scopes/rust/name/name.assignment.pattern.scope similarity index 100% rename from data/fixtures/scopes/rust/name.assignment.pattern.scope rename to data/fixtures/scopes/rust/name/name.assignment.pattern.scope diff --git a/data/fixtures/scopes/rust/name.assignment.scope b/data/fixtures/scopes/rust/name/name.assignment.scope similarity index 100% rename from data/fixtures/scopes/rust/name.assignment.scope rename to data/fixtures/scopes/rust/name/name.assignment.scope diff --git a/data/fixtures/scopes/rust/name.class.scope b/data/fixtures/scopes/rust/name/name.class.scope similarity index 100% rename from data/fixtures/scopes/rust/name.class.scope rename to data/fixtures/scopes/rust/name/name.class.scope diff --git a/data/fixtures/scopes/rust/name.enum.scope b/data/fixtures/scopes/rust/name/name.enum.scope similarity index 100% rename from data/fixtures/scopes/rust/name.enum.scope rename to data/fixtures/scopes/rust/name/name.enum.scope diff --git a/data/fixtures/scopes/rust/name.field.class.scope b/data/fixtures/scopes/rust/name/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/rust/name.field.class.scope rename to data/fixtures/scopes/rust/name/name.field.class.scope diff --git a/data/fixtures/scopes/rust/name.field.enum.scope b/data/fixtures/scopes/rust/name/name.field.enum.scope similarity index 100% rename from data/fixtures/scopes/rust/name.field.enum.scope rename to data/fixtures/scopes/rust/name/name.field.enum.scope diff --git a/data/fixtures/scopes/rust/statement.field.class.scope b/data/fixtures/scopes/rust/name/name.field.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.field.class.scope rename to data/fixtures/scopes/rust/name/name.field.interface.scope diff --git a/data/fixtures/scopes/rust/name.foreach.scope b/data/fixtures/scopes/rust/name/name.foreach.scope similarity index 100% rename from data/fixtures/scopes/rust/name.foreach.scope rename to data/fixtures/scopes/rust/name/name.foreach.scope diff --git a/data/fixtures/scopes/rust/name.function.scope b/data/fixtures/scopes/rust/name/name.function.scope similarity index 100% rename from data/fixtures/scopes/rust/name.function.scope rename to data/fixtures/scopes/rust/name/name.function.scope diff --git a/data/fixtures/scopes/rust/name.interface.scope b/data/fixtures/scopes/rust/name/name.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/name.interface.scope rename to data/fixtures/scopes/rust/name/name.interface.scope 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..e9b223dfe5 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.block.scope @@ -0,0 +1,2 @@ +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..4d80bbf0ec --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.block2.scope @@ -0,0 +1,2 @@ +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..6d96e6a130 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.iteration.block3.scope @@ -0,0 +1,2 @@ +while true { } +--- diff --git a/data/fixtures/scopes/rust/name.iteration.class.scope b/data/fixtures/scopes/rust/name/name.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/rust/name.iteration.class.scope rename to data/fixtures/scopes/rust/name/name.iteration.class.scope diff --git a/data/fixtures/scopes/rust/name.iteration.document.scope b/data/fixtures/scopes/rust/name/name.iteration.document.scope similarity index 100% rename from data/fixtures/scopes/rust/name.iteration.document.scope rename to data/fixtures/scopes/rust/name/name.iteration.document.scope diff --git a/data/fixtures/scopes/rust/name.iteration.enum.scope b/data/fixtures/scopes/rust/name/name.iteration.enum.scope similarity index 100% rename from data/fixtures/scopes/rust/name.iteration.enum.scope rename to data/fixtures/scopes/rust/name/name.iteration.enum.scope diff --git a/data/fixtures/scopes/rust/name.iteration.interface.scope b/data/fixtures/scopes/rust/name/name.iteration.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/name.iteration.interface.scope rename to data/fixtures/scopes/rust/name/name.iteration.interface.scope diff --git a/data/fixtures/scopes/rust/name.method.scope b/data/fixtures/scopes/rust/name/name.method.scope similarity index 100% rename from data/fixtures/scopes/rust/name.method.scope rename to data/fixtures/scopes/rust/name/name.method.scope diff --git a/data/fixtures/scopes/rust/name.namespace.scope b/data/fixtures/scopes/rust/name/name.namespace.scope similarity index 100% rename from data/fixtures/scopes/rust/name.namespace.scope rename to data/fixtures/scopes/rust/name/name.namespace.scope diff --git a/data/fixtures/scopes/rust/name.variable.pattern.scope b/data/fixtures/scopes/rust/name/name.variable.pattern.scope similarity index 100% rename from data/fixtures/scopes/rust/name.variable.pattern.scope rename to data/fixtures/scopes/rust/name/name.variable.pattern.scope diff --git a/data/fixtures/scopes/rust/name.variable.scope b/data/fixtures/scopes/rust/name/name.variable.scope similarity index 100% rename from data/fixtures/scopes/rust/name.variable.scope rename to data/fixtures/scopes/rust/name/name.variable.scope diff --git a/data/fixtures/scopes/rust/namedFunction.iteration.class.scope b/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/rust/namedFunction.iteration.class.scope rename to data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope diff --git a/data/fixtures/scopes/rust/statement.assignment.scope b/data/fixtures/scopes/rust/statement/statement.assignment.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.assignment.scope rename to data/fixtures/scopes/rust/statement/statement.assignment.scope 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..7863b4df76 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.break.scope @@ -0,0 +1,2 @@ +break; +--- diff --git a/data/fixtures/scopes/rust/statement.class.scope b/data/fixtures/scopes/rust/statement/statement.class.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.class.scope rename to data/fixtures/scopes/rust/statement/statement.class.scope 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..6adcf6b580 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.continue.scope @@ -0,0 +1,2 @@ +continue; +--- diff --git a/data/fixtures/scopes/rust/statement.enum.scope b/data/fixtures/scopes/rust/statement/statement.enum.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.enum.scope rename to data/fixtures/scopes/rust/statement/statement.enum.scope diff --git a/data/fixtures/scopes/rust/type.field.class.scope b/data/fixtures/scopes/rust/statement/statement.field.class.scope similarity index 100% rename from data/fixtures/scopes/rust/type.field.class.scope rename to data/fixtures/scopes/rust/statement/statement.field.class.scope diff --git a/data/fixtures/scopes/rust/statement/statement.field.interface.scope b/data/fixtures/scopes/rust/statement/statement.field.interface.scope new file mode 100644 index 0000000000..68685842e4 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.field.interface.scope @@ -0,0 +1,4 @@ +struct Foo { + bar: i32 +} +--- diff --git a/data/fixtures/scopes/rust/statement.foreach.scope b/data/fixtures/scopes/rust/statement/statement.foreach.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.foreach.scope rename to data/fixtures/scopes/rust/statement/statement.foreach.scope diff --git a/data/fixtures/scopes/rust/statement.function.scope b/data/fixtures/scopes/rust/statement/statement.function.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.function.scope rename to data/fixtures/scopes/rust/statement/statement.function.scope diff --git a/data/fixtures/scopes/rust/statement.if.scope b/data/fixtures/scopes/rust/statement/statement.if.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.if.scope rename to data/fixtures/scopes/rust/statement/statement.if.scope diff --git a/data/fixtures/scopes/rust/statement.interface.scope b/data/fixtures/scopes/rust/statement/statement.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.interface.scope rename to data/fixtures/scopes/rust/statement/statement.interface.scope 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..e9b223dfe5 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block.scope @@ -0,0 +1,2 @@ +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..4d80bbf0ec --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block2.scope @@ -0,0 +1,2 @@ +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..6d96e6a130 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block3.scope @@ -0,0 +1,2 @@ +while true { } +--- diff --git a/data/fixtures/scopes/rust/statement.iteration.class.scope b/data/fixtures/scopes/rust/statement/statement.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.iteration.class.scope rename to data/fixtures/scopes/rust/statement/statement.iteration.class.scope diff --git a/data/fixtures/scopes/rust/statement.iteration.document.scope b/data/fixtures/scopes/rust/statement/statement.iteration.document.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.iteration.document.scope rename to data/fixtures/scopes/rust/statement/statement.iteration.document.scope diff --git a/data/fixtures/scopes/rust/statement.iteration.interface.scope b/data/fixtures/scopes/rust/statement/statement.iteration.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.iteration.interface.scope rename to data/fixtures/scopes/rust/statement/statement.iteration.interface.scope diff --git a/data/fixtures/scopes/rust/statement.method.scope b/data/fixtures/scopes/rust/statement/statement.method.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.method.scope rename to data/fixtures/scopes/rust/statement/statement.method.scope 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..b04aa31f7a --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.namespace.scope @@ -0,0 +1,2 @@ +mod foo {} +--- 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..476f32e791 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.return.scope @@ -0,0 +1,4 @@ +fn foo() { + return 0; +} +--- diff --git a/data/fixtures/scopes/rust/statement.switch.scope b/data/fixtures/scopes/rust/statement/statement.switch.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.switch.scope rename to data/fixtures/scopes/rust/statement/statement.switch.scope diff --git a/data/fixtures/scopes/rust/statement.variable.scope b/data/fixtures/scopes/rust/statement/statement.variable.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.variable.scope rename to data/fixtures/scopes/rust/statement/statement.variable.scope diff --git a/data/fixtures/scopes/rust/statement.while.scope b/data/fixtures/scopes/rust/statement/statement.while.scope similarity index 100% rename from data/fixtures/scopes/rust/statement.while.scope rename to data/fixtures/scopes/rust/statement/statement.while.scope diff --git a/data/fixtures/scopes/rust/string.multiLine.scope b/data/fixtures/scopes/rust/string.multiLine.scope new file mode 100644 index 0000000000..c81982a966 --- /dev/null +++ b/data/fixtures/scopes/rust/string.multiLine.scope @@ -0,0 +1,3 @@ +"Hello +world" +--- 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..84088c675e --- /dev/null +++ b/data/fixtures/scopes/rust/textFragment.comment.block.scope @@ -0,0 +1,2 @@ +/* Hello world */ +--- 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..d746e0ea96 --- /dev/null +++ b/data/fixtures/scopes/rust/textFragment.comment.line.scope @@ -0,0 +1,2 @@ +// Hello world +--- 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..c81982a966 --- /dev/null +++ b/data/fixtures/scopes/rust/textFragment.string.multiLine.scope @@ -0,0 +1,3 @@ +"Hello +world" +--- diff --git a/data/fixtures/scopes/rust/textFragment.string.singleLine.scope b/data/fixtures/scopes/rust/textFragment.string.singleLine.scope index 85dcf5fa7f..52add4b58e 100644 --- a/data/fixtures/scopes/rust/textFragment.string.singleLine.scope +++ b/data/fixtures/scopes/rust/textFragment.string.singleLine.scope @@ -1,3 +1,4 @@ +tend "Hello world" --- 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..dbefef6416 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.alias.scope @@ -0,0 +1,2 @@ +type Foo = Bar; +--- diff --git a/data/fixtures/scopes/rust/type.argument.formal.iteration.scope b/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope similarity index 100% rename from data/fixtures/scopes/rust/type.argument.formal.iteration.scope rename to data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope diff --git a/data/fixtures/scopes/rust/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope similarity index 100% rename from data/fixtures/scopes/rust/type.argument.formal.method.iteration.scope rename to data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope diff --git a/data/fixtures/scopes/rust/type.argument.formal.method.scope b/data/fixtures/scopes/rust/type/type.argument.formal.method.scope similarity index 100% rename from data/fixtures/scopes/rust/type.argument.formal.method.scope rename to data/fixtures/scopes/rust/type/type.argument.formal.method.scope diff --git a/data/fixtures/scopes/rust/type.argument.formal.scope b/data/fixtures/scopes/rust/type/type.argument.formal.scope similarity index 100% rename from data/fixtures/scopes/rust/type.argument.formal.scope rename to data/fixtures/scopes/rust/type/type.argument.formal.scope 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..57a20d0547 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.cast.scope @@ -0,0 +1,2 @@ +foo as i32 +--- diff --git a/data/fixtures/scopes/rust/type.class.scope b/data/fixtures/scopes/rust/type/type.class.scope similarity index 100% rename from data/fixtures/scopes/rust/type.class.scope rename to data/fixtures/scopes/rust/type/type.class.scope diff --git a/data/fixtures/scopes/rust/type.enum.scope b/data/fixtures/scopes/rust/type/type.enum.scope similarity index 100% rename from data/fixtures/scopes/rust/type.enum.scope rename to data/fixtures/scopes/rust/type/type.enum.scope 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..68685842e4 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.field.class.scope @@ -0,0 +1,4 @@ +struct Foo { + bar: i32 +} +--- diff --git a/data/fixtures/scopes/rust/type/type.field.interface.scope b/data/fixtures/scopes/rust/type/type.field.interface.scope new file mode 100644 index 0000000000..68685842e4 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.field.interface.scope @@ -0,0 +1,4 @@ +struct Foo { + bar: i32 +} +--- diff --git a/data/fixtures/scopes/rust/type.interface.scope b/data/fixtures/scopes/rust/type/type.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/type.interface.scope rename to data/fixtures/scopes/rust/type/type.interface.scope 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..e9b223dfe5 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.block.scope @@ -0,0 +1,2 @@ +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..4d80bbf0ec --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.block2.scope @@ -0,0 +1,2 @@ +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..6d96e6a130 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.iteration.block3.scope @@ -0,0 +1,2 @@ +while true { } +--- diff --git a/data/fixtures/scopes/rust/type.iteration.class.scope b/data/fixtures/scopes/rust/type/type.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/rust/type.iteration.class.scope rename to data/fixtures/scopes/rust/type/type.iteration.class.scope diff --git a/data/fixtures/scopes/rust/type.iteration.document.scope b/data/fixtures/scopes/rust/type/type.iteration.document.scope similarity index 100% rename from data/fixtures/scopes/rust/type.iteration.document.scope rename to data/fixtures/scopes/rust/type/type.iteration.document.scope diff --git a/data/fixtures/scopes/rust/type.iteration.interface.scope b/data/fixtures/scopes/rust/type/type.iteration.interface.scope similarity index 100% rename from data/fixtures/scopes/rust/type.iteration.interface.scope rename to data/fixtures/scopes/rust/type/type.iteration.interface.scope diff --git a/data/fixtures/scopes/rust/type.return.scope b/data/fixtures/scopes/rust/type/type.return.scope similarity index 100% rename from data/fixtures/scopes/rust/type.return.scope rename to data/fixtures/scopes/rust/type/type.return.scope 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..0718c1afba --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope @@ -0,0 +1,2 @@ +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..0718c1afba --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.typeArgument.scope @@ -0,0 +1,2 @@ +Foo +--- diff --git a/data/fixtures/scopes/rust/type.variable.scope b/data/fixtures/scopes/rust/type/type.variable.scope similarity index 100% rename from data/fixtures/scopes/rust/type.variable.scope rename to data/fixtures/scopes/rust/type/type.variable.scope diff --git a/data/fixtures/scopes/rust/value.assignment.scope b/data/fixtures/scopes/rust/value/value.assignment.scope similarity index 100% rename from data/fixtures/scopes/rust/value.assignment.scope rename to data/fixtures/scopes/rust/value/value.assignment.scope diff --git a/data/fixtures/scopes/rust/value.foreach.scope b/data/fixtures/scopes/rust/value/value.foreach.scope similarity index 100% rename from data/fixtures/scopes/rust/value.foreach.scope rename to data/fixtures/scopes/rust/value/value.foreach.scope 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..e9b223dfe5 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.block.scope @@ -0,0 +1,2 @@ +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..4d80bbf0ec --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.block2.scope @@ -0,0 +1,2 @@ +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..6d96e6a130 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.block3.scope @@ -0,0 +1,2 @@ +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..dc0488fdba --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.class.scope @@ -0,0 +1,2 @@ +impl 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..3aab0af0e0 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.iteration.document.scope @@ -0,0 +1,4 @@ + +let foo = 0; + +--- 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..37f0a0919b --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.return.lambda.scope @@ -0,0 +1,2 @@ +|| 0; +--- 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..476f32e791 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.return.scope @@ -0,0 +1,4 @@ +fn foo() { + return 0; +} +--- diff --git a/data/fixtures/scopes/rust/value.switch.scope b/data/fixtures/scopes/rust/value/value.switch.scope similarity index 100% rename from data/fixtures/scopes/rust/value.switch.scope rename to data/fixtures/scopes/rust/value/value.switch.scope 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..dbefef6416 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.typeAlias.scope @@ -0,0 +1,2 @@ +type Foo = Bar; +--- diff --git a/data/fixtures/scopes/rust/value.variable.scope b/data/fixtures/scopes/rust/value/value.variable.scope similarity index 100% rename from data/fixtures/scopes/rust/value.variable.scope rename to data/fixtures/scopes/rust/value/value.variable.scope diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index aa6dad1f7d..b6dd4f7fe6 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -76,6 +76,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.interface": supported, "statement.enum": supported, "statement.field.class": supported, + "statement.field.interface": supported, "statement.function": supported, "statement.method": supported, "statement.if": supported, @@ -111,6 +112,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.interface": supported, "name.enum": supported, "name.field.class": supported, + "name.field.interface": supported, "name.field.enum": supported, "name.foreach": supported, "name.function": supported, @@ -126,8 +128,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "value.assignment": supported, "value.foreach": supported, - "value.field.class": supported, - "value.field.enum": supported, "value.return": supported, "value.return.lambda": supported, "value.switch": supported, @@ -145,6 +145,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": supported, "type.interface": supported, "type.field.class": supported, + "type.field.interface": supported, "type.return": supported, "type.variable": supported, "type.typeArgument": supported, @@ -279,11 +280,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "branch.loop.iteration": notApplicable, "condition.ternary": notApplicable, - // Interface fields - "statement.field.interface": notApplicable, - "name.field.interface": notApplicable, - "type.field.interface": notApplicable, - // Collection items without delimiters "collectionItem.unenclosed.singleLine": notApplicable, "collectionItem.unenclosed.multiLine": notApplicable, @@ -297,8 +293,12 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { notebookCell: notApplicable, "interior.cell": notApplicable, - // Miscellaneous + // Field values + "value.field.enum": notApplicable, + "value.field.class": notApplicable, "value.iteration.enum": notApplicable, + + // Miscellaneous "statement.static": notApplicable, "statement.misc": notApplicable, "type.foreach": notApplicable, From d11d8efd3f412d0c8cd8177f090c5bc567626a30 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 13:42:18 +0100 Subject: [PATCH 03/14] Updated scope fixtures --- .../scopes/rust/anonymousFunction.scope | 8 +++ .../scopes/rust/anonymousFunction2.scope | 8 +++ .../argument/argument.actual.iteration.scope | 8 +++ .../argument.actual.method.iteration.scope | 8 +++ .../argument.actual.method.multiLine.scope | 39 +++++++++++ .../argument.actual.method.singleLine.scope | 31 +++++++++ .../argument/argument.actual.multiLine.scope | 39 +++++++++++ .../argument/argument.actual.singleLine.scope | 31 +++++++++ .../argument/argument.formal.iteration.scope | 8 +++ .../argument.formal.method.iteration.scope | 8 +++ .../argument.formal.method.multiLine.scope | 65 +++++++++++++++++++ .../argument.formal.method.singleLine.scope | 51 +++++++++++++++ .../argument/argument.formal.multiLine.scope | 39 +++++++++++ .../argument/argument.formal.singleLine.scope | 31 +++++++++ .../argumentList.actual.empty.scope | 11 ++++ .../argumentList.actual.method.empty.scope | 11 ++++ ...rgumentList.actual.method.singleLine.scope | 11 ++++ .../argumentList.actual.singleLine.scope | 11 ++++ .../argumentList.formal.empty.scope | 11 ++++ .../argumentList.formal.method.empty.scope | 11 ++++ ...rgumentList.formal.method.singleLine.scope | 11 ++++ .../argumentList.formal.singleLine.scope | 11 ++++ .../rust/branch/branch.if.elif.else.scope | 41 ++++++++++++ .../scopes/rust/branch/branch.if.else.scope | 22 +++++++ .../scopes/rust/branch/branch.if.scope | 8 +++ .../rust/branch/branch.switchCase.scope | 35 ++++++++++ data/fixtures/scopes/rust/comment.block.scope | 8 +++ data/fixtures/scopes/rust/comment.line.scope | 8 +++ data/fixtures/scopes/rust/condition.if.scope | 48 ++++++++++++++ .../scopes/rust/condition.while.scope | 22 +++++++ .../scopes/rust/functionCall.chain.scope | 17 +++++ .../scopes/rust/functionCall.method.scope | 8 +++ data/fixtures/scopes/rust/functionCall.scope | 8 +++ .../scopes/rust/functionCallee.chain.scope | 23 +++++++ .../scopes/rust/functionCallee.method.scope | 11 ++++ .../fixtures/scopes/rust/functionCallee.scope | 11 ++++ .../rust/name/name.argument.formal.scope | 46 +++++++++++++ .../fixtures/scopes/rust/name/name.enum.scope | 22 +++++++ .../scopes/rust/name/name.field.class.scope | 44 +++++++++++++ .../scopes/rust/name/name.field.enum.scope | 60 +++++++++++++++++ .../rust/name/name.field.interface.scope | 44 +++++++++++++ .../scopes/rust/name/name.function.scope | 15 +++++ .../scopes/rust/name/name.interface.scope | 22 +++++++ .../scopes/rust/namedFunction.method.scope | 17 +++++ data/fixtures/scopes/rust/namedFunction.scope | 10 ++- .../rust/statement/statement.assignment.scope | 8 +++ .../rust/statement/statement.break.scope | 8 +++ .../rust/statement/statement.class.scope | 8 +++ .../rust/statement/statement.continue.scope | 8 +++ .../rust/statement/statement.enum.scope | 13 ++-- .../rust/statement/statement.foreach.scope | 8 +++ .../rust/statement/statement.function.scope | 8 +++ .../scopes/rust/statement/statement.if.scope | 11 ++++ .../rust/statement/statement.interface.scope | 8 +++ .../rust/statement/statement.method.scope | 29 +++++++++ .../rust/statement/statement.namespace.scope | 8 +++ .../rust/statement/statement.return.scope | 29 +++++++++ .../rust/statement/statement.switch.scope | 10 ++- .../rust/statement/statement.variable.scope | 8 +++ .../rust/statement/statement.while.scope | 8 +++ .../scopes/rust/string.multiLine.scope | 12 +++- .../rust/textFragment.comment.block.scope | 8 +++ .../rust/textFragment.comment.line.scope | 8 +++ .../rust/textFragment.string.multiLine.scope | 10 +++ .../rust/textFragment.string.singleLine.scope | 1 - .../rust/type/type.argument.formal.scope | 37 +++++++++++ .../scopes/rust/type/type.field.class.scope | 4 -- .../rust/type/type.field.interface.scope | 30 +++++++++ .../scopes/rust/type/type.interface.scope | 8 +++ .../scopes/rust/type/type.return.scope | 18 +++++ .../scopes/rust/type/type.variable.scope | 18 +++++ .../scopes/rust/value/value.switch.scope | 22 +++++++ .../scopes/rust/value/value.variable.scope | 18 +++++ .../common/src/scopeSupportFacets/rust.ts | 12 ++-- 74 files changed, 1373 insertions(+), 17 deletions(-) delete mode 100644 data/fixtures/scopes/rust/type/type.field.class.scope diff --git a/data/fixtures/scopes/rust/anonymousFunction.scope b/data/fixtures/scopes/rust/anonymousFunction.scope index 91ff8b7a39..80d49da26c 100644 --- a/data/fixtures/scopes/rust/anonymousFunction.scope +++ b/data/fixtures/scopes/rust/anonymousFunction.scope @@ -1,2 +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 index aa77ec1f97..cc09713a22 100644 --- a/data/fixtures/scopes/rust/anonymousFunction2.scope +++ b/data/fixtures/scopes/rust/anonymousFunction2.scope @@ -1,2 +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 index 131575792b..3f067b0c64 100644 --- a/data/fixtures/scopes/rust/argument/argument.actual.iteration.scope +++ b/data/fixtures/scopes/rust/argument/argument.actual.iteration.scope @@ -1,2 +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 index 24a8fe9f03..7dc906b75a 100644 --- a/data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.iteration.scope @@ -1,2 +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 index 026ff44a9d..f75aaa48de 100644 --- a/data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.multiLine.scope @@ -3,3 +3,42 @@ foo.bar( 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 index 24a8fe9f03..46548a2c6c 100644 --- a/data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.actual.method.singleLine.scope @@ -1,2 +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 index f5787791ec..6f7ea31f22 100644 --- a/data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.actual.multiLine.scope @@ -3,3 +3,42 @@ foo( 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 index 131575792b..2e62d177c3 100644 --- a/data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.actual.singleLine.scope @@ -1,2 +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 index b880325366..9fc48cbd24 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.iteration.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.iteration.scope @@ -1,2 +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.method.iteration.scope b/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope index acb0ec6ac6..454b53a574 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.iteration.scope @@ -2,3 +2,11 @@ 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 index c0ca23eac0..2c2af36616 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.multiLine.scope @@ -6,3 +6,68 @@ impl Foo { ) {} } --- + +[#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 index acb0ec6ac6..91942d4c51 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.method.singleLine.scope @@ -2,3 +2,54 @@ 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 index d2b1c6f00d..6f12ef5327 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.multiLine.scope @@ -3,3 +3,42 @@ fn foo( 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 index b880325366..a54502db79 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.singleLine.scope @@ -1,2 +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 index 2d962ce4fa..539138bcb6 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.empty.scope @@ -1,2 +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 index a797e7b747..91d34a15d7 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.empty.scope @@ -1,2 +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.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope index 24a8fe9f03..9a937e7bf7 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.singleLine.scope @@ -1,2 +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.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope index 131575792b..d649112ab5 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.singleLine.scope @@ -1,2 +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 index 44f86994f4..161eaa8d90 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.empty.scope @@ -1,2 +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.method.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope index 974ca58ae6..a91f2deb2a 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.empty.scope @@ -2,3 +2,14 @@ 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.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope index acb0ec6ac6..7544b94745 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.singleLine.scope @@ -2,3 +2,14 @@ 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.singleLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope index b880325366..3f91b34248 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.singleLine.scope @@ -1,2 +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 index b366308c1e..1ecccdc533 100644 --- a/data/fixtures/scopes/rust/branch/branch.if.elif.else.scope +++ b/data/fixtures/scopes/rust/branch/branch.if.elif.else.scope @@ -2,3 +2,44 @@ 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 index ec0727d0b2..66e50525a9 100644 --- a/data/fixtures/scopes/rust/branch/branch.if.else.scope +++ b/data/fixtures/scopes/rust/branch/branch.if.else.scope @@ -1,3 +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.scope b/data/fixtures/scopes/rust/branch/branch.if.scope index 239d14a8c1..95d75aa3fb 100644 --- a/data/fixtures/scopes/rust/branch/branch.if.scope +++ b/data/fixtures/scopes/rust/branch/branch.if.scope @@ -1,2 +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.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.scope index 6ef5dc4e13..26ac8d3a4e 100644 --- a/data/fixtures/scopes/rust/branch/branch.switchCase.scope +++ b/data/fixtures/scopes/rust/branch/branch.switchCase.scope @@ -3,3 +3,38 @@ match foo { _ => "_", } --- + +[#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/comment.block.scope b/data/fixtures/scopes/rust/comment.block.scope index 84088c675e..5e8b51111c 100644 --- a/data/fixtures/scopes/rust/comment.block.scope +++ b/data/fixtures/scopes/rust/comment.block.scope @@ -1,2 +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 index b9656a1918..7d1477b8a1 100644 --- a/data/fixtures/scopes/rust/comment.line.scope +++ b/data/fixtures/scopes/rust/comment.line.scope @@ -1,2 +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 index b366308c1e..c4bc11ae65 100644 --- a/data/fixtures/scopes/rust/condition.if.scope +++ b/data/fixtures/scopes/rust/condition.if.scope @@ -2,3 +2,51 @@ 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.while.scope b/data/fixtures/scopes/rust/condition.while.scope index ce25ab0ad8..c060b822ff 100644 --- a/data/fixtures/scopes/rust/condition.while.scope +++ b/data/fixtures/scopes/rust/condition.while.scope @@ -1,2 +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 index 633f0ca24d..6297108ea1 100644 --- a/data/fixtures/scopes/rust/functionCall.chain.scope +++ b/data/fixtures/scopes/rust/functionCall.chain.scope @@ -1,2 +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 index a797e7b747..87d426d2ed 100644 --- a/data/fixtures/scopes/rust/functionCall.method.scope +++ b/data/fixtures/scopes/rust/functionCall.method.scope @@ -1,2 +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 index 2d962ce4fa..633f02ca5e 100644 --- a/data/fixtures/scopes/rust/functionCall.scope +++ b/data/fixtures/scopes/rust/functionCall.scope @@ -1,2 +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 index 633f0ca24d..b4a1e073a1 100644 --- a/data/fixtures/scopes/rust/functionCallee.chain.scope +++ b/data/fixtures/scopes/rust/functionCallee.chain.scope @@ -1,2 +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 index a797e7b747..f30f0f7536 100644 --- a/data/fixtures/scopes/rust/functionCallee.method.scope +++ b/data/fixtures/scopes/rust/functionCallee.method.scope @@ -1,2 +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 index 2d962ce4fa..3071a48ae9 100644 --- a/data/fixtures/scopes/rust/functionCallee.scope +++ b/data/fixtures/scopes/rust/functionCallee.scope @@ -1,2 +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/name/name.argument.formal.scope b/data/fixtures/scopes/rust/name/name.argument.formal.scope index b880325366..5f8b25f7e9 100644 --- a/data/fixtures/scopes/rust/name/name.argument.formal.scope +++ b/data/fixtures/scopes/rust/name/name.argument.formal.scope @@ -1,2 +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.enum.scope b/data/fixtures/scopes/rust/name/name.enum.scope index aac4cd6aba..09d2849071 100644 --- a/data/fixtures/scopes/rust/name/name.enum.scope +++ b/data/fixtures/scopes/rust/name/name.enum.scope @@ -1,2 +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 index 68685842e4..4b850b0b22 100644 --- a/data/fixtures/scopes/rust/name/name.field.class.scope +++ b/data/fixtures/scopes/rust/name/name.field.class.scope @@ -2,3 +2,47 @@ 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 index e31a653808..375c265add 100644 --- a/data/fixtures/scopes/rust/name/name.field.enum.scope +++ b/data/fixtures/scopes/rust/name/name.field.enum.scope @@ -3,3 +3,63 @@ enum Foo { 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.field.interface.scope b/data/fixtures/scopes/rust/name/name.field.interface.scope index 68685842e4..4b850b0b22 100644 --- a/data/fixtures/scopes/rust/name/name.field.interface.scope +++ b/data/fixtures/scopes/rust/name/name.field.interface.scope @@ -2,3 +2,47 @@ 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.function.scope b/data/fixtures/scopes/rust/name/name.function.scope index 44f86994f4..9220e11ce3 100644 --- a/data/fixtures/scopes/rust/name/name.function.scope +++ b/data/fixtures/scopes/rust/name/name.function.scope @@ -1,2 +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.interface.scope b/data/fixtures/scopes/rust/name/name.interface.scope index 50e7a22284..df39081c82 100644 --- a/data/fixtures/scopes/rust/name/name.interface.scope +++ b/data/fixtures/scopes/rust/name/name.interface.scope @@ -1,2 +1,24 @@ struct Foo {} --- + +[Content] = 0:7-0:10 + >---< +0| struct Foo {} + +[Removal] = 0:7-0:11 + >----< +0| struct Foo {} + +[Leading delimiter] = 0:6-0:7 + >-< +0| struct Foo {} + +[Trailing delimiter] = 0:10-0:11 + >-< +0| struct Foo {} + +[Domain] = 0:0-0:13 + >-------------< +0| struct Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/namedFunction.method.scope b/data/fixtures/scopes/rust/namedFunction.method.scope index 974ca58ae6..67248e9d40 100644 --- a/data/fixtures/scopes/rust/namedFunction.method.scope +++ b/data/fixtures/scopes/rust/namedFunction.method.scope @@ -2,3 +2,20 @@ 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 index 8ccb0511f5..d847115c79 100644 --- a/data/fixtures/scopes/rust/namedFunction.scope +++ b/data/fixtures/scopes/rust/namedFunction.scope @@ -1,2 +1,10 @@ -fn add() {} +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 index 20f7e72f3d..552bf9f507 100644 --- a/data/fixtures/scopes/rust/statement/statement.assignment.scope +++ b/data/fixtures/scopes/rust/statement/statement.assignment.scope @@ -1,2 +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 index 7863b4df76..5bc394c171 100644 --- a/data/fixtures/scopes/rust/statement/statement.break.scope +++ b/data/fixtures/scopes/rust/statement/statement.break.scope @@ -1,2 +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 index 77e974ce62..6031e72b81 100644 --- a/data/fixtures/scopes/rust/statement/statement.class.scope +++ b/data/fixtures/scopes/rust/statement/statement.class.scope @@ -1,2 +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.continue.scope b/data/fixtures/scopes/rust/statement/statement.continue.scope index 6adcf6b580..d6ef1a4919 100644 --- a/data/fixtures/scopes/rust/statement/statement.continue.scope +++ b/data/fixtures/scopes/rust/statement/statement.continue.scope @@ -1,2 +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 index ffbaae62e0..88dd9cd028 100644 --- a/data/fixtures/scopes/rust/statement/statement.enum.scope +++ b/data/fixtures/scopes/rust/statement/statement.enum.scope @@ -1,5 +1,10 @@ -enum Foo { - Bar, - Baz -} +enum Foo {} --- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| enum Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.foreach.scope b/data/fixtures/scopes/rust/statement/statement.foreach.scope index 7d64e5d97f..823a899261 100644 --- a/data/fixtures/scopes/rust/statement/statement.foreach.scope +++ b/data/fixtures/scopes/rust/statement/statement.foreach.scope @@ -1,2 +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 index 44f86994f4..6df3e3378c 100644 --- a/data/fixtures/scopes/rust/statement/statement.function.scope +++ b/data/fixtures/scopes/rust/statement/statement.function.scope @@ -1,2 +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 index b366308c1e..e0d492e889 100644 --- a/data/fixtures/scopes/rust/statement/statement.if.scope +++ b/data/fixtures/scopes/rust/statement/statement.if.scope @@ -2,3 +2,14 @@ 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.interface.scope b/data/fixtures/scopes/rust/statement/statement.interface.scope index 50e7a22284..823d046f92 100644 --- a/data/fixtures/scopes/rust/statement/statement.interface.scope +++ b/data/fixtures/scopes/rust/statement/statement.interface.scope @@ -1,2 +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.method.scope b/data/fixtures/scopes/rust/statement/statement.method.scope index 974ca58ae6..77c7c405a9 100644 --- a/data/fixtures/scopes/rust/statement/statement.method.scope +++ b/data/fixtures/scopes/rust/statement/statement.method.scope @@ -2,3 +2,32 @@ 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 index b04aa31f7a..5816f83443 100644 --- a/data/fixtures/scopes/rust/statement/statement.namespace.scope +++ b/data/fixtures/scopes/rust/statement/statement.namespace.scope @@ -1,2 +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 index 476f32e791..4a89bd1051 100644 --- a/data/fixtures/scopes/rust/statement/statement.return.scope +++ b/data/fixtures/scopes/rust/statement/statement.return.scope @@ -2,3 +2,32 @@ 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 index 76d358e35d..4514996a58 100644 --- a/data/fixtures/scopes/rust/statement/statement.switch.scope +++ b/data/fixtures/scopes/rust/statement/statement.switch.scope @@ -1,2 +1,10 @@ -match foo { } +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 index 79e524940f..cebc33100e 100644 --- a/data/fixtures/scopes/rust/statement/statement.variable.scope +++ b/data/fixtures/scopes/rust/statement/statement.variable.scope @@ -1,2 +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 index ce25ab0ad8..fbccae0780 100644 --- a/data/fixtures/scopes/rust/statement/statement.while.scope +++ b/data/fixtures/scopes/rust/statement/statement.while.scope @@ -1,2 +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 index c81982a966..e8f7baaa0a 100644 --- a/data/fixtures/scopes/rust/string.multiLine.scope +++ b/data/fixtures/scopes/rust/string.multiLine.scope @@ -1,3 +1,13 @@ -"Hello +"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 index 84088c675e..af33f95d00 100644 --- a/data/fixtures/scopes/rust/textFragment.comment.block.scope +++ b/data/fixtures/scopes/rust/textFragment.comment.block.scope @@ -1,2 +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 index d746e0ea96..ea0785d04c 100644 --- a/data/fixtures/scopes/rust/textFragment.comment.line.scope +++ b/data/fixtures/scopes/rust/textFragment.comment.line.scope @@ -1,2 +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 index c81982a966..e549ddb4cf 100644 --- a/data/fixtures/scopes/rust/textFragment.string.multiLine.scope +++ b/data/fixtures/scopes/rust/textFragment.string.multiLine.scope @@ -1,3 +1,13 @@ "Hello world" --- + +[Content] = +[Removal] = +[Domain] = 0:1-1:5 + >------ +0| "Hello +1| world" + -----< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/textFragment.string.singleLine.scope b/data/fixtures/scopes/rust/textFragment.string.singleLine.scope index 52add4b58e..85dcf5fa7f 100644 --- a/data/fixtures/scopes/rust/textFragment.string.singleLine.scope +++ b/data/fixtures/scopes/rust/textFragment.string.singleLine.scope @@ -1,4 +1,3 @@ -tend "Hello world" --- diff --git a/data/fixtures/scopes/rust/type/type.argument.formal.scope b/data/fixtures/scopes/rust/type/type.argument.formal.scope index b880325366..a01af2d6e2 100644 --- a/data/fixtures/scopes/rust/type/type.argument.formal.scope +++ b/data/fixtures/scopes/rust/type/type.argument.formal.scope @@ -1,2 +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.field.class.scope b/data/fixtures/scopes/rust/type/type.field.class.scope deleted file mode 100644 index 68685842e4..0000000000 --- a/data/fixtures/scopes/rust/type/type.field.class.scope +++ /dev/null @@ -1,4 +0,0 @@ -struct Foo { - bar: i32 -} ---- diff --git a/data/fixtures/scopes/rust/type/type.field.interface.scope b/data/fixtures/scopes/rust/type/type.field.interface.scope index 68685842e4..2c9cea111d 100644 --- a/data/fixtures/scopes/rust/type/type.field.interface.scope +++ b/data/fixtures/scopes/rust/type/type.field.interface.scope @@ -2,3 +2,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] = " " + + +[#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.interface.scope b/data/fixtures/scopes/rust/type/type.interface.scope index 50e7a22284..3980a2afac 100644 --- a/data/fixtures/scopes/rust/type/type.interface.scope +++ b/data/fixtures/scopes/rust/type/type.interface.scope @@ -1,2 +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.return.scope b/data/fixtures/scopes/rust/type/type.return.scope index f8da8bcbbb..7f38760412 100644 --- a/data/fixtures/scopes/rust/type/type.return.scope +++ b/data/fixtures/scopes/rust/type/type.return.scope @@ -1,2 +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.variable.scope b/data/fixtures/scopes/rust/type/type.variable.scope index 5073e4acc9..db655fb406 100644 --- a/data/fixtures/scopes/rust/type/type.variable.scope +++ b/data/fixtures/scopes/rust/type/type.variable.scope @@ -1,2 +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.switch.scope b/data/fixtures/scopes/rust/value/value.switch.scope index 9a5a295aaf..35a0e165ee 100644 --- a/data/fixtures/scopes/rust/value/value.switch.scope +++ b/data/fixtures/scopes/rust/value/value.switch.scope @@ -1,2 +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.variable.scope b/data/fixtures/scopes/rust/value/value.variable.scope index 79e524940f..f8b68f4784 100644 --- a/data/fixtures/scopes/rust/value/value.variable.scope +++ b/data/fixtures/scopes/rust/value/value.variable.scope @@ -1,2 +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/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index b6dd4f7fe6..f8cc0b1ab4 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -75,7 +75,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.class": supported, "statement.interface": supported, "statement.enum": supported, - "statement.field.class": supported, "statement.field.interface": supported, "statement.function": supported, "statement.method": supported, @@ -111,7 +110,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.class": supported, "name.interface": supported, "name.enum": supported, - "name.field.class": supported, "name.field.interface": supported, "name.field.enum": supported, "name.foreach": supported, @@ -144,7 +142,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.class": supported, "type.enum": supported, "type.interface": supported, - "type.field.class": supported, "type.field.interface": supported, "type.return": supported, "type.variable": supported, @@ -293,11 +290,16 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { notebookCell: notApplicable, "interior.cell": notApplicable, - // Field values + // Enum field values "value.field.enum": notApplicable, - "value.field.class": notApplicable, "value.iteration.enum": notApplicable, + // Class field values + "statement.field.class": notApplicable, + "name.field.class": notApplicable, + "value.field.class": notApplicable, + "type.field.class": notApplicable, + // Miscellaneous "statement.static": notApplicable, "statement.misc": notApplicable, From 13c6b8ce555ae1355335073f0dd972a387378505 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 13:43:44 +0100 Subject: [PATCH 04/14] Remove files --- .../scopes/rust/name/name.field.class.scope | 48 ------------------- .../statement/statement.field.class.scope | 4 -- 2 files changed, 52 deletions(-) delete mode 100644 data/fixtures/scopes/rust/name/name.field.class.scope delete mode 100644 data/fixtures/scopes/rust/statement/statement.field.class.scope diff --git a/data/fixtures/scopes/rust/name/name.field.class.scope b/data/fixtures/scopes/rust/name/name.field.class.scope deleted file mode 100644 index 4b850b0b22..0000000000 --- a/data/fixtures/scopes/rust/name/name.field.class.scope +++ /dev/null @@ -1,48 +0,0 @@ -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/statement/statement.field.class.scope b/data/fixtures/scopes/rust/statement/statement.field.class.scope deleted file mode 100644 index 68685842e4..0000000000 --- a/data/fixtures/scopes/rust/statement/statement.field.class.scope +++ /dev/null @@ -1,4 +0,0 @@ -struct Foo { - bar: i32 -} ---- From 20e8997b1cce148893d02a33a98bbedd28fa494b Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 14:23:43 +0100 Subject: [PATCH 05/14] More scopes --- .../rust/class.iteration.document.scope | 8 +++ data/fixtures/scopes/rust/class.scope | 8 +++ .../scopes/rust/name/name.class.scope | 22 +++++++ .../scopes/rust/name/name.field.class.scope | 48 ++++++++++++++ .../rust/name/name.iteration.document.scope | 8 +++ .../scopes/rust/name/name.method.scope | 41 ++++++++++++ .../scopes/rust/name/name.namespace.scope | 22 +++++++ .../scopes/rust/name/name.variable.scope | 22 +++++++ .../namedFunction.iteration.document.scope | 10 ++- .../rust/statement/statement.class2.scope | 10 +++ .../statement/statement.field.class.scope | 33 ++++++++++ .../statement/statement.field.interface.scope | 29 ++++++++ .../statement.iteration.document.scope | 8 +++ .../scopes/rust/type/type.class.scope | 8 +++ .../scopes/rust/type/type.class2.scope | 10 +++ .../fixtures/scopes/rust/type/type.enum.scope | 8 +++ .../scopes/rust/type/type.field.class.scope | 34 ++++++++++ .../rust/type/type.iteration.document.scope | 8 +++ .../rust/value/value.iteration.document.scope | 8 +++ .../common/src/scopeSupportFacets/rust.ts | 10 ++- queries/rust.scm | 66 ++++++++++++------- 21 files changed, 389 insertions(+), 32 deletions(-) create mode 100644 data/fixtures/scopes/rust/name/name.field.class.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.class2.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.field.class.scope create mode 100644 data/fixtures/scopes/rust/type/type.class2.scope create mode 100644 data/fixtures/scopes/rust/type/type.field.class.scope diff --git a/data/fixtures/scopes/rust/class.iteration.document.scope b/data/fixtures/scopes/rust/class.iteration.document.scope index e0ab69e3cf..c3d14f02e1 100644 --- a/data/fixtures/scopes/rust/class.iteration.document.scope +++ b/data/fixtures/scopes/rust/class.iteration.document.scope @@ -2,3 +2,11 @@ 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 index 77e974ce62..752cf34874 100644 --- a/data/fixtures/scopes/rust/class.scope +++ b/data/fixtures/scopes/rust/class.scope @@ -1,2 +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/name/name.class.scope b/data/fixtures/scopes/rust/name/name.class.scope index 77e974ce62..dedafe1ef0 100644 --- a/data/fixtures/scopes/rust/name/name.class.scope +++ b/data/fixtures/scopes/rust/name/name.class.scope @@ -1,2 +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.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.iteration.document.scope b/data/fixtures/scopes/rust/name/name.iteration.document.scope index 1837707f91..06aef70af3 100644 --- a/data/fixtures/scopes/rust/name/name.iteration.document.scope +++ b/data/fixtures/scopes/rust/name/name.iteration.document.scope @@ -2,3 +2,11 @@ impl Foo {} --- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| impl Foo {} +2| + < diff --git a/data/fixtures/scopes/rust/name/name.method.scope b/data/fixtures/scopes/rust/name/name.method.scope index 974ca58ae6..b6a6fe7c56 100644 --- a/data/fixtures/scopes/rust/name/name.method.scope +++ b/data/fixtures/scopes/rust/name/name.method.scope @@ -2,3 +2,44 @@ 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 index b04aa31f7a..dd3d5a9f27 100644 --- a/data/fixtures/scopes/rust/name/name.namespace.scope +++ b/data/fixtures/scopes/rust/name/name.namespace.scope @@ -1,2 +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.scope b/data/fixtures/scopes/rust/name/name.variable.scope index 79e524940f..9cb426ea51 100644 --- a/data/fixtures/scopes/rust/name/name.variable.scope +++ b/data/fixtures/scopes/rust/name/name.variable.scope @@ -1,2 +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/namedFunction.iteration.document.scope b/data/fixtures/scopes/rust/namedFunction.iteration.document.scope index 1837707f91..34670717b3 100644 --- a/data/fixtures/scopes/rust/namedFunction.iteration.document.scope +++ b/data/fixtures/scopes/rust/namedFunction.iteration.document.scope @@ -1,4 +1,12 @@ -impl Foo {} +fn foo() {} --- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| fn foo() {} +2| + < 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.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.field.interface.scope b/data/fixtures/scopes/rust/statement/statement.field.interface.scope index 68685842e4..e9fa5577a4 100644 --- a/data/fixtures/scopes/rust/statement/statement.field.interface.scope +++ b/data/fixtures/scopes/rust/statement/statement.field.interface.scope @@ -2,3 +2,32 @@ 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.iteration.document.scope b/data/fixtures/scopes/rust/statement/statement.iteration.document.scope index 3aab0af0e0..62106ef21a 100644 --- a/data/fixtures/scopes/rust/statement/statement.iteration.document.scope +++ b/data/fixtures/scopes/rust/statement/statement.iteration.document.scope @@ -2,3 +2,11 @@ let foo = 0; --- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| let foo = 0; +2| + < diff --git a/data/fixtures/scopes/rust/type/type.class.scope b/data/fixtures/scopes/rust/type/type.class.scope index 77e974ce62..fd99c224a2 100644 --- a/data/fixtures/scopes/rust/type/type.class.scope +++ b/data/fixtures/scopes/rust/type/type.class.scope @@ -1,2 +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.enum.scope b/data/fixtures/scopes/rust/type/type.enum.scope index aac4cd6aba..70c26e7b58 100644 --- a/data/fixtures/scopes/rust/type/type.enum.scope +++ b/data/fixtures/scopes/rust/type/type.enum.scope @@ -1,2 +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.document.scope b/data/fixtures/scopes/rust/type/type.iteration.document.scope index eeac8cfc86..020c95e845 100644 --- a/data/fixtures/scopes/rust/type/type.iteration.document.scope +++ b/data/fixtures/scopes/rust/type/type.iteration.document.scope @@ -2,3 +2,11 @@ let foo: i32 = 0; --- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| let foo: i32 = 0; +2| + < diff --git a/data/fixtures/scopes/rust/value/value.iteration.document.scope b/data/fixtures/scopes/rust/value/value.iteration.document.scope index 3aab0af0e0..62106ef21a 100644 --- a/data/fixtures/scopes/rust/value/value.iteration.document.scope +++ b/data/fixtures/scopes/rust/value/value.iteration.document.scope @@ -2,3 +2,11 @@ let foo = 0; --- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| let foo = 0; +2| + < diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index f8cc0b1ab4..08eeff93ce 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -75,6 +75,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.class": supported, "statement.interface": supported, "statement.enum": supported, + "statement.field.class": supported, "statement.field.interface": supported, "statement.function": supported, "statement.method": supported, @@ -110,6 +111,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.class": supported, "name.interface": supported, "name.enum": supported, + "name.field.class": supported, "name.field.interface": supported, "name.field.enum": supported, "name.foreach": supported, @@ -142,6 +144,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.class": supported, "type.enum": supported, "type.interface": supported, + "type.field.class": supported, "type.field.interface": supported, "type.return": supported, "type.variable": supported, @@ -294,15 +297,10 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "value.field.enum": notApplicable, "value.iteration.enum": notApplicable, - // Class field values - "statement.field.class": notApplicable, - "name.field.class": notApplicable, - "value.field.class": notApplicable, - "type.field.class": notApplicable, - // Miscellaneous "statement.static": notApplicable, "statement.misc": notApplicable, + "value.field.class": notApplicable, "type.foreach": notApplicable, "class.iteration.block": notApplicable, "value.variable.pattern": notApplicable, diff --git a/queries/rust.scm b/queries/rust.scm index 93e8cf1c1f..a721899fea 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,7 +19,6 @@ (function_signature_item) (mod_item) (static_item) - (struct_item) (trait_item) (type_item) (union_item) @@ -32,6 +29,15 @@ (#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) +) + ;;!! if v < 0 {} ;;! ^^^^^^^^^^^ ( @@ -97,23 +103,42 @@ ] @comment @textFragment [ - (struct_item - name: (_) @name - ) - (enum_item - name: (_) @name - ) -] @class @_.domain + (struct_item) + (impl_item) + (enum_item) + (trait_item) +] @statement @class @type + +;;!! struct Foo {} +(struct_item + name: (_) @name +) @name.domain -(struct_expression) @class +;;!! impl Foo {} +(impl_item + type: (_) @name +) @name.domain + +;;!! enum Foo {} +(enum_item + name: (_) @name +) @name.domain +;;!! mod foo {} +(mod_item + name: (_) @name +) @name.domain + +;;!! enum Foo { Bar, Baz } +;;! ^^^ ^^^ (enum_variant name: (_) @name -) @_.domain +) @name.domain +;;!! trait Foo {} (trait_item name: (_) @name -) @_.domain +) @name.domain ;;!! fn foo() {} ;;! ^^^^^^^^^^^ @@ -126,7 +151,7 @@ (function_item parameters: (_) @_.leading.endOf return_type: (_)? @type -) @_.domain +) @type.domain ;;!! fn foo() {} ;;! ^ @@ -152,10 +177,11 @@ ) ) @_.domain +;;!! struct Foo { bar: u8 } (field_declaration name: (_) @name @type.leading.endOf type: (_) @type -) @_.domain +) @statement @_.domain ;;!! (t: &T, u: &U) ;;! ^ ^ @@ -316,16 +342,6 @@ ;;! ^^^^^^^ (match_arm) @branch -[ - (struct_item) - (trait_item) - (impl_item) -] @type - -(impl_item - type: (_) @type -) - (array_type element: (_) @type ) @_.domain From c810dba3b038b20fb104e0994b800780a6c2c77e Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 14:42:33 +0100 Subject: [PATCH 06/14] more scopes --- .../name/name.argument.formal.method.scope | 79 +++++++++++++++++++ .../rust/name/name.assignment.pattern.scope | 18 +++++ .../scopes/rust/name/name.assignment.scope | 18 +++++ .../scopes/rust/name/name.foreach.scope | 22 ++++++ .../rust/name/name.variable.pattern.scope | 18 +++++ .../type/type.argument.formal.method.scope | 49 ++++++++++++ .../scopes/rust/value/value.assignment.scope | 18 +++++ .../scopes/rust/value/value.foreach.scope | 22 ++++++ .../scopes/rust/value/value.return.scope | 18 +++++ queries/rust.scm | 26 +++++- 10 files changed, 285 insertions(+), 3 deletions(-) diff --git a/data/fixtures/scopes/rust/name/name.argument.formal.method.scope b/data/fixtures/scopes/rust/name/name.argument.formal.method.scope index acb0ec6ac6..aaf0b5ad56 100644 --- a/data/fixtures/scopes/rust/name/name.argument.formal.method.scope +++ b/data/fixtures/scopes/rust/name/name.argument.formal.method.scope @@ -2,3 +2,82 @@ 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.assignment.pattern.scope b/data/fixtures/scopes/rust/name/name.assignment.pattern.scope index beb212a4f7..a28aa961ee 100644 --- a/data/fixtures/scopes/rust/name/name.assignment.pattern.scope +++ b/data/fixtures/scopes/rust/name/name.assignment.pattern.scope @@ -1,2 +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 index 20f7e72f3d..d516138753 100644 --- a/data/fixtures/scopes/rust/name/name.assignment.scope +++ b/data/fixtures/scopes/rust/name/name.assignment.scope @@ -1,2 +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.foreach.scope b/data/fixtures/scopes/rust/name/name.foreach.scope index 7d64e5d97f..76a1dd8dda 100644 --- a/data/fixtures/scopes/rust/name/name.foreach.scope +++ b/data/fixtures/scopes/rust/name/name.foreach.scope @@ -1,2 +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.variable.pattern.scope b/data/fixtures/scopes/rust/name/name.variable.pattern.scope index beb212a4f7..a28aa961ee 100644 --- a/data/fixtures/scopes/rust/name/name.variable.pattern.scope +++ b/data/fixtures/scopes/rust/name/name.variable.pattern.scope @@ -1,2 +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/type/type.argument.formal.method.scope b/data/fixtures/scopes/rust/type/type.argument.formal.method.scope index acb0ec6ac6..fa5355c4f3 100644 --- a/data/fixtures/scopes/rust/type/type.argument.formal.method.scope +++ b/data/fixtures/scopes/rust/type/type.argument.formal.method.scope @@ -2,3 +2,52 @@ 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/value/value.assignment.scope b/data/fixtures/scopes/rust/value/value.assignment.scope index 20f7e72f3d..a614198096 100644 --- a/data/fixtures/scopes/rust/value/value.assignment.scope +++ b/data/fixtures/scopes/rust/value/value.assignment.scope @@ -1,2 +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 index 7d64e5d97f..d89b2cb282 100644 --- a/data/fixtures/scopes/rust/value/value.foreach.scope +++ b/data/fixtures/scopes/rust/value/value.foreach.scope @@ -1,2 +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.return.scope b/data/fixtures/scopes/rust/value/value.return.scope index 476f32e791..782baca84f 100644 --- a/data/fixtures/scopes/rust/value/value.return.scope +++ b/data/fixtures/scopes/rust/value/value.return.scope @@ -2,3 +2,21 @@ 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/queries/rust.scm b/queries/rust.scm index a721899fea..e513877e00 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -207,9 +207,14 @@ (tuple_expression) ] @list +;;!! match value {} (match_expression value: (_) @value -) @_.domain + body: (_ + "{" @branch.iteration.start.endOf + "}" @branch.iteration.end.startOf + ) +) @value.domain @branch.iteration.domain ;;!! #[derive(Debug)] ;;! ^^^^^^^^^^^^^^^^ @@ -265,6 +270,13 @@ value: (_) @value ) @_.domain +(expression_statement + (assignment_expression + left: (_) @name @value.leading.start.endOf + right: (_) @value @name.trailing.start.startOf + ) +) @_.domain + ;;!! #[cfg_attr(feature = "foo")] ;;! ^^^^^^^ ;;! ^^^^^ @@ -275,8 +287,10 @@ ;;!! return 2; ;;! ^ -(return_expression - (_) @value +(expression_statement + (return_expression + (_) @value + ) ) @_.domain ;; Implicit return value at end of function body @@ -478,6 +492,12 @@ "where" @type.iteration.start.endOf ) @type.iteration.end.endOf @type.iteration.domain +;;!! for v in values {} +(for_expression + pattern: (_) @name + value: (_) @value +) @_.domain + operator: [ "<" "<<" From 778820a47027ec71f885ac0f809e1de117cc614a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 15:38:44 +0100 Subject: [PATCH 07/14] More updates --- .../argument.formal.lambda.iteration.scope | 8 ++ .../argument.formal.lambda.iteration2.scope | 8 ++ .../argument.formal.lambda.multiLine.scope | 39 +++++++++ .../argument.formal.lambda.multiLine2.scope | 39 +++++++++ .../argument.formal.lambda.singleLine.scope | 31 +++++++ .../argument.formal.lambda.singleLine2.scope | 31 +++++++ ...argumentList.actual.method.multiLine.scope | 28 ++++++ .../argumentList.actual.multiLine.scope | 28 ++++++ .../argumentList.formal.lambda.empty.scope | 11 +++ ...argumentList.formal.lambda.multiLine.scope | 28 ++++++ ...rgumentList.formal.lambda.singleLine.scope | 11 +++ ...argumentList.formal.method.multiLine.scope | 31 +++++++ .../argumentList.formal.multiLine.scope | 28 ++++++ .../rust/branch/branch.if.iteration.scope | 8 ++ .../branch/branch.switchCase.iteration.scope | 8 ++ .../rust/condition.switchCase.iteration.scope | 8 ++ .../scopes/rust/condition.switchCase.scope | 45 ++++++++++ data/fixtures/scopes/rust/list.scope | 2 - .../scopes/rust/type/type.alias.scope | 8 ++ .../fixtures/scopes/rust/type/type.cast.scope | 18 ++++ .../type/type.typeArgument.iteration.scope | 13 ++- .../scopes/rust/type/type.typeArgument.scope | 52 ++++++++++- .../rust/value/value.return.lambda.scope | 17 +++- .../scopes/rust/value/value.typeAlias.scope | 18 ++++ .../value/value.typeAlias.scope | 8 +- .../value/value.typeAlias2.scope | 8 +- .../common/src/scopeSupportFacets/rust.ts | 2 +- queries/rust.scm | 87 +++++++++++++++---- queries/typescript.core.scm | 11 ++- 29 files changed, 602 insertions(+), 32 deletions(-) delete mode 100644 data/fixtures/scopes/rust/list.scope diff --git a/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope index c5dabe6d01..529f969dd4 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration.scope @@ -1,2 +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 index 3f76ec0a40..2261b4db1d 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.iteration2.scope @@ -1,2 +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 index 4fb26cb628..82d072b3c5 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine.scope @@ -3,3 +3,42 @@ 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 index c5385d49e7..d3c2034111 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.multiLine2.scope @@ -3,3 +3,42 @@ 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 index c5dabe6d01..92523a0ee0 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine.scope @@ -1,2 +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 index 3f76ec0a40..2fad9ab3c9 100644 --- a/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope +++ b/data/fixtures/scopes/rust/argument/argument.formal.lambda.singleLine2.scope @@ -1,2 +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/argumentList/argumentList.actual.method.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope index 026ff44a9d..8b52ebf6c7 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.method.multiLine.scope @@ -3,3 +3,31 @@ foo.bar( 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.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope index f5787791ec..419764ac56 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.multiLine.scope @@ -3,3 +3,31 @@ foo( 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.formal.lambda.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope index 91ff8b7a39..6bd1a60020 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.empty.scope @@ -1,2 +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 index 5e8ae5ada1..201c377182 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.multiLine.scope @@ -3,3 +3,31 @@ 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 index 3f76ec0a40..82ed677057 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.lambda.singleLine.scope @@ -1,2 +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.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope index c0ca23eac0..5148923082 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.method.multiLine.scope @@ -6,3 +6,34 @@ impl Foo { ) {} } --- + +[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.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope index a3cfe6c09c..2d0364c1a0 100644 --- a/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope +++ b/data/fixtures/scopes/rust/argumentList/argumentList.formal.multiLine.scope @@ -3,3 +3,31 @@ fn foo( 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/branch/branch.if.iteration.scope b/data/fixtures/scopes/rust/branch/branch.if.iteration.scope index b366308c1e..5a5ed880ea 100644 --- a/data/fixtures/scopes/rust/branch/branch.if.iteration.scope +++ b/data/fixtures/scopes/rust/branch/branch.if.iteration.scope @@ -2,3 +2,11 @@ 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.switchCase.iteration.scope b/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope index 76d358e35d..44a54b84db 100644 --- a/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope +++ b/data/fixtures/scopes/rust/branch/branch.switchCase.iteration.scope @@ -1,2 +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.iteration.scope b/data/fixtures/scopes/rust/condition.switchCase.iteration.scope index 76d358e35d..44a54b84db 100644 --- a/data/fixtures/scopes/rust/condition.switchCase.iteration.scope +++ b/data/fixtures/scopes/rust/condition.switchCase.iteration.scope @@ -1,2 +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 index 0577518a3e..b5b8ebae3a 100644 --- a/data/fixtures/scopes/rust/condition.switchCase.scope +++ b/data/fixtures/scopes/rust/condition.switchCase.scope @@ -3,3 +3,48 @@ match foo { _ => "_" } --- + +[#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/list.scope b/data/fixtures/scopes/rust/list.scope deleted file mode 100644 index 836cae8f3e..0000000000 --- a/data/fixtures/scopes/rust/list.scope +++ /dev/null @@ -1,2 +0,0 @@ -vec![aaa, bbb]; ---- diff --git a/data/fixtures/scopes/rust/type/type.alias.scope b/data/fixtures/scopes/rust/type/type.alias.scope index dbefef6416..22f28eaf55 100644 --- a/data/fixtures/scopes/rust/type/type.alias.scope +++ b/data/fixtures/scopes/rust/type/type.alias.scope @@ -1,2 +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.cast.scope b/data/fixtures/scopes/rust/type/type.cast.scope index 57a20d0547..aba156739b 100644 --- a/data/fixtures/scopes/rust/type/type.cast.scope +++ b/data/fixtures/scopes/rust/type/type.cast.scope @@ -1,2 +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.typeArgument.iteration.scope b/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope index 0718c1afba..599325eb25 100644 --- a/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope +++ b/data/fixtures/scopes/rust/type/type.typeArgument.iteration.scope @@ -1,2 +1,13 @@ -Foo +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 index 0718c1afba..463399b631 100644 --- a/data/fixtures/scopes/rust/type/type.typeArgument.scope +++ b/data/fixtures/scopes/rust/type/type.typeArgument.scope @@ -1,2 +1,52 @@ -Foo +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/value/value.return.lambda.scope b/data/fixtures/scopes/rust/value/value.return.lambda.scope index 37f0a0919b..7a63e59652 100644 --- a/data/fixtures/scopes/rust/value/value.return.lambda.scope +++ b/data/fixtures/scopes/rust/value/value.return.lambda.scope @@ -1,2 +1,17 @@ -|| 0; +|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.typeAlias.scope b/data/fixtures/scopes/rust/value/value.typeAlias.scope index dbefef6416..c62e2987f5 100644 --- a/data/fixtures/scopes/rust/value/value.typeAlias.scope +++ b/data/fixtures/scopes/rust/value/value.typeAlias.scope @@ -1,2 +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/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 08eeff93ce..ecdc535815 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -6,7 +6,6 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const rustScopeSupport: LanguageScopeSupportFacetMap = { disqualifyDelimiter: supported, anonymousFunction: supported, - list: supported, "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, @@ -304,6 +303,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.foreach": notApplicable, "class.iteration.block": notApplicable, "value.variable.pattern": notApplicable, + list: notApplicable, environment: notApplicable, regularExpression: notApplicable, selector: notApplicable, diff --git a/queries/rust.scm b/queries/rust.scm index e513877e00..6814102397 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -41,7 +41,7 @@ ;;!! if v < 0 {} ;;! ^^^^^^^^^^^ ( - (if_expression) @ifStatement @statement + (if_expression) @ifStatement @statement @branch.iteration (#not-parent-type? @ifStatement else_clause) ) @@ -211,10 +211,10 @@ (match_expression value: (_) @value body: (_ - "{" @branch.iteration.start.endOf - "}" @branch.iteration.end.startOf + "{" @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @branch.iteration.end.startOf @condition.iteration.end.startOf ) -) @value.domain @branch.iteration.domain +) @value.domain @branch.iteration.domain @condition.iteration.domain ;;!! #[derive(Debug)] ;;! ^^^^^^^^^^^^^^^^ @@ -270,6 +270,15 @@ 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 @@ -329,6 +338,13 @@ ) ) +;;!! |x| x + 1 +;;! ^^^^^^ +(closure_expression + body: (_) @value + (#not-type? @value block) +) + ;;!! while v < 0 {} ;;! ^^^^^ (while_expression @@ -354,7 +370,9 @@ ;;!! match value { 5 => {} } ;;! ^^^^^^^ -(match_arm) @branch +(match_arm + pattern: (_) @condition +) @branch @condition.domain (array_type element: (_) @type @@ -362,7 +380,7 @@ ;;!! fn foo(a: u32, b: u32) -> {} ;;! ^^^^^^ ^^^^^^ (_ - (parameters + parameters: (_ (_)? @_.leading.endOf . (_) @argumentOrParameter @@ -375,11 +393,18 @@ ;;!! 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 ;;!! foo(aaa, bbb) @@ -399,10 +424,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) } @@ -498,6 +524,37 @@ 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) From 2396a297e9a31d96d9735091fe06c913be200c60 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 15:48:28 +0100 Subject: [PATCH 08/14] list --- data/fixtures/scopes/rust/list.scope | 17 +++++++++++++++++ data/fixtures/scopes/rust/list2.scope | 17 +++++++++++++++++ packages/common/src/scopeSupportFacets/rust.ts | 2 +- queries/rust.scm | 2 ++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 data/fixtures/scopes/rust/list.scope create mode 100644 data/fixtures/scopes/rust/list2.scope diff --git a/data/fixtures/scopes/rust/list.scope b/data/fixtures/scopes/rust/list.scope new file mode 100644 index 0000000000..6a06037012 --- /dev/null +++ b/data/fixtures/scopes/rust/list.scope @@ -0,0 +1,17 @@ +let foo = [1, 2, 3]; +--- + +[Content] = +[Domain] = 0:8-0:14 + >------< +0| let a = [1, 2]; + +[Removal] = 0:7-0:14 + >-------< +0| let a = [1, 2]; + +[Leading delimiter] = 0:7-0:8 + >-< +0| let a = [1, 2]; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/list2.scope b/data/fixtures/scopes/rust/list2.scope new file mode 100644 index 0000000000..f193b82792 --- /dev/null +++ b/data/fixtures/scopes/rust/list2.scope @@ -0,0 +1,17 @@ +let foo = (1, "2", true); +--- + +[Content] = +[Domain] = 0:8-0:26 + >------------------< +0| let t = (1, "hello", true); + +[Removal] = 0:7-0:26 + >-------------------< +0| let t = (1, "hello", true); + +[Leading delimiter] = 0:7-0:8 + >-< +0| let t = (1, "hello", true); + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index ecdc535815..08eeff93ce 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -6,6 +6,7 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const rustScopeSupport: LanguageScopeSupportFacetMap = { disqualifyDelimiter: supported, anonymousFunction: supported, + list: supported, "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, @@ -303,7 +304,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.foreach": notApplicable, "class.iteration.block": notApplicable, "value.variable.pattern": notApplicable, - list: notApplicable, environment: notApplicable, regularExpression: notApplicable, selector: notApplicable, diff --git a/queries/rust.scm b/queries/rust.scm index 6814102397..ac65cbee17 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -202,6 +202,8 @@ (closure_expression) @anonymousFunction +;;!! let foo = [1, 2, 3]; +;;!! let foo = (1, "2", true); [ (array_expression) (tuple_expression) From bc214dd18636e518684949119532529d43018699 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 23 Dec 2025 15:55:52 +0100 Subject: [PATCH 09/14] argument iteration --- data/fixtures/scopes/rust/list.scope | 18 +++++++++--------- data/fixtures/scopes/rust/list2.scope | 18 +++++++++--------- .../name/name.argument.formal.iteration.scope | 11 +++++++++++ ...name.argument.formal.method.iteration.scope | 14 ++++++++++++++ .../type/type.argument.formal.iteration.scope | 11 +++++++++++ ...type.argument.formal.method.iteration.scope | 14 ++++++++++++++ queries/rust.scm | 13 +++++++++++++ 7 files changed, 81 insertions(+), 18 deletions(-) diff --git a/data/fixtures/scopes/rust/list.scope b/data/fixtures/scopes/rust/list.scope index 6a06037012..2671d6c135 100644 --- a/data/fixtures/scopes/rust/list.scope +++ b/data/fixtures/scopes/rust/list.scope @@ -2,16 +2,16 @@ let foo = [1, 2, 3]; --- [Content] = -[Domain] = 0:8-0:14 - >------< -0| let a = [1, 2]; +[Domain] = 0:10-0:19 + >---------< +0| let foo = [1, 2, 3]; -[Removal] = 0:7-0:14 - >-------< -0| let a = [1, 2]; +[Removal] = 0:9-0:19 + >----------< +0| let foo = [1, 2, 3]; -[Leading delimiter] = 0:7-0:8 - >-< -0| let a = [1, 2]; +[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 index f193b82792..1689e4bd5a 100644 --- a/data/fixtures/scopes/rust/list2.scope +++ b/data/fixtures/scopes/rust/list2.scope @@ -2,16 +2,16 @@ let foo = (1, "2", true); --- [Content] = -[Domain] = 0:8-0:26 - >------------------< -0| let t = (1, "hello", true); +[Domain] = 0:10-0:24 + >--------------< +0| let foo = (1, "2", true); -[Removal] = 0:7-0:26 - >-------------------< -0| let t = (1, "hello", true); +[Removal] = 0:9-0:24 + >---------------< +0| let foo = (1, "2", true); -[Leading delimiter] = 0:7-0:8 - >-< -0| let t = (1, "hello", 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 index b880325366..ec682e0119 100644 --- a/data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope +++ b/data/fixtures/scopes/rust/name/name.argument.formal.iteration.scope @@ -1,2 +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 index acb0ec6ac6..bacfa2641d 100644 --- a/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope @@ -2,3 +2,17 @@ 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] = 1:11-1:36 + >-------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} diff --git a/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope b/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope index b880325366..ec682e0119 100644 --- a/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope +++ b/data/fixtures/scopes/rust/type/type.argument.formal.iteration.scope @@ -1,2 +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 index acb0ec6ac6..bacfa2641d 100644 --- a/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope @@ -2,3 +2,17 @@ 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] = 1:11-1:36 + >-------------------------< +1| fn bar(&self, aaa: i32, bbb: i32) {} diff --git a/queries/rust.scm b/queries/rust.scm index ac65cbee17..74906b9b67 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -409,6 +409,19 @@ (#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) ;;! ^^^ ^^^ (_ From 616a02a9d99d899ecd6c3bc41fba6342cdb89aa4 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 24 Dec 2025 09:42:59 +0100 Subject: [PATCH 10/14] Added iteration scopes --- ...ame.argument.formal.method.iteration.scope | 11 ++++- .../rust/name/name.field.interface.scope | 48 ------------------- .../scopes/rust/name/name.interface.scope | 24 ---------- .../rust/name/name.iteration.block.scope | 11 +++++ .../rust/name/name.iteration.block2.scope | 11 +++++ .../rust/name/name.iteration.block3.scope | 11 +++++ .../rust/name/name.iteration.class.scope | 11 +++++ .../rust/name/name.iteration.class2.scope | 13 +++++ .../rust/name/name.iteration.class3.scope | 13 +++++ .../rust/name/name.iteration.enum.scope | 11 +++++ .../rust/name/name.iteration.interface.scope | 2 - .../name/namedFunction.iteration.class.scope | 11 +++++ .../rust/namedFunction.iteration.class.scope | 13 +++++ .../rust/statement/statement.class3.scope | 10 ++++ .../statement/statement.field.interface.scope | 33 ------------- .../rust/statement/statement.interface.scope | 10 ---- .../statement/statement.iteration.block.scope | 11 +++++ .../statement.iteration.block2.scope | 11 +++++ .../statement.iteration.block3.scope | 11 +++++ .../statement/statement.iteration.class.scope | 11 +++++ .../statement.iteration.class2.scope | 13 +++++ .../statement.iteration.class3.scope | 13 +++++ .../statement.iteration.interface.scope | 2 - ...ype.argument.formal.method.iteration.scope | 11 ++++- .../scopes/rust/type/type.class3.scope | 10 ++++ .../rust/type/type.field.interface.scope | 34 ------------- .../scopes/rust/type/type.interface.scope | 10 ---- .../rust/type/type.iteration.block.scope | 11 +++++ .../rust/type/type.iteration.block2.scope | 11 +++++ .../rust/type/type.iteration.block3.scope | 11 +++++ .../rust/type/type.iteration.class.scope | 11 +++++ .../rust/type/type.iteration.class2.scope | 13 +++++ .../rust/type/type.iteration.class3.scope | 13 +++++ .../rust/type/type.iteration.interface.scope | 2 - .../rust/value/value.iteration.block.scope | 11 +++++ .../rust/value/value.iteration.block2.scope | 11 +++++ .../rust/value/value.iteration.block3.scope | 11 +++++ .../rust/value/value.iteration.class.scope | 11 +++++ .../rust/value/value.iteration.class2.scope | 13 +++++ .../rust/value/value.iteration.class3.scope | 13 +++++ .../common/src/scopeSupportFacets/rust.ts | 22 +++++---- queries/rust.scm | 17 +++++++ 42 files changed, 384 insertions(+), 177 deletions(-) delete mode 100644 data/fixtures/scopes/rust/name/name.field.interface.scope delete mode 100644 data/fixtures/scopes/rust/name/name.interface.scope create mode 100644 data/fixtures/scopes/rust/name/name.iteration.class2.scope create mode 100644 data/fixtures/scopes/rust/name/name.iteration.class3.scope delete mode 100644 data/fixtures/scopes/rust/name/name.iteration.interface.scope create mode 100644 data/fixtures/scopes/rust/namedFunction.iteration.class.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.class3.scope delete mode 100644 data/fixtures/scopes/rust/statement/statement.field.interface.scope delete mode 100644 data/fixtures/scopes/rust/statement/statement.interface.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.iteration.class2.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.iteration.class3.scope delete mode 100644 data/fixtures/scopes/rust/statement/statement.iteration.interface.scope create mode 100644 data/fixtures/scopes/rust/type/type.class3.scope delete mode 100644 data/fixtures/scopes/rust/type/type.field.interface.scope delete mode 100644 data/fixtures/scopes/rust/type/type.interface.scope create mode 100644 data/fixtures/scopes/rust/type/type.iteration.class2.scope create mode 100644 data/fixtures/scopes/rust/type/type.iteration.class3.scope delete mode 100644 data/fixtures/scopes/rust/type/type.iteration.interface.scope create mode 100644 data/fixtures/scopes/rust/value/value.iteration.class2.scope create mode 100644 data/fixtures/scopes/rust/value/value.iteration.class3.scope 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 index bacfa2641d..f6b915c7da 100644 --- a/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/rust/name/name.argument.formal.method.iteration.scope @@ -13,6 +13,15 @@ impl Foo { [#2 Content] = -[#2 Domain] = 1:11-1:36 +[#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.field.interface.scope b/data/fixtures/scopes/rust/name/name.field.interface.scope deleted file mode 100644 index 4b850b0b22..0000000000 --- a/data/fixtures/scopes/rust/name/name.field.interface.scope +++ /dev/null @@ -1,48 +0,0 @@ -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.interface.scope b/data/fixtures/scopes/rust/name/name.interface.scope deleted file mode 100644 index df39081c82..0000000000 --- a/data/fixtures/scopes/rust/name/name.interface.scope +++ /dev/null @@ -1,24 +0,0 @@ -struct Foo {} ---- - -[Content] = 0:7-0:10 - >---< -0| struct Foo {} - -[Removal] = 0:7-0:11 - >----< -0| struct Foo {} - -[Leading delimiter] = 0:6-0:7 - >-< -0| struct Foo {} - -[Trailing delimiter] = 0:10-0:11 - >-< -0| struct Foo {} - -[Domain] = 0:0-0:13 - >-------------< -0| struct 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 index e9b223dfe5..0dd2679954 100644 --- a/data/fixtures/scopes/rust/name/name.iteration.block.scope +++ b/data/fixtures/scopes/rust/name/name.iteration.block.scope @@ -1,2 +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 index 4d80bbf0ec..dfc0523a61 100644 --- a/data/fixtures/scopes/rust/name/name.iteration.block2.scope +++ b/data/fixtures/scopes/rust/name/name.iteration.block2.scope @@ -1,2 +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 index 6d96e6a130..e7b3236d45 100644 --- a/data/fixtures/scopes/rust/name/name.iteration.block3.scope +++ b/data/fixtures/scopes/rust/name/name.iteration.block3.scope @@ -1,2 +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 index dc0488fdba..cc995e40df 100644 --- a/data/fixtures/scopes/rust/name/name.iteration.class.scope +++ b/data/fixtures/scopes/rust/name/name.iteration.class.scope @@ -1,2 +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.enum.scope b/data/fixtures/scopes/rust/name/name.iteration.enum.scope index f14a727bf6..9034c4ee11 100644 --- a/data/fixtures/scopes/rust/name/name.iteration.enum.scope +++ b/data/fixtures/scopes/rust/name/name.iteration.enum.scope @@ -1,2 +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.iteration.interface.scope b/data/fixtures/scopes/rust/name/name.iteration.interface.scope deleted file mode 100644 index e213f6379e..0000000000 --- a/data/fixtures/scopes/rust/name/name.iteration.interface.scope +++ /dev/null @@ -1,2 +0,0 @@ -struct Foo { } ---- diff --git a/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope b/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope index dc0488fdba..cc995e40df 100644 --- a/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope +++ b/data/fixtures/scopes/rust/name/namedFunction.iteration.class.scope @@ -1,2 +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/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.field.interface.scope b/data/fixtures/scopes/rust/statement/statement.field.interface.scope deleted file mode 100644 index e9fa5577a4..0000000000 --- a/data/fixtures/scopes/rust/statement/statement.field.interface.scope +++ /dev/null @@ -1,33 +0,0 @@ -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.interface.scope b/data/fixtures/scopes/rust/statement/statement.interface.scope deleted file mode 100644 index 823d046f92..0000000000 --- a/data/fixtures/scopes/rust/statement/statement.interface.scope +++ /dev/null @@ -1,10 +0,0 @@ -struct Foo {} ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:13 - >-------------< -0| struct Foo {} - -[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 index e9b223dfe5..0dd2679954 100644 --- a/data/fixtures/scopes/rust/statement/statement.iteration.block.scope +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block.scope @@ -1,2 +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 index 4d80bbf0ec..dfc0523a61 100644 --- a/data/fixtures/scopes/rust/statement/statement.iteration.block2.scope +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block2.scope @@ -1,2 +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 index 6d96e6a130..e7b3236d45 100644 --- a/data/fixtures/scopes/rust/statement/statement.iteration.block3.scope +++ b/data/fixtures/scopes/rust/statement/statement.iteration.block3.scope @@ -1,2 +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 index dc0488fdba..cc995e40df 100644 --- a/data/fixtures/scopes/rust/statement/statement.iteration.class.scope +++ b/data/fixtures/scopes/rust/statement/statement.iteration.class.scope @@ -1,2 +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.interface.scope b/data/fixtures/scopes/rust/statement/statement.iteration.interface.scope deleted file mode 100644 index e213f6379e..0000000000 --- a/data/fixtures/scopes/rust/statement/statement.iteration.interface.scope +++ /dev/null @@ -1,2 +0,0 @@ -struct Foo { } ---- 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 index bacfa2641d..f6b915c7da 100644 --- a/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope +++ b/data/fixtures/scopes/rust/type/type.argument.formal.method.iteration.scope @@ -13,6 +13,15 @@ impl Foo { [#2 Content] = -[#2 Domain] = 1:11-1:36 +[#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.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.field.interface.scope b/data/fixtures/scopes/rust/type/type.field.interface.scope deleted file mode 100644 index 2c9cea111d..0000000000 --- a/data/fixtures/scopes/rust/type/type.field.interface.scope +++ /dev/null @@ -1,34 +0,0 @@ -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.interface.scope b/data/fixtures/scopes/rust/type/type.interface.scope deleted file mode 100644 index 3980a2afac..0000000000 --- a/data/fixtures/scopes/rust/type/type.interface.scope +++ /dev/null @@ -1,10 +0,0 @@ -struct Foo {} ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:13 - >-------------< -0| struct Foo {} - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.iteration.block.scope b/data/fixtures/scopes/rust/type/type.iteration.block.scope index e9b223dfe5..0dd2679954 100644 --- a/data/fixtures/scopes/rust/type/type.iteration.block.scope +++ b/data/fixtures/scopes/rust/type/type.iteration.block.scope @@ -1,2 +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 index 4d80bbf0ec..dfc0523a61 100644 --- a/data/fixtures/scopes/rust/type/type.iteration.block2.scope +++ b/data/fixtures/scopes/rust/type/type.iteration.block2.scope @@ -1,2 +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 index 6d96e6a130..e7b3236d45 100644 --- a/data/fixtures/scopes/rust/type/type.iteration.block3.scope +++ b/data/fixtures/scopes/rust/type/type.iteration.block3.scope @@ -1,2 +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 index dc0488fdba..cc995e40df 100644 --- a/data/fixtures/scopes/rust/type/type.iteration.class.scope +++ b/data/fixtures/scopes/rust/type/type.iteration.class.scope @@ -1,2 +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.interface.scope b/data/fixtures/scopes/rust/type/type.iteration.interface.scope deleted file mode 100644 index e213f6379e..0000000000 --- a/data/fixtures/scopes/rust/type/type.iteration.interface.scope +++ /dev/null @@ -1,2 +0,0 @@ -struct Foo { } ---- diff --git a/data/fixtures/scopes/rust/value/value.iteration.block.scope b/data/fixtures/scopes/rust/value/value.iteration.block.scope index e9b223dfe5..0dd2679954 100644 --- a/data/fixtures/scopes/rust/value/value.iteration.block.scope +++ b/data/fixtures/scopes/rust/value/value.iteration.block.scope @@ -1,2 +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 index 4d80bbf0ec..dfc0523a61 100644 --- a/data/fixtures/scopes/rust/value/value.iteration.block2.scope +++ b/data/fixtures/scopes/rust/value/value.iteration.block2.scope @@ -1,2 +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 index 6d96e6a130..e7b3236d45 100644 --- a/data/fixtures/scopes/rust/value/value.iteration.block3.scope +++ b/data/fixtures/scopes/rust/value/value.iteration.block3.scope @@ -1,2 +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 index dc0488fdba..cc995e40df 100644 --- a/data/fixtures/scopes/rust/value/value.iteration.class.scope +++ b/data/fixtures/scopes/rust/value/value.iteration.class.scope @@ -1,2 +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/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 08eeff93ce..21edec23e1 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -73,10 +73,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, "statement.class": supported, - "statement.interface": supported, "statement.enum": supported, "statement.field.class": supported, - "statement.field.interface": supported, "statement.function": supported, "statement.method": supported, "statement.if": supported, @@ -91,7 +89,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.namespace": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, - "statement.iteration.interface": supported, "statement.iteration.block": supported, "string.singleLine": supported, @@ -109,10 +106,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment": supported, "name.assignment.pattern": supported, "name.class": supported, - "name.interface": supported, "name.enum": supported, "name.field.class": supported, - "name.field.interface": supported, "name.field.enum": supported, "name.foreach": supported, "name.function": supported, @@ -122,7 +117,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": supported, "name.iteration.block": supported, "name.iteration.class": supported, - "name.iteration.interface": supported, "name.iteration.enum": supported, "name.iteration.document": supported, @@ -143,9 +137,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": supported, "type.class": supported, "type.enum": supported, - "type.interface": supported, "type.field.class": supported, - "type.field.interface": supported, "type.return": supported, "type.variable": supported, "type.typeArgument": supported, @@ -154,11 +146,9 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": supported, "type.iteration.block": supported, "type.iteration.class": supported, - "type.iteration.interface": supported, "type.iteration.document": supported, "interior.class": supported, - "interior.interface": supported, "interior.enum": supported, "interior.function": supported, "interior.method": supported, @@ -202,6 +192,18 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "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, diff --git a/queries/rust.scm b/queries/rust.scm index 74906b9b67..79944f41a1 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -38,6 +38,19 @@ (#document-range! @name.iteration @value.iteration @type.iteration) ) +(_ + . + "{" @statement.iteration.start.endOf + "}" @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 {} ;;! ^^^^^^^^^^^ ( @@ -117,6 +130,10 @@ ;;!! impl Foo {} (impl_item type: (_) @name + body: (_ + "{" @namedFunction.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf + ) ) @name.domain ;;!! enum Foo {} From c704278a12ab0dad048dd6374c4a5b7905a17e5a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 24 Dec 2025 10:04:30 +0100 Subject: [PATCH 11/14] interior --- .../scopes/rust/interior/interior.class.scope | 8 +++ .../rust/interior/interior.class2.scope | 10 ++++ .../rust/interior/interior.class3.scope | 10 ++++ .../scopes/rust/interior/interior.enum.scope | 8 +++ .../rust/interior/interior.foreach.scope | 8 +++ .../rust/interior/interior.function.scope | 8 +++ .../scopes/rust/interior/interior.if.scope | 26 ++++++++++ .../rust/interior/interior.interface.scope | 2 - .../rust/interior/interior.lambda.scope | 8 +++ .../rust/interior/interior.method.scope | 23 +++++++++ .../rust/interior/interior.namespace.scope | 8 +++ .../rust/interior/interior.switch.scope | 8 +++ .../rust/interior/interior.switchCase.scope | 51 ++++++++++++++++++- .../scopes/rust/interior/interior.while.scope | 8 +++ queries/rust.scm | 14 ++++- 15 files changed, 195 insertions(+), 5 deletions(-) create mode 100644 data/fixtures/scopes/rust/interior/interior.class2.scope create mode 100644 data/fixtures/scopes/rust/interior/interior.class3.scope delete mode 100644 data/fixtures/scopes/rust/interior/interior.interface.scope diff --git a/data/fixtures/scopes/rust/interior/interior.class.scope b/data/fixtures/scopes/rust/interior/interior.class.scope index dc0488fdba..f391190cee 100644 --- a/data/fixtures/scopes/rust/interior/interior.class.scope +++ b/data/fixtures/scopes/rust/interior/interior.class.scope @@ -1,2 +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 index f14a727bf6..d96875b078 100644 --- a/data/fixtures/scopes/rust/interior/interior.enum.scope +++ b/data/fixtures/scopes/rust/interior/interior.enum.scope @@ -1,2 +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 index 325f87f8ee..b1842875b3 100644 --- a/data/fixtures/scopes/rust/interior/interior.foreach.scope +++ b/data/fixtures/scopes/rust/interior/interior.foreach.scope @@ -1,2 +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 index e9b223dfe5..e8ecdcb34f 100644 --- a/data/fixtures/scopes/rust/interior/interior.function.scope +++ b/data/fixtures/scopes/rust/interior/interior.function.scope @@ -1,2 +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 index e3bd0a7c5e..17d16599d5 100644 --- a/data/fixtures/scopes/rust/interior/interior.if.scope +++ b/data/fixtures/scopes/rust/interior/interior.if.scope @@ -2,3 +2,29 @@ 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.interface.scope b/data/fixtures/scopes/rust/interior/interior.interface.scope deleted file mode 100644 index e213f6379e..0000000000 --- a/data/fixtures/scopes/rust/interior/interior.interface.scope +++ /dev/null @@ -1,2 +0,0 @@ -struct Foo { } ---- diff --git a/data/fixtures/scopes/rust/interior/interior.lambda.scope b/data/fixtures/scopes/rust/interior/interior.lambda.scope index d5e8139dfe..37a2c33c14 100644 --- a/data/fixtures/scopes/rust/interior/interior.lambda.scope +++ b/data/fixtures/scopes/rust/interior/interior.lambda.scope @@ -1,2 +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 index 801ac7fa16..ecd527e87b 100644 --- a/data/fixtures/scopes/rust/interior/interior.method.scope +++ b/data/fixtures/scopes/rust/interior/interior.method.scope @@ -2,3 +2,26 @@ 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 index e1f1bb141d..6afc6655d5 100644 --- a/data/fixtures/scopes/rust/interior/interior.namespace.scope +++ b/data/fixtures/scopes/rust/interior/interior.namespace.scope @@ -1,2 +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 index 76d358e35d..30aba7513d 100644 --- a/data/fixtures/scopes/rust/interior/interior.switch.scope +++ b/data/fixtures/scopes/rust/interior/interior.switch.scope @@ -1,2 +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 index 8576467456..4d3fa56172 100644 --- a/data/fixtures/scopes/rust/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/rust/interior/interior.switchCase.scope @@ -1,6 +1,55 @@ match foo { - 0 => "0": + 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 index 6d96e6a130..6dfa42367e 100644 --- a/data/fixtures/scopes/rust/interior/interior.while.scope +++ b/data/fixtures/scopes/rust/interior/interior.while.scope @@ -1,2 +1,10 @@ while true { } --- + +[Content] = +[Removal] = +[Domain] = 0:12-0:13 + >-< +0| while true { } + +[Insertion delimiter] = " " diff --git a/queries/rust.scm b/queries/rust.scm index 79944f41a1..cd6b90602c 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -38,10 +38,12 @@ (#document-range! @name.iteration @value.iteration @type.iteration) ) +;;!! { } +;;! ^ (_ . - "{" @statement.iteration.start.endOf - "}" @statement.iteration.end.startOf + "{" @interior.start.endOf @statement.iteration.start.endOf + "}" @interior.end.startOf @statement.iteration.end.startOf . ) (_ @@ -393,6 +395,14 @@ pattern: (_) @condition ) @branch @condition.domain +;;!! match value { 5 => 0, } +;;! ^^^ +(match_arm + "=>" @interior.start.endOf + value: (_) @_dummy + (#not-type? @_dummy block) +) @interior.end.endOf + (array_type element: (_) @type ) @_.domain From 251c674ee5a7fca90c02aeac9110a777713a1f7e Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 24 Dec 2025 10:31:23 +0100 Subject: [PATCH 12/14] Small fixes --- .../recorded/languages/rust/clearValue4.yml | 4 +-- .../recorded/languages/rust/clearValue5.yml | 4 +-- queries/rust.scm | 25 ++++++++++++++++--- 3 files changed, 25 insertions(+), 8 deletions(-) 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/queries/rust.scm b/queries/rust.scm index cd6b90602c..7157a98a36 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -131,12 +131,23 @@ ;;!! 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 ) -) @name.domain +) ;;!! enum Foo {} (enum_item @@ -379,9 +390,13 @@ value: (_) @condition.end ) @_.domain +;;!! match value { 5 => {} } +;;! ^^^^^^^ +(match_arm) @branch + ;;!! User { value } if value.use() => {} ;;! ^^^^^^^^^^^ -(_ +(match_arm (match_pattern (_) @_.leading.endOf . @@ -392,8 +407,10 @@ ;;!! match value { 5 => {} } ;;! ^^^^^^^ (match_arm - pattern: (_) @condition -) @branch @condition.domain + (match_pattern + !condition + ) @condition +) @condition.domain ;;!! match value { 5 => 0, } ;;! ^^^ From ccd850a87cace0774c4d411a45bfb18ddfc119a3 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 24 Dec 2025 11:01:20 +0100 Subject: [PATCH 13/14] Clean up --- .../common/src/scopeSupportFacets/rust.ts | 5 +++- queries/rust.scm | 26 ++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 21edec23e1..d94b98261d 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -299,8 +299,11 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "value.field.enum": notApplicable, "value.iteration.enum": notApplicable, - // Miscellaneous + // Static "statement.static": notApplicable, + "interior.static": notApplicable, + + // Miscellaneous "statement.misc": notApplicable, "value.field.class": notApplicable, "type.foreach": notApplicable, diff --git a/queries/rust.scm b/queries/rust.scm index 7157a98a36..6ea1497fc8 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -20,6 +20,9 @@ (mod_item) (static_item) (trait_item) + (struct_item) + (impl_item) + (enum_item) (type_item) (union_item) (use_declaration) @@ -117,17 +120,10 @@ (block_comment) ] @comment @textFragment -[ - (struct_item) - (impl_item) - (enum_item) - (trait_item) -] @statement @class @type - ;;!! struct Foo {} (struct_item name: (_) @name -) @name.domain +) @class @type @name.domain ;;!! impl Foo {} (impl_item @@ -147,17 +143,12 @@ "{" @namedFunction.iteration.start.endOf "}" @namedFunction.iteration.end.startOf ) -) +) @class @type ;;!! enum Foo {} (enum_item name: (_) @name -) @name.domain - -;;!! mod foo {} -(mod_item - name: (_) @name -) @name.domain +) @class @type @name.domain ;;!! enum Foo { Bar, Baz } ;;! ^^^ ^^^ @@ -168,6 +159,11 @@ ;;!! trait Foo {} (trait_item name: (_) @name +) @class @type @name.domain + +;;!! mod foo {} +(mod_item + name: (_) @name ) @name.domain ;;!! fn foo() {} From 5938d3a60232fe505d4ce789339f2a3d526d0073 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 25 Dec 2025 08:27:30 +0100 Subject: [PATCH 14/14] More tests --- .../scopes/rust/name/name.class2.scope | 24 +++++++++++++++ .../scopes/rust/type/type.class4.scope | 30 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 data/fixtures/scopes/rust/name/name.class2.scope create mode 100644 data/fixtures/scopes/rust/type/type.class4.scope 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/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] = " "