From 7a61d730ad48b483a8ed5c7f1fd4e31afd2784bc Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 11:06:32 +0100 Subject: [PATCH 01/25] c/csharp --- .../scopes/c/name/name.constant.scope | 24 +++++ .../name/name.variable.initialized.scope} | 0 .../c/name/name.variable.uninitialized.scope | 20 ++++ .../c/statement/statement.constant.scope | 10 ++ ...e => statement.variable.initialized.scope} | 0 .../statement.variable.uninitialized.scope} | 4 +- .../scopes/c/type/type.constant.scope | 24 +++++ ....scope => type.variable.initialized.scope} | 0 ...cope => type.variable.uninitialized.scope} | 0 .../scopes/csharp/name/name.constant.scope | 24 +++++ .../name/name.variable.initialized.scope} | 4 +- .../name/name.variable.initialized2.scope} | 16 ++-- .../name/name.variable.uninitialized.scope | 20 ++++ .../csharp/statement/statement.constant.scope | 10 ++ ...e => statement.variable.initialized.scope} | 0 .../statement.variable.initialized2.scope} | 4 +- .../statement.variable.uninitialized.scope | 10 ++ .../scopes/csharp/type/type.constant.scope | 24 +++++ ....scope => type.variable.initialized.scope} | 0 ...cope => type.variable.uninitialized.scope} | 0 .../scopes/csharp/value/value.constant.scope | 20 ++++ .../scopes/csharp/value/value.variable2.scope | 20 ++++ .../scopes/go/name/name.variable.scope | 24 ----- .../scopes/go/name/name.variable2.scope | 24 ----- .../scopes/go/name/name.variable3.scope | 20 ---- ...e => statement.variable.initialized.scope} | 0 .../go/statement/statement.variable.scope | 10 -- .../scopes/go/type/type.variable.scope | 20 ---- .../scopes/go/type/type.variable2.scope | 24 ----- .../scopes/java/name/name.variable.scope | 20 ---- .../java/statement/statement.variable.scope | 10 -- .../scopes/java/type/type.variable.scope | 20 ---- .../scopes/java/type/type.variable2.scope | 20 ---- .../name/name.assignment.pattern.scope | 20 ---- .../name/name.variable.pattern.scope | 24 ----- .../javascript.core/name/name.variable2.scope | 24 ----- .../statement/statement.variable.scope | 10 -- .../statement/statement.variable2.scope | 10 -- .../value/value.variable.pattern.scope | 20 ---- .../kotlin/name/name.variable.pattern.scope | 24 ----- .../scopes/kotlin/name/name.variable.scope | 24 ----- .../scopes/kotlin/name/name.variable2.scope | 24 ----- .../statement/statement.variable2.scope | 10 -- .../statement/statement.variable3.scope | 10 -- .../statement/statement.variable4.scope | 10 -- .../scopes/kotlin/type/type.variable.scope | 20 ---- .../scopes/kotlin/type/type.variable2.scope | 20 ---- .../scopes/kotlin/type/type.variable3.scope | 20 ---- .../scopes/kotlin/type/type.variable4.scope | 20 ---- .../scopes/kotlin/type/type.variable5.scope | 20 ---- .../kotlin/value/value.variable.pattern.scope | 20 ---- .../name/name.variable.initialized.scope | 24 +++++ ...scope => name.variable.initialized2.scope} | 0 .../name/name.variable.uninitialized.scope | 24 +++++ packages/common/src/scopeSupportFacets/c.ts | 17 ++-- .../common/src/scopeSupportFacets/csharp.ts | 17 ++-- packages/common/src/scopeSupportFacets/css.ts | 15 +-- packages/common/src/scopeSupportFacets/go.ts | 17 ++-- .../common/src/scopeSupportFacets/html.ts | 15 +-- .../common/src/scopeSupportFacets/java.ts | 17 ++-- .../src/scopeSupportFacets/javascript.ts | 15 +-- .../common/src/scopeSupportFacets/json.ts | 15 +-- .../common/src/scopeSupportFacets/kotlin.ts | 19 ++-- .../common/src/scopeSupportFacets/latex.ts | 15 +-- packages/common/src/scopeSupportFacets/lua.ts | 15 +-- .../common/src/scopeSupportFacets/markdown.ts | 15 +-- packages/common/src/scopeSupportFacets/php.ts | 3 +- .../src/scopeSupportFacets/properties.ts | 23 +++-- .../common/src/scopeSupportFacets/python.ts | 15 +-- packages/common/src/scopeSupportFacets/r.ts | 10 +- .../common/src/scopeSupportFacets/rust.ts | 15 +-- .../common/src/scopeSupportFacets/scala.ts | 19 ++-- packages/common/src/scopeSupportFacets/scm.ts | 15 +-- .../scopeSupportFacetInfos.ts | 92 +++++++++++++------ .../scopeSupportFacets.types.ts | 25 +++-- .../common/src/scopeSupportFacets/talon.ts | 29 +++--- .../src/scopeSupportFacets/talonList.ts | 25 +++-- .../src/scopeSupportFacets/typescript.ts | 3 +- packages/common/src/scopeSupportFacets/xml.ts | 15 +-- .../common/src/scopeSupportFacets/yaml.ts | 15 +-- queries/c.scm | 4 +- 81 files changed, 577 insertions(+), 727 deletions(-) create mode 100644 data/fixtures/scopes/c/name/name.constant.scope rename data/fixtures/scopes/{csharp/name/name.variable.scope => c/name/name.variable.initialized.scope} (100%) create mode 100644 data/fixtures/scopes/c/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/c/statement/statement.constant.scope rename data/fixtures/scopes/c/statement/{statement.variable.scope => statement.variable.initialized.scope} (100%) rename data/fixtures/scopes/{go/statement/statement.variable3.scope => c/statement/statement.variable.uninitialized.scope} (81%) create mode 100644 data/fixtures/scopes/c/type/type.constant.scope rename data/fixtures/scopes/c/type/{type.variable2.scope => type.variable.initialized.scope} (100%) rename data/fixtures/scopes/c/type/{type.variable.scope => type.variable.uninitialized.scope} (100%) create mode 100644 data/fixtures/scopes/csharp/name/name.constant.scope rename data/fixtures/scopes/{c/name/name.variable.scope => csharp/name/name.variable.initialized.scope} (88%) rename data/fixtures/scopes/{javascript.core/name/name.variable.scope => csharp/name/name.variable.initialized2.scope} (59%) create mode 100644 data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/csharp/statement/statement.constant.scope rename data/fixtures/scopes/csharp/statement/{statement.variable.scope => statement.variable.initialized.scope} (100%) rename data/fixtures/scopes/{kotlin/statement/statement.variable.scope => csharp/statement/statement.variable.initialized2.scope} (76%) create mode 100644 data/fixtures/scopes/csharp/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/csharp/type/type.constant.scope rename data/fixtures/scopes/csharp/type/{type.variable2.scope => type.variable.initialized.scope} (100%) rename data/fixtures/scopes/csharp/type/{type.variable.scope => type.variable.uninitialized.scope} (100%) create mode 100644 data/fixtures/scopes/csharp/value/value.constant.scope create mode 100644 data/fixtures/scopes/csharp/value/value.variable2.scope delete mode 100644 data/fixtures/scopes/go/name/name.variable.scope delete mode 100644 data/fixtures/scopes/go/name/name.variable2.scope delete mode 100644 data/fixtures/scopes/go/name/name.variable3.scope rename data/fixtures/scopes/go/statement/{statement.variable2.scope => statement.variable.initialized.scope} (100%) delete mode 100644 data/fixtures/scopes/go/statement/statement.variable.scope delete mode 100644 data/fixtures/scopes/go/type/type.variable.scope delete mode 100644 data/fixtures/scopes/go/type/type.variable2.scope delete mode 100644 data/fixtures/scopes/java/name/name.variable.scope delete mode 100644 data/fixtures/scopes/java/statement/statement.variable.scope delete mode 100644 data/fixtures/scopes/java/type/type.variable.scope delete mode 100644 data/fixtures/scopes/java/type/type.variable2.scope delete mode 100644 data/fixtures/scopes/javascript.core/name/name.assignment.pattern.scope delete mode 100644 data/fixtures/scopes/javascript.core/name/name.variable.pattern.scope delete mode 100644 data/fixtures/scopes/javascript.core/name/name.variable2.scope delete mode 100644 data/fixtures/scopes/javascript.core/statement/statement.variable.scope delete mode 100644 data/fixtures/scopes/javascript.core/statement/statement.variable2.scope delete mode 100644 data/fixtures/scopes/javascript.core/value/value.variable.pattern.scope delete mode 100644 data/fixtures/scopes/kotlin/name/name.variable.pattern.scope delete mode 100644 data/fixtures/scopes/kotlin/name/name.variable.scope delete mode 100644 data/fixtures/scopes/kotlin/name/name.variable2.scope delete mode 100644 data/fixtures/scopes/kotlin/statement/statement.variable2.scope delete mode 100644 data/fixtures/scopes/kotlin/statement/statement.variable3.scope delete mode 100644 data/fixtures/scopes/kotlin/statement/statement.variable4.scope delete mode 100644 data/fixtures/scopes/kotlin/type/type.variable.scope delete mode 100644 data/fixtures/scopes/kotlin/type/type.variable2.scope delete mode 100644 data/fixtures/scopes/kotlin/type/type.variable3.scope delete mode 100644 data/fixtures/scopes/kotlin/type/type.variable4.scope delete mode 100644 data/fixtures/scopes/kotlin/type/type.variable5.scope delete mode 100644 data/fixtures/scopes/kotlin/value/value.variable.pattern.scope create mode 100644 data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope rename data/fixtures/scopes/typescript.core/name/{name.variable.scope => name.variable.initialized2.scope} (100%) create mode 100644 data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope diff --git a/data/fixtures/scopes/c/name/name.constant.scope b/data/fixtures/scopes/c/name/name.constant.scope new file mode 100644 index 0000000000..3ec7116144 --- /dev/null +++ b/data/fixtures/scopes/c/name/name.constant.scope @@ -0,0 +1,24 @@ +const int foo = 0; +--- + +[Content] = 0:10-0:13 + >---< +0| const int foo = 0; + +[Removal] = 0:10-0:14 + >----< +0| const int foo = 0; + +[Leading delimiter] = 0:9-0:10 + >-< +0| const int foo = 0; + +[Trailing delimiter] = 0:13-0:14 + >-< +0| const int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.variable.scope b/data/fixtures/scopes/c/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/csharp/name/name.variable.scope rename to data/fixtures/scopes/c/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/c/name/name.variable.uninitialized.scope b/data/fixtures/scopes/c/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..97f44e72b1 --- /dev/null +++ b/data/fixtures/scopes/c/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +int foo; +--- + +[Content] = 0:4-0:7 + >---< +0| int foo; + +[Removal] = 0:3-0:7 + >----< +0| int foo; + +[Leading delimiter] = 0:3-0:4 + >-< +0| int foo; + +[Domain] = 0:0-0:8 + >--------< +0| int foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/statement/statement.constant.scope b/data/fixtures/scopes/c/statement/statement.constant.scope new file mode 100644 index 0000000000..08e9c51c2a --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.constant.scope @@ -0,0 +1,10 @@ +const int foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement/statement.variable.scope b/data/fixtures/scopes/c/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/c/statement/statement.variable.scope rename to data/fixtures/scopes/c/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/go/statement/statement.variable3.scope b/data/fixtures/scopes/c/statement/statement.variable.uninitialized.scope similarity index 81% rename from data/fixtures/scopes/go/statement/statement.variable3.scope rename to data/fixtures/scopes/c/statement/statement.variable.uninitialized.scope index b3f49c96dd..b1c55b3d76 100644 --- a/data/fixtures/scopes/go/statement/statement.variable3.scope +++ b/data/fixtures/scopes/c/statement/statement.variable.uninitialized.scope @@ -1,10 +1,10 @@ -foo := 0 +int foo; --- [Content] = [Removal] = [Domain] = 0:0-0:8 >--------< -0| foo := 0 +0| int foo; [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/type/type.constant.scope b/data/fixtures/scopes/c/type/type.constant.scope new file mode 100644 index 0000000000..a36046e407 --- /dev/null +++ b/data/fixtures/scopes/c/type/type.constant.scope @@ -0,0 +1,24 @@ +const int foo = 0; +--- + +[Content] = 0:6-0:9 + >---< +0| const int foo = 0; + +[Removal] = 0:6-0:10 + >----< +0| const int foo = 0; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const int foo = 0; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/type/type.variable2.scope b/data/fixtures/scopes/c/type/type.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/c/type/type.variable2.scope rename to data/fixtures/scopes/c/type/type.variable.initialized.scope diff --git a/data/fixtures/scopes/c/type/type.variable.scope b/data/fixtures/scopes/c/type/type.variable.uninitialized.scope similarity index 100% rename from data/fixtures/scopes/c/type/type.variable.scope rename to data/fixtures/scopes/c/type/type.variable.uninitialized.scope diff --git a/data/fixtures/scopes/csharp/name/name.constant.scope b/data/fixtures/scopes/csharp/name/name.constant.scope new file mode 100644 index 0000000000..3ec7116144 --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.constant.scope @@ -0,0 +1,24 @@ +const int foo = 0; +--- + +[Content] = 0:10-0:13 + >---< +0| const int foo = 0; + +[Removal] = 0:10-0:14 + >----< +0| const int foo = 0; + +[Leading delimiter] = 0:9-0:10 + >-< +0| const int foo = 0; + +[Trailing delimiter] = 0:13-0:14 + >-< +0| const int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.variable.scope b/data/fixtures/scopes/csharp/name/name.variable.initialized.scope similarity index 88% rename from data/fixtures/scopes/c/name/name.variable.scope rename to data/fixtures/scopes/csharp/name/name.variable.initialized.scope index c0828198a5..65a4094cae 100644 --- a/data/fixtures/scopes/c/name/name.variable.scope +++ b/data/fixtures/scopes/csharp/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ int foo = 0; >---< 0| int foo = 0; -[Removal] = 0:0-0:10 - >----------< +[Removal] = 0:4-0:8 + >----< 0| int foo = 0; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/javascript.core/name/name.variable.scope b/data/fixtures/scopes/csharp/name/name.variable.initialized2.scope similarity index 59% rename from data/fixtures/scopes/javascript.core/name/name.variable.scope rename to data/fixtures/scopes/csharp/name/name.variable.initialized2.scope index b29e4d221e..62a273be8b 100644 --- a/data/fixtures/scopes/javascript.core/name/name.variable.scope +++ b/data/fixtures/scopes/csharp/name/name.variable.initialized2.scope @@ -1,24 +1,24 @@ -let foo = 0; +var foo = 0; --- [Content] = 0:4-0:7 >---< -0| let foo = 0; +0| var foo = 0; -[Removal] = 0:0-0:10 - >----------< -0| let foo = 0; +[Removal] = 0:4-0:8 + >----< +0| var foo = 0; [Leading delimiter] = 0:3-0:4 >-< -0| let foo = 0; +0| var foo = 0; [Trailing delimiter] = 0:7-0:8 >-< -0| let foo = 0; +0| var foo = 0; [Domain] = 0:0-0:12 >------------< -0| let foo = 0; +0| var foo = 0; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope b/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..97f44e72b1 --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +int foo; +--- + +[Content] = 0:4-0:7 + >---< +0| int foo; + +[Removal] = 0:3-0:7 + >----< +0| int foo; + +[Leading delimiter] = 0:3-0:4 + >-< +0| int foo; + +[Domain] = 0:0-0:8 + >--------< +0| int foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/statement/statement.constant.scope b/data/fixtures/scopes/csharp/statement/statement.constant.scope new file mode 100644 index 0000000000..08e9c51c2a --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.constant.scope @@ -0,0 +1,10 @@ +const int foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.variable.scope b/data/fixtures/scopes/csharp/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/csharp/statement/statement.variable.scope rename to data/fixtures/scopes/csharp/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/kotlin/statement/statement.variable.scope b/data/fixtures/scopes/csharp/statement/statement.variable.initialized2.scope similarity index 76% rename from data/fixtures/scopes/kotlin/statement/statement.variable.scope rename to data/fixtures/scopes/csharp/statement/statement.variable.initialized2.scope index 0c4f8800bd..7fba2976e6 100644 --- a/data/fixtures/scopes/kotlin/statement/statement.variable.scope +++ b/data/fixtures/scopes/csharp/statement/statement.variable.initialized2.scope @@ -1,10 +1,10 @@ -var foo: Int +var foo = 0; --- [Content] = [Removal] = [Domain] = 0:0-0:12 >------------< -0| var foo: Int +0| var foo = 0; [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/csharp/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..b1c55b3d76 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +int foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| int foo; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/type/type.constant.scope b/data/fixtures/scopes/csharp/type/type.constant.scope new file mode 100644 index 0000000000..a36046e407 --- /dev/null +++ b/data/fixtures/scopes/csharp/type/type.constant.scope @@ -0,0 +1,24 @@ +const int foo = 0; +--- + +[Content] = 0:6-0:9 + >---< +0| const int foo = 0; + +[Removal] = 0:6-0:10 + >----< +0| const int foo = 0; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const int foo = 0; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type/type.variable2.scope b/data/fixtures/scopes/csharp/type/type.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/csharp/type/type.variable2.scope rename to data/fixtures/scopes/csharp/type/type.variable.initialized.scope diff --git a/data/fixtures/scopes/csharp/type/type.variable.scope b/data/fixtures/scopes/csharp/type/type.variable.uninitialized.scope similarity index 100% rename from data/fixtures/scopes/csharp/type/type.variable.scope rename to data/fixtures/scopes/csharp/type/type.variable.uninitialized.scope diff --git a/data/fixtures/scopes/csharp/value/value.constant.scope b/data/fixtures/scopes/csharp/value/value.constant.scope new file mode 100644 index 0000000000..ef4c0a7e95 --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.constant.scope @@ -0,0 +1,20 @@ +const int foo = 0; +--- + +[Content] = 0:16-0:17 + >-< +0| const int foo = 0; + +[Removal] = 0:13-0:17 + >----< +0| const int foo = 0; + +[Leading delimiter] = 0:13-0:16 + >---< +0| const int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value/value.variable2.scope b/data/fixtures/scopes/csharp/value/value.variable2.scope new file mode 100644 index 0000000000..28cc6fc03f --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.variable2.scope @@ -0,0 +1,20 @@ +var foo = 0; +--- + +[Content] = 0:10-0:11 + >-< +0| var foo = 0; + +[Removal] = 0:7-0:11 + >----< +0| var foo = 0; + +[Leading delimiter] = 0:7-0:10 + >---< +0| var foo = 0; + +[Domain] = 0:0-0:12 + >------------< +0| var foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable.scope b/data/fixtures/scopes/go/name/name.variable.scope deleted file mode 100644 index 78abad522f..0000000000 --- a/data/fixtures/scopes/go/name/name.variable.scope +++ /dev/null @@ -1,24 +0,0 @@ -var foo int ---- - -[Content] = 0:4-0:7 - >---< -0| var foo int - -[Removal] = 0:4-0:8 - >----< -0| var foo int - -[Leading delimiter] = 0:3-0:4 - >-< -0| var foo int - -[Trailing delimiter] = 0:7-0:8 - >-< -0| var foo int - -[Domain] = 0:0-0:11 - >-----------< -0| var foo int - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable2.scope b/data/fixtures/scopes/go/name/name.variable2.scope deleted file mode 100644 index 11adc00523..0000000000 --- a/data/fixtures/scopes/go/name/name.variable2.scope +++ /dev/null @@ -1,24 +0,0 @@ -var foo int = 0 ---- - -[Content] = 0:4-0:7 - >---< -0| var foo int = 0 - -[Removal] = 0:4-0:8 - >----< -0| var foo int = 0 - -[Leading delimiter] = 0:3-0:4 - >-< -0| var foo int = 0 - -[Trailing delimiter] = 0:7-0:8 - >-< -0| var foo int = 0 - -[Domain] = 0:0-0:15 - >---------------< -0| var foo int = 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable3.scope b/data/fixtures/scopes/go/name/name.variable3.scope deleted file mode 100644 index cda5dd235d..0000000000 --- a/data/fixtures/scopes/go/name/name.variable3.scope +++ /dev/null @@ -1,20 +0,0 @@ -foo := 0 ---- - -[Content] = 0:0-0:3 - >---< -0| foo := 0 - -[Removal] = 0:0-0:4 - >----< -0| foo := 0 - -[Trailing delimiter] = 0:3-0:4 - >-< -0| foo := 0 - -[Domain] = 0:0-0:8 - >--------< -0| foo := 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/statement/statement.variable2.scope b/data/fixtures/scopes/go/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/go/statement/statement.variable2.scope rename to data/fixtures/scopes/go/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/go/statement/statement.variable.scope b/data/fixtures/scopes/go/statement/statement.variable.scope deleted file mode 100644 index d557d3cb76..0000000000 --- a/data/fixtures/scopes/go/statement/statement.variable.scope +++ /dev/null @@ -1,10 +0,0 @@ -var foo int ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:11 - >-----------< -0| var foo int - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/type/type.variable.scope b/data/fixtures/scopes/go/type/type.variable.scope deleted file mode 100644 index 44a666889c..0000000000 --- a/data/fixtures/scopes/go/type/type.variable.scope +++ /dev/null @@ -1,20 +0,0 @@ -var foo int ---- - -[Content] = 0:8-0:11 - >---< -0| var foo int - -[Removal] = 0:7-0:11 - >----< -0| var foo int - -[Leading delimiter] = 0:7-0:8 - >-< -0| var foo int - -[Domain] = 0:0-0:11 - >-----------< -0| var foo int - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.variable2.scope b/data/fixtures/scopes/go/type/type.variable2.scope deleted file mode 100644 index 7913b77ea5..0000000000 --- a/data/fixtures/scopes/go/type/type.variable2.scope +++ /dev/null @@ -1,24 +0,0 @@ -var foo int = 0 ---- - -[Content] = 0:8-0:11 - >---< -0| var foo int = 0 - -[Removal] = 0:8-0:12 - >----< -0| var foo int = 0 - -[Leading delimiter] = 0:7-0:8 - >-< -0| var foo int = 0 - -[Trailing delimiter] = 0:11-0:12 - >-< -0| var foo int = 0 - -[Domain] = 0:0-0:15 - >---------------< -0| var foo int = 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.variable.scope b/data/fixtures/scopes/java/name/name.variable.scope deleted file mode 100644 index eadef68728..0000000000 --- a/data/fixtures/scopes/java/name/name.variable.scope +++ /dev/null @@ -1,20 +0,0 @@ -int foo = 0; ---- - -[Content] = 0:4-0:7 - >---< -0| int foo = 0; - -[Removal] = 0:4-0:10 - >------< -0| int foo = 0; - -[Trailing delimiter] = 0:7-0:10 - >---< -0| int foo = 0; - -[Domain] = 0:0-0:12 - >------------< -0| int foo = 0; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/statement/statement.variable.scope b/data/fixtures/scopes/java/statement/statement.variable.scope deleted file mode 100644 index be2d642f7d..0000000000 --- a/data/fixtures/scopes/java/statement/statement.variable.scope +++ /dev/null @@ -1,10 +0,0 @@ -int foo = 0; ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:12 - >------------< -0| int foo = 0; - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/type/type.variable.scope b/data/fixtures/scopes/java/type/type.variable.scope deleted file mode 100644 index 7d37d372b7..0000000000 --- a/data/fixtures/scopes/java/type/type.variable.scope +++ /dev/null @@ -1,20 +0,0 @@ -int value; ---- - -[Content] = 0:0-0:3 - >---< -0| int value; - -[Removal] = 0:0-0:4 - >----< -0| int value; - -[Trailing delimiter] = 0:3-0:4 - >-< -0| int value; - -[Domain] = 0:0-0:10 - >----------< -0| int value; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type/type.variable2.scope b/data/fixtures/scopes/java/type/type.variable2.scope deleted file mode 100644 index 8f8fe619f1..0000000000 --- a/data/fixtures/scopes/java/type/type.variable2.scope +++ /dev/null @@ -1,20 +0,0 @@ -int value = 0; ---- - -[Content] = 0:0-0:3 - >---< -0| int value = 0; - -[Removal] = 0:0-0:4 - >----< -0| int value = 0; - -[Trailing delimiter] = 0:3-0:4 - >-< -0| int value = 0; - -[Domain] = 0:0-0:14 - >--------------< -0| int value = 0; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.assignment.pattern.scope b/data/fixtures/scopes/javascript.core/name/name.assignment.pattern.scope deleted file mode 100644 index bc19a63fe4..0000000000 --- a/data/fixtures/scopes/javascript.core/name/name.assignment.pattern.scope +++ /dev/null @@ -1,20 +0,0 @@ -({ foo, bar } = baz); ---- - -[Content] = 0:1-0:13 - >------------< -0| ({ foo, bar } = baz); - -[Removal] = 0:1-0:16 - >---------------< -0| ({ foo, bar } = baz); - -[Trailing delimiter] = 0:13-0:16 - >---< -0| ({ foo, bar } = baz); - -[Domain] = 0:1-0:19 - >------------------< -0| ({ foo, bar } = baz); - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.variable.pattern.scope b/data/fixtures/scopes/javascript.core/name/name.variable.pattern.scope deleted file mode 100644 index b17d1857df..0000000000 --- a/data/fixtures/scopes/javascript.core/name/name.variable.pattern.scope +++ /dev/null @@ -1,24 +0,0 @@ -const {foo, bar} = baz; ---- - -[Content] = 0:6-0:16 - >----------< -0| const {foo, bar} = baz; - -[Removal] = 0:0-0:19 - >-------------------< -0| const {foo, bar} = baz; - -[Leading delimiter] = 0:5-0:6 - >-< -0| const {foo, bar} = baz; - -[Trailing delimiter] = 0:16-0:17 - >-< -0| const {foo, bar} = baz; - -[Domain] = 0:0-0:23 - >-----------------------< -0| const {foo, bar} = baz; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.variable2.scope b/data/fixtures/scopes/javascript.core/name/name.variable2.scope deleted file mode 100644 index cd15b48a5a..0000000000 --- a/data/fixtures/scopes/javascript.core/name/name.variable2.scope +++ /dev/null @@ -1,24 +0,0 @@ -const foo = 0; ---- - -[Content] = 0:6-0:9 - >---< -0| const foo = 0; - -[Removal] = 0:0-0:12 - >------------< -0| const foo = 0; - -[Leading delimiter] = 0:5-0:6 - >-< -0| const foo = 0; - -[Trailing delimiter] = 0:9-0:10 - >-< -0| const foo = 0; - -[Domain] = 0:0-0:14 - >--------------< -0| const foo = 0; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/statement/statement.variable.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable.scope deleted file mode 100644 index 9ec6744100..0000000000 --- a/data/fixtures/scopes/javascript.core/statement/statement.variable.scope +++ /dev/null @@ -1,10 +0,0 @@ -const foo = 0; ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:14 - >--------------< -0| const foo = 0; - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.variable2.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable2.scope deleted file mode 100644 index cebc33100e..0000000000 --- a/data/fixtures/scopes/javascript.core/statement/statement.variable2.scope +++ /dev/null @@ -1,10 +0,0 @@ -let foo = 0; ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:12 - >------------< -0| let foo = 0; - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/value/value.variable.pattern.scope b/data/fixtures/scopes/javascript.core/value/value.variable.pattern.scope deleted file mode 100644 index 9b09d6c108..0000000000 --- a/data/fixtures/scopes/javascript.core/value/value.variable.pattern.scope +++ /dev/null @@ -1,20 +0,0 @@ -const {foo, bar} = baz; ---- - -[Content] = 0:19-0:22 - >---< -0| const {foo, bar} = baz; - -[Removal] = 0:16-0:22 - >------< -0| const {foo, bar} = baz; - -[Leading delimiter] = 0:16-0:19 - >---< -0| const {foo, bar} = baz; - -[Domain] = 0:0-0:23 - >-----------------------< -0| const {foo, bar} = baz; - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable.pattern.scope b/data/fixtures/scopes/kotlin/name/name.variable.pattern.scope deleted file mode 100644 index 41c7420ace..0000000000 --- a/data/fixtures/scopes/kotlin/name/name.variable.pattern.scope +++ /dev/null @@ -1,24 +0,0 @@ -var (foo, bar) = baz ---- - -[Content] = 0:4-0:14 - >----------< -0| var (foo, bar) = baz - -[Removal] = 0:4-0:15 - >-----------< -0| var (foo, bar) = baz - -[Leading delimiter] = 0:3-0:4 - >-< -0| var (foo, bar) = baz - -[Trailing delimiter] = 0:14-0:15 - >-< -0| var (foo, bar) = baz - -[Domain] = 0:0-0:20 - >--------------------< -0| var (foo, bar) = baz - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable.scope b/data/fixtures/scopes/kotlin/name/name.variable.scope deleted file mode 100644 index 1cd9475d1d..0000000000 --- a/data/fixtures/scopes/kotlin/name/name.variable.scope +++ /dev/null @@ -1,24 +0,0 @@ -var foo = 0 ---- - -[Content] = 0:4-0:7 - >---< -0| var foo = 0 - -[Removal] = 0:4-0:8 - >----< -0| var foo = 0 - -[Leading delimiter] = 0:3-0:4 - >-< -0| var foo = 0 - -[Trailing delimiter] = 0:7-0:8 - >-< -0| var foo = 0 - -[Domain] = 0:0-0:11 - >-----------< -0| var foo = 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable2.scope b/data/fixtures/scopes/kotlin/name/name.variable2.scope deleted file mode 100644 index 608e22c538..0000000000 --- a/data/fixtures/scopes/kotlin/name/name.variable2.scope +++ /dev/null @@ -1,24 +0,0 @@ -val foo = 0 ---- - -[Content] = 0:4-0:7 - >---< -0| val foo = 0 - -[Removal] = 0:4-0:8 - >----< -0| val foo = 0 - -[Leading delimiter] = 0:3-0:4 - >-< -0| val foo = 0 - -[Trailing delimiter] = 0:7-0:8 - >-< -0| val foo = 0 - -[Domain] = 0:0-0:11 - >-----------< -0| val foo = 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/statement/statement.variable2.scope b/data/fixtures/scopes/kotlin/statement/statement.variable2.scope deleted file mode 100644 index a69afa0fed..0000000000 --- a/data/fixtures/scopes/kotlin/statement/statement.variable2.scope +++ /dev/null @@ -1,10 +0,0 @@ -val foo: Int ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:12 - >------------< -0| val foo: Int - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/statement/statement.variable3.scope b/data/fixtures/scopes/kotlin/statement/statement.variable3.scope deleted file mode 100644 index 4934548475..0000000000 --- a/data/fixtures/scopes/kotlin/statement/statement.variable3.scope +++ /dev/null @@ -1,10 +0,0 @@ -var foo = 0 ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:11 - >-----------< -0| var foo = 0 - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/statement/statement.variable4.scope b/data/fixtures/scopes/kotlin/statement/statement.variable4.scope deleted file mode 100644 index 3e53923b5e..0000000000 --- a/data/fixtures/scopes/kotlin/statement/statement.variable4.scope +++ /dev/null @@ -1,10 +0,0 @@ -val foo = 0 ---- - -[Content] = -[Removal] = -[Domain] = 0:0-0:11 - >-----------< -0| val foo = 0 - -[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/type/type.variable.scope b/data/fixtures/scopes/kotlin/type/type.variable.scope deleted file mode 100644 index 99f31b1b07..0000000000 --- a/data/fixtures/scopes/kotlin/type/type.variable.scope +++ /dev/null @@ -1,20 +0,0 @@ -var foo: Int ---- - -[Content] = 0:9-0:12 - >---< -0| var foo: Int - -[Removal] = 0:7-0:12 - >-----< -0| var foo: Int - -[Leading delimiter] = 0:7-0:9 - >--< -0| var foo: Int - -[Domain] = 0:0-0:12 - >------------< -0| var foo: Int - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable2.scope b/data/fixtures/scopes/kotlin/type/type.variable2.scope deleted file mode 100644 index ded7ac42ef..0000000000 --- a/data/fixtures/scopes/kotlin/type/type.variable2.scope +++ /dev/null @@ -1,20 +0,0 @@ -val foo: Int = 0 ---- - -[Content] = 0:9-0:12 - >---< -0| val foo: Int = 0 - -[Removal] = 0:7-0:12 - >-----< -0| val foo: Int = 0 - -[Leading delimiter] = 0:7-0:9 - >--< -0| val foo: Int = 0 - -[Domain] = 0:0-0:16 - >----------------< -0| val foo: Int = 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable3.scope b/data/fixtures/scopes/kotlin/type/type.variable3.scope deleted file mode 100644 index efef805860..0000000000 --- a/data/fixtures/scopes/kotlin/type/type.variable3.scope +++ /dev/null @@ -1,20 +0,0 @@ -val foo: @Bar Int ---- - -[Content] = 0:9-0:17 - >--------< -0| val foo: @Bar Int - -[Removal] = 0:7-0:17 - >----------< -0| val foo: @Bar Int - -[Leading delimiter] = 0:7-0:9 - >--< -0| val foo: @Bar Int - -[Domain] = 0:0-0:17 - >-----------------< -0| val foo: @Bar Int - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable4.scope b/data/fixtures/scopes/kotlin/type/type.variable4.scope deleted file mode 100644 index 23c7360138..0000000000 --- a/data/fixtures/scopes/kotlin/type/type.variable4.scope +++ /dev/null @@ -1,20 +0,0 @@ -val foo: suspend () -> Int ---- - -[Content] = 0:9-0:26 - >-----------------< -0| val foo: suspend () -> Int - -[Removal] = 0:7-0:26 - >-------------------< -0| val foo: suspend () -> Int - -[Leading delimiter] = 0:7-0:9 - >--< -0| val foo: suspend () -> Int - -[Domain] = 0:0-0:26 - >--------------------------< -0| val foo: suspend () -> Int - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable5.scope b/data/fixtures/scopes/kotlin/type/type.variable5.scope deleted file mode 100644 index 6f020a93bb..0000000000 --- a/data/fixtures/scopes/kotlin/type/type.variable5.scope +++ /dev/null @@ -1,20 +0,0 @@ -val foo: suspend () -> Int = { 0 } ---- - -[Content] = 0:9-0:26 - >-----------------< -0| val foo: suspend () -> Int = { 0 } - -[Removal] = 0:7-0:26 - >-------------------< -0| val foo: suspend () -> Int = { 0 } - -[Leading delimiter] = 0:7-0:9 - >--< -0| val foo: suspend () -> Int = { 0 } - -[Domain] = 0:0-0:34 - >----------------------------------< -0| val foo: suspend () -> Int = { 0 } - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/value/value.variable.pattern.scope b/data/fixtures/scopes/kotlin/value/value.variable.pattern.scope deleted file mode 100644 index 09fdd87f04..0000000000 --- a/data/fixtures/scopes/kotlin/value/value.variable.pattern.scope +++ /dev/null @@ -1,20 +0,0 @@ -var (foo, bar) = baz ---- - -[Content] = 0:17-0:20 - >---< -0| var (foo, bar) = baz - -[Removal] = 0:14-0:20 - >------< -0| var (foo, bar) = baz - -[Leading delimiter] = 0:14-0:17 - >---< -0| var (foo, bar) = baz - -[Domain] = 0:0-0:20 - >--------------------< -0| var (foo, bar) = baz - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope b/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope new file mode 100644 index 0000000000..39cc72eef2 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope @@ -0,0 +1,24 @@ +const foo: number = 0; +--- + +[Content] = 0:12-0:15 + >---< +0| export type Foo = Bar; + +[Removal] = 0:12-0:16 + >----< +0| export type Foo = Bar; + +[Leading delimiter] = 0:11-0:12 + >-< +0| export type Foo = Bar; + +[Trailing delimiter] = 0:15-0:16 + >-< +0| export type Foo = Bar; + +[Domain] = 0:0-0:27 + >---------------------------< +0| export type Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.scope b/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/name/name.variable.scope rename to data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope b/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..d07a2ba9cc --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope @@ -0,0 +1,24 @@ +let foo: number; +--- + +[Content] = 0:12-0:15 + >---< +0| export type Foo = Bar; + +[Removal] = 0:12-0:16 + >----< +0| export type Foo = Bar; + +[Leading delimiter] = 0:11-0:12 + >-< +0| export type Foo = Bar; + +[Trailing delimiter] = 0:15-0:16 + >-< +0| export type Foo = Bar; + +[Domain] = 0:0-0:27 + >---------------------------< +0| export type Foo = Bar; + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index adf81af856..f93282c3c1 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -18,7 +18,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "statement.for": supported, "statement.while": supported, "statement.doWhile": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.break": supported, @@ -90,7 +91,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "condition.switchCase.iteration": supported, "name.assignment": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.function": supported, "name.class": supported, "name.enum": supported, @@ -113,7 +115,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.enum": supported, "value.iteration.document": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, "type.field.class": supported, @@ -181,10 +184,10 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - // Pattern destructing - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, + // Pattern destructuring + "name.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, // Command command: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 4a987ccfde..d5174eb089 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -69,7 +69,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.iteration.block": supported, "name.iteration.class": supported, "name.iteration.interface": supported, @@ -113,7 +114,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.iteration.block": supported, @@ -187,7 +189,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.yield": supported, @@ -258,10 +261,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.resource": notApplicable, "value.resource.iteration": notApplicable, - // Pattern destructing - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, + // Pattern destructuring + "name.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, // Type alias "type.alias": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 47a7ce520e..904ae77868 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -47,16 +47,19 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed.singleLine": notApplicable, // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index 335c004ea9..e363d5a339 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -25,7 +25,8 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "statement.switch": supported, "statement.for": supported, "statement.foreach": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.break": supported, @@ -108,7 +109,8 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "condition.switchCase.iteration": supported, "name.assignment": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.foreach": supported, "name.function": supported, "name.method": supported, @@ -139,7 +141,8 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.block": supported, "value.iteration.document": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, "type.argument.formal.method": supported, @@ -304,11 +307,13 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Pattern destructuring + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, + "name.assignment.destructuring": notApplicable, + // Miscellaneous "statement.misc": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, "value.return.lambda": notApplicable, "type.foreach": notApplicable, "type.cast": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 1219c0e752..9d25e2b573 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -21,16 +21,19 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index ade2743ba2..9e7ad976b2 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -106,7 +106,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.yield": supported, @@ -143,7 +144,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.field.enum": supported, "name.foreach": supported, "name.method": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.interface": supported, @@ -173,7 +175,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.resource": supported, @@ -243,10 +246,10 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, - // Pattern destructing - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, + // Pattern destructuring + "name.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, // Map literal map: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index b599a9a38a..884699c5fd 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -34,7 +34,8 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.yield": supported, @@ -144,9 +145,10 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": supported, "name.foreach": supported, "name.assignment": supported, - "name.assignment.pattern": supported, - "name.variable": supported, - "name.variable.pattern": supported, + "name.assignment.destructuring": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, "name.function": supported, "name.method": supported, "name.constructor": supported, @@ -169,7 +171,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.mapPair.iteration": supported, "value.assignment": supported, "value.variable": supported, - "value.variable.pattern": supported, + "value.variable.destructuring": supported, "value.foreach": supported, "value.return": supported, "value.return.lambda": supported, @@ -281,7 +283,8 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": notApplicable, "type.foreach": notApplicable, "type.return": notApplicable, - "type.variable": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 7a880c6be7..ce89ef6f76 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -24,16 +24,19 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index 1b77ca770b..0cda0492cc 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -107,7 +107,8 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.break": supported, @@ -135,7 +136,6 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": supported, "name.argument.actual": supported, "name.argument.actual.iteration": supported, - "name.assignment": supported, "name.class": supported, "name.interface": supported, "name.enum": supported, @@ -146,8 +146,11 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, - "name.variable": supported, - "name.variable.pattern": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, + "name.assignment": supported, + "name.assignment.destructuring": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.interface": supported, @@ -172,7 +175,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "value.return": supported, "value.return.lambda": supported, "value.variable": supported, - "value.variable.pattern": supported, + "value.variable.destructuring": supported, "value.typeAlias": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -191,7 +194,8 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.class": supported, @@ -280,9 +284,6 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "statement.yield": notApplicable, "value.yield": notApplicable, - // Keyword argument assignment pattern - "name.assignment.pattern": notApplicable, - // Values in enum "value.field.enum": notApplicable, "value.iteration.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index 038698915e..4e7c3f046f 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -35,16 +35,19 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index 8b40bc48c2..c1772c4f1c 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -54,7 +54,7 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.formal.method.multiLine": supported, "name.assignment": supported, - "name.assignment.pattern": supported, + "name.assignment.destructuring": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, "name.argument.formal.method": supported, @@ -62,8 +62,9 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, - "name.variable": supported, - "name.variable.pattern": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, "name.iteration.block": supported, "name.iteration.document": supported, @@ -71,7 +72,7 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "value.foreach": supported, "value.return": supported, "value.variable": supported, - "value.variable.pattern": supported, + "value.variable.destructuring": supported, "value.iteration.block": supported, "value.iteration.document": supported, @@ -104,7 +105,8 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "statement.doWhile": supported, "statement.for": supported, "statement.foreach": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.break": supported, @@ -202,7 +204,8 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": notApplicable, "type.argument.catch": notApplicable, "type.return": notApplicable, - "type.variable": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.alias": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index e257e5bc00..c133a53258 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -25,16 +25,19 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed.singleLine": notApplicable, // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index ab00d104ae..413d21aac5 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -29,7 +29,8 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.multiLine": supported, "argument.actual.iteration": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.assignment": supported, "key.mapPair": supported, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 0acba4feaa..1f5ad0b76c 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -4,10 +4,12 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.iteration.document": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.iteration.document": supported, "key.mapPair": supported, @@ -235,10 +237,10 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "value.resource": notApplicable, "value.resource.iteration": notApplicable, - // Pattern destruction - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, + // Pattern destructuring + "name.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, // String "string.singleLine": notApplicable, @@ -316,14 +318,17 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "statement.break": notApplicable, "statement.continue": notApplicable, - // Miscellaneous - "statement.misc": notApplicable, + // Types "type.cast": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, - "type.variable": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, fieldAccess: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index c624909643..678fe5b235 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -17,7 +17,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": supported, "name.argument.catch": supported, "name.assignment": supported, - "name.assignment.pattern": supported, + "name.assignment.destructuring": supported, "name.class": supported, "name.constructor": supported, "name.field.class": supported, @@ -26,8 +26,9 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.class": supported, "name.iteration.document": supported, "name.method": supported, - "name.variable": supported, - "name.variable.pattern": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, "value.foreach": supported, "value.yield": supported, @@ -48,7 +49,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.return": supported, "value.return.lambda": supported, "value.variable": supported, - "value.variable.pattern": supported, + "value.variable.destructuring": supported, "value.switch": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -66,7 +67,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.return": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.iteration.block": supported, "type.iteration.class": supported, "type.iteration.document": supported, @@ -185,7 +187,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "statement.switch": supported, "statement.foreach": supported, "statement.while": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.yield": supported, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index dfd6ed26a8..c480360037 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -34,7 +34,8 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, "name.assignment": supported, "name.function": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, namedFunction: supported, "value.assignment": supported, "value.variable": supported, @@ -86,7 +87,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "interior.cell": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, - "name.assignment.pattern": notApplicable, + "name.assignment.destructuring": notApplicable, "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, @@ -112,9 +113,10 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.class": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.typeAlias": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, command: notApplicable, element: notApplicable, endTag: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 4eda7c1491..2574d66b20 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -82,7 +82,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.switch": supported, "statement.foreach": supported, "statement.while": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.break": supported, @@ -105,7 +106,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method": supported, "name.argument.formal.method.iteration": supported, "name.assignment": supported, - "name.assignment.pattern": supported, + "name.assignment.destructuring": supported, "name.class": supported, "name.enum": supported, "name.field.class": supported, @@ -114,8 +115,9 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.function": supported, "name.method": supported, "name.namespace": supported, - "name.variable": supported, - "name.variable.pattern": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, "name.iteration.block": supported, "name.iteration.class": supported, "name.iteration.enum": supported, @@ -131,7 +133,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "value.switch": supported, "value.typeAlias": supported, "value.variable": supported, - "value.variable.pattern": supported, + "value.variable.destructuring": supported, "value.iteration.block": supported, "value.iteration.class": supported, "value.iteration.document": supported, @@ -146,7 +148,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": supported, "type.field.class": supported, "type.return": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.alias": supported, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index b695848460..3dd7a973dc 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -107,7 +107,8 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.return": supported, "statement.namespace": supported, @@ -133,7 +134,6 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.constructor": supported, "name.argument.formal.constructor.iteration": supported, "name.argument.catch": supported, - "name.assignment": supported, "name.class": supported, "name.interface": supported, "name.enum": supported, @@ -143,8 +143,11 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, - "name.variable": supported, - "name.variable.pattern": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, + "name.assignment": supported, + "name.assignment.destructuring": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.interface": supported, @@ -167,7 +170,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "value.return": supported, "value.return.lambda": supported, "value.variable": supported, - "value.variable.pattern": supported, + "value.variable.destructuring": supported, "value.iteration.block": supported, "value.iteration.class": supported, "value.iteration.document": supported, @@ -184,7 +187,8 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.class": supported, @@ -251,9 +255,6 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "value.resource": notApplicable, "value.resource.iteration": notApplicable, - // Pattern destructuring assignment - "name.assignment.pattern": notApplicable, - // Branches and conditions "branch.ternary": notApplicable, "branch.ternary.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index c7047363bf..7248a64bc4 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -26,16 +26,19 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 05ef8f340b..ae7a9b4d9c 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -130,14 +130,30 @@ export const scopeSupportFacetInfos: Record< description: "A do-while loop statement", scopeType: "statement", }, - "statement.variable": { - description: "A variable declaration", + "statement.variable.uninitialized": { + description: "An uninitialized variable declaration", + scopeType: "statement", + }, + "statement.variable.initialized": { + description: "An initialized variable declaration", + scopeType: "statement", + }, + "statement.variable.destructuring": { + description: "A variable declaration pattern destructuring", + scopeType: "statement", + }, + "statement.constant": { + description: "A constant declaration", scopeType: "statement", }, "statement.assignment": { description: "An assignment statement", scopeType: "statement", }, + "statement.assignment.destructuring": { + description: "An assignment statement with pattern destructuring", + scopeType: "statement", + }, "statement.return": { description: "A return statement", scopeType: "statement", @@ -574,27 +590,35 @@ export const scopeSupportFacetInfos: Record< "the switch statement body", ), - "name.assignment": { - description: "Name (LHS) of an assignment", - scopeType: "name", - }, - "name.assignment.pattern": { - description: "LHS of an assignment with pattern destructuring", - scopeType: "name", - }, "name.command": { description: "LHS of a command, eg Talon spoken command or bash", scopeType: "name", }, - "name.variable": { - description: "Name (LHS) of a variable declaration", + "name.variable.uninitialized": { + description: "Name (LHS) of an uninitialized variable declaration", scopeType: "name", }, - "name.variable.pattern": { + "name.variable.initialized": { + description: "Name (LHS) of an initialized variable declaration", + scopeType: "name", + }, + "name.variable.destructuring": { description: "Name (LHS) of a variable declaration with pattern destructuring", scopeType: "name", }, + "name.constant": { + description: "Name (LHS) of a constant declaration", + scopeType: "name", + }, + "name.assignment": { + description: "Name (LHS) of an assignment", + scopeType: "name", + }, + "name.assignment.destructuring": { + description: "LHS of an assignment with pattern destructuring", + scopeType: "name", + }, "name.foreach": { description: "Iteration variable name in a for each loop", scopeType: "name", @@ -708,10 +732,6 @@ export const scopeSupportFacetInfos: Record< "should be between the braces", ), - "value.assignment": { - description: "Value (RHS) of an assignment", - scopeType: "value", - }, "value.command": { description: "Value (RHS) of an command, eg Talon spoken command", scopeType: "value", @@ -720,11 +740,19 @@ export const scopeSupportFacetInfos: Record< description: "Value (RHS) of a variable declaration", scopeType: "value", }, - "value.variable.pattern": { + "value.variable.destructuring": { description: "Value (RHS) of a variable declaration with pattern destructuring", scopeType: "value", }, + "value.constant": { + description: "Value (RHS) of a constant declaration", + scopeType: "value", + }, + "value.assignment": { + description: "Value (RHS) of an assignment", + scopeType: "value", + }, "value.mapPair": { description: "Value (RHS) of a key-value pair in a map", scopeType: "value", @@ -820,12 +848,20 @@ export const scopeSupportFacetInfos: Record< scopeType: "value", }, - "type.variable": { - description: "Type of variable in a variable declaration", + "type.variable.uninitialized": { + description: "Type of an uninitialized variable declaration", + scopeType: "type", + }, + "type.variable.initialized": { + description: "Type of an initialized variable declaration", + scopeType: "type", + }, + "type.constant": { + description: "Type of a constant declaration", scopeType: "type", }, "type.argument.formal": { - description: "Type of formal parameter in a function declaration", + description: "Type of a formal parameter in a function declaration", scopeType: "type", }, "type.argument.formal.iteration": iteration( @@ -834,7 +870,7 @@ export const scopeSupportFacetInfos: Record< "the parameters list. The domain should be the entire function", ), "type.argument.formal.method": { - description: "Type of formal parameter in a class method declaration", + description: "Type of a formal parameter in a class method declaration", scopeType: "type", }, "type.argument.formal.method.iteration": iteration( @@ -843,7 +879,7 @@ export const scopeSupportFacetInfos: Record< "the parameters list. The domain should be the entire method", ), "type.argument.formal.constructor": { - description: "Type of formal parameter in a constructor declaration", + description: "Type of a formal parameter in a constructor declaration", scopeType: "type", }, "type.argument.formal.constructor.iteration": iteration( @@ -852,24 +888,24 @@ export const scopeSupportFacetInfos: Record< "the parameters list. The domain should be the entire constructor", ), "type.argument.catch": { - description: "Type of parameter in a catch clause", + description: "Type of a parameter in a catch clause", scopeType: "type", }, "type.return": { - description: "Type of return value in a function declaration", + description: "Type of a return value in a function declaration", scopeType: "type", }, "type.field.class": { - description: "Type of field in a class", + description: "Type of a field in a class", scopeType: "type", }, "type.field.interface": { - description: "Type of field in a interface", + description: "Type of a field in a interface", scopeType: "type", }, "type.foreach": { - description: "Type of variable in a for each loop", + description: "Type of a variable in a for each loop", scopeType: "type", }, "type.enum": { diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 0b21f3c068..befa7e4fe4 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -43,8 +43,12 @@ export const scopeSupportFacets = [ "statement.foreach", "statement.while", "statement.doWhile", - "statement.variable", + "statement.variable.uninitialized", + "statement.variable.initialized", + "statement.variable.destructuring", + "statement.constant", "statement.assignment", + "statement.assignment.destructuring", "statement.return", "statement.yield", "statement.break", @@ -167,11 +171,13 @@ export const scopeSupportFacets = [ "condition.switchCase", "condition.switchCase.iteration", - "name.assignment", - "name.assignment.pattern", "name.command", - "name.variable", - "name.variable.pattern", + "name.variable.uninitialized", + "name.variable.initialized", + "name.variable.destructuring", + "name.constant", + "name.assignment", + "name.assignment.destructuring", "name.foreach", "name.function", "name.method", @@ -204,10 +210,11 @@ export const scopeSupportFacets = [ "key.mapPair", "key.mapPair.iteration", - "value.assignment", "value.command", "value.variable", - "value.variable.pattern", + "value.variable.destructuring", + "value.constant", + "value.assignment", "value.mapPair", "value.mapPair.iteration", "value.attribute", @@ -234,7 +241,9 @@ export const scopeSupportFacets = [ "value.iteration.enum", "value.iteration.document", - "type.variable", + "type.variable.uninitialized", + "type.variable.initialized", + "type.constant", "type.return", "type.field.class", "type.field.interface", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index ee3385a8f8..bcca11d4a4 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -18,12 +18,14 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment": supported, "name.command": supported, - "name.variable": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, "name.iteration.block": supported, "name.iteration.document": supported, "statement.command": supported, - "statement.variable": supported, + "statement.variable.uninitialized": supported, + "statement.variable.initialized": supported, "statement.assignment": supported, "statement.iteration.block": supported, "statement.iteration.document": supported, @@ -263,10 +265,10 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.resource": notApplicable, "value.resource.iteration": notApplicable, - // Pattern destruction - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, + // Pattern destructuring + "name.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, // Multiline string "string.multiLine": notApplicable, @@ -325,6 +327,15 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "statement.break": notApplicable, "statement.continue": notApplicable, + // Types + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, + "type.cast": notApplicable, + "type.typeArgument": notApplicable, + "type.typeArgument.iteration": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.document": notApplicable, + // Miscellaneous list: notApplicable, map: notApplicable, @@ -332,12 +343,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { pairDelimiter: notApplicable, regularExpression: notApplicable, "statement.misc": notApplicable, - "type.variable": notApplicable, - "type.cast": notApplicable, - "type.typeArgument": notApplicable, - "type.typeArgument.iteration": notApplicable, - "type.iteration.block": notApplicable, - "type.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, disqualifyDelimiter: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index bb6a7a8ab9..37d3df899d 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -4,10 +4,10 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; export const talonListScopeSupport: LanguageScopeSupportFacetMap = { - "statement.variable": supported, + "statement.variable.initialized": supported, "statement.iteration.document": supported, - "name.variable": supported, + "name.variable.initialized": supported, "name.iteration.document": supported, "key.mapPair": supported, @@ -238,10 +238,10 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "value.resource": notApplicable, "value.resource.iteration": notApplicable, - // Pattern destruction - "name.assignment.pattern": notApplicable, - "name.variable.pattern": notApplicable, - "value.variable.pattern": notApplicable, + // Pattern destructuring + "name.assignment.destructuring": notApplicable, + "name.variable.destructuring": notApplicable, + "value.variable.destructuring": notApplicable, // String "string.multiLine": notApplicable, @@ -317,14 +317,21 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "statement.break": notApplicable, "statement.continue": notApplicable, - // Miscellaneous - "statement.misc": notApplicable, + // Types "type.cast": notApplicable, "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, "type.typeArgument.iteration": notApplicable, "type.typeArgument": notApplicable, - "type.variable": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, + + // Uninitialized variables + "statement.variable.uninitialized": supported, + "name.variable.uninitialized": supported, + + // Miscellaneous + "statement.misc": notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, fieldAccess: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 75cd78dc86..56b6333973 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -22,7 +22,8 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.interface": supported, "type.enum": supported, "type.return": supported, - "type.variable": supported, + "type.variable.uninitialized": supported, + "type.variable.initialized": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.iteration.block": supported, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index e4bb0a0a93..bb1a62606f 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -21,16 +21,19 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 7687cc114b..313083152c 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -33,16 +33,19 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed.singleLine": notApplicable, // Variable - "statement.variable": notApplicable, + "statement.variable.uninitialized": notApplicable, + "statement.variable.initialized": notApplicable, "statement.assignment": notApplicable, "name.assignment": notApplicable, - "name.assignment.pattern": notApplicable, - "name.variable": notApplicable, - "name.variable.pattern": notApplicable, - "type.variable": notApplicable, + "name.assignment.destructuring": notApplicable, + "name.variable.uninitialized": notApplicable, + "name.variable.initialized": notApplicable, + "name.variable.destructuring": notApplicable, + "type.variable.uninitialized": notApplicable, + "type.variable.initialized": notApplicable, "value.assignment": notApplicable, "value.variable": notApplicable, - "value.variable.pattern": notApplicable, + "value.variable.destructuring": notApplicable, // Class class: notApplicable, diff --git a/queries/c.scm b/queries/c.scm index 5d18781451..fcc4082104 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -193,9 +193,9 @@ (declaration declarator: (_ declarator: (_) @name @value.leading.endOf - value: (_) @value @name.removal.end.startOf + value: (_) @value ) -) @_.domain @name.removal.start.startOf +) @_.domain ;;!! int aaa; (declaration From 17b98c9f1c00aaa9da66f79109ecc9f422c6437e Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 11:10:12 +0100 Subject: [PATCH 02/25] go --- .../go/name/name.variable.initialized.scope | 24 +++++++++++++++++++ .../go/name/name.variable.initialized2.scope | 20 ++++++++++++++++ .../go/name/name.variable.uninitialized.scope | 24 +++++++++++++++++++ .../statement.variable.initialized2.scope | 10 ++++++++ .../statement.variable.uninitialized.scope | 10 ++++++++ .../go/type/type.variable.initialized.scope | 24 +++++++++++++++++++ .../go/type/type.variable.uninitialized.scope | 20 ++++++++++++++++ 7 files changed, 132 insertions(+) create mode 100644 data/fixtures/scopes/go/name/name.variable.initialized.scope create mode 100644 data/fixtures/scopes/go/name/name.variable.initialized2.scope create mode 100644 data/fixtures/scopes/go/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/go/statement/statement.variable.initialized2.scope create mode 100644 data/fixtures/scopes/go/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/go/type/type.variable.initialized.scope create mode 100644 data/fixtures/scopes/go/type/type.variable.uninitialized.scope diff --git a/data/fixtures/scopes/go/name/name.variable.initialized.scope b/data/fixtures/scopes/go/name/name.variable.initialized.scope new file mode 100644 index 0000000000..11adc00523 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.variable.initialized.scope @@ -0,0 +1,24 @@ +var foo int = 0 +--- + +[Content] = 0:4-0:7 + >---< +0| var foo int = 0 + +[Removal] = 0:4-0:8 + >----< +0| var foo int = 0 + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo int = 0 + +[Trailing delimiter] = 0:7-0:8 + >-< +0| var foo int = 0 + +[Domain] = 0:0-0:15 + >---------------< +0| var foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable.initialized2.scope b/data/fixtures/scopes/go/name/name.variable.initialized2.scope new file mode 100644 index 0000000000..cda5dd235d --- /dev/null +++ b/data/fixtures/scopes/go/name/name.variable.initialized2.scope @@ -0,0 +1,20 @@ +foo := 0 +--- + +[Content] = 0:0-0:3 + >---< +0| foo := 0 + +[Removal] = 0:0-0:4 + >----< +0| foo := 0 + +[Trailing delimiter] = 0:3-0:4 + >-< +0| foo := 0 + +[Domain] = 0:0-0:8 + >--------< +0| foo := 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable.uninitialized.scope b/data/fixtures/scopes/go/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..78abad522f --- /dev/null +++ b/data/fixtures/scopes/go/name/name.variable.uninitialized.scope @@ -0,0 +1,24 @@ +var foo int +--- + +[Content] = 0:4-0:7 + >---< +0| var foo int + +[Removal] = 0:4-0:8 + >----< +0| var foo int + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo int + +[Trailing delimiter] = 0:7-0:8 + >-< +0| var foo int + +[Domain] = 0:0-0:11 + >-----------< +0| var foo int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/statement/statement.variable.initialized2.scope b/data/fixtures/scopes/go/statement/statement.variable.initialized2.scope new file mode 100644 index 0000000000..b3f49c96dd --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.variable.initialized2.scope @@ -0,0 +1,10 @@ +foo := 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo := 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/go/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..d557d3cb76 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +var foo int +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| var foo int + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/type/type.variable.initialized.scope b/data/fixtures/scopes/go/type/type.variable.initialized.scope new file mode 100644 index 0000000000..7913b77ea5 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.variable.initialized.scope @@ -0,0 +1,24 @@ +var foo int = 0 +--- + +[Content] = 0:8-0:11 + >---< +0| var foo int = 0 + +[Removal] = 0:8-0:12 + >----< +0| var foo int = 0 + +[Leading delimiter] = 0:7-0:8 + >-< +0| var foo int = 0 + +[Trailing delimiter] = 0:11-0:12 + >-< +0| var foo int = 0 + +[Domain] = 0:0-0:15 + >---------------< +0| var foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.variable.uninitialized.scope b/data/fixtures/scopes/go/type/type.variable.uninitialized.scope new file mode 100644 index 0000000000..44a666889c --- /dev/null +++ b/data/fixtures/scopes/go/type/type.variable.uninitialized.scope @@ -0,0 +1,20 @@ +var foo int +--- + +[Content] = 0:8-0:11 + >---< +0| var foo int + +[Removal] = 0:7-0:11 + >----< +0| var foo int + +[Leading delimiter] = 0:7-0:8 + >-< +0| var foo int + +[Domain] = 0:0-0:11 + >-----------< +0| var foo int + +[Insertion delimiter] = " " From b0c7a2a14336af91037e0ad71713d600fdc17d2d Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 11:34:46 +0100 Subject: [PATCH 03/25] java --- .../scopes/java/name/name.constant.scope | 24 +++++++++++ .../scopes/java/name/name.field.class.scope | 12 ++++-- .../java/name/name.variable.initialized.scope | 24 +++++++++++ .../name/name.variable.uninitialized.scope | 20 ++++++++++ .../statement.variable.initialized.scope | 10 +++++ .../statement.variable.uninitialized.scope | 10 +++++ .../statementstatement.constant.scope | 10 +++++ .../scopes/java/type/type.constant.scope | 24 +++++++++++ .../java/type/type.variable.initialized.scope | 20 ++++++++++ .../type/type.variable.uninitialized.scope | 20 ++++++++++ .../src/docs/components/ScopeVisualizer.tsx | 4 +- queries/java.scm | 40 +++++++++---------- 12 files changed, 191 insertions(+), 27 deletions(-) create mode 100644 data/fixtures/scopes/java/name/name.constant.scope create mode 100644 data/fixtures/scopes/java/name/name.variable.initialized.scope create mode 100644 data/fixtures/scopes/java/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/java/statement/statement.variable.initialized.scope create mode 100644 data/fixtures/scopes/java/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/java/statement/statementstatement.constant.scope create mode 100644 data/fixtures/scopes/java/type/type.constant.scope create mode 100644 data/fixtures/scopes/java/type/type.variable.initialized.scope create mode 100644 data/fixtures/scopes/java/type/type.variable.uninitialized.scope diff --git a/data/fixtures/scopes/java/name/name.constant.scope b/data/fixtures/scopes/java/name/name.constant.scope new file mode 100644 index 0000000000..f25559df8e --- /dev/null +++ b/data/fixtures/scopes/java/name/name.constant.scope @@ -0,0 +1,24 @@ +final int foo = 0; +--- + +[Content] = 0:10-0:13 + >---< +0| final int foo = 0; + +[Removal] = 0:10-0:14 + >----< +0| final int foo = 0; + +[Leading delimiter] = 0:9-0:10 + >-< +0| final int foo = 0; + +[Trailing delimiter] = 0:13-0:14 + >-< +0| final int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| final int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.field.class.scope b/data/fixtures/scopes/java/name/name.field.class.scope index 2c2c5942d5..da0b260bf5 100644 --- a/data/fixtures/scopes/java/name/name.field.class.scope +++ b/data/fixtures/scopes/java/name/name.field.class.scope @@ -54,12 +54,16 @@ public class Foo { >---< 2| private int baz = 0; -[#3 Removal] = 2:16-2:22 - >------< +[#3 Removal] = 2:16-2:20 + >----< 2| private int baz = 0; -[#3 Trailing delimiter] = 2:19-2:22 - >---< +[#3 Leading delimiter] = 2:15-2:16 + >-< +2| private int baz = 0; + +[#3 Trailing delimiter] = 2:19-2:20 + >-< 2| private int baz = 0; [#3 Domain] = 2:4-2:24 diff --git a/data/fixtures/scopes/java/name/name.variable.initialized.scope b/data/fixtures/scopes/java/name/name.variable.initialized.scope new file mode 100644 index 0000000000..65a4094cae --- /dev/null +++ b/data/fixtures/scopes/java/name/name.variable.initialized.scope @@ -0,0 +1,24 @@ +int foo = 0; +--- + +[Content] = 0:4-0:7 + >---< +0| int foo = 0; + +[Removal] = 0:4-0:8 + >----< +0| int foo = 0; + +[Leading delimiter] = 0:3-0:4 + >-< +0| int foo = 0; + +[Trailing delimiter] = 0:7-0:8 + >-< +0| int foo = 0; + +[Domain] = 0:0-0:12 + >------------< +0| int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.variable.uninitialized.scope b/data/fixtures/scopes/java/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..97f44e72b1 --- /dev/null +++ b/data/fixtures/scopes/java/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +int foo; +--- + +[Content] = 0:4-0:7 + >---< +0| int foo; + +[Removal] = 0:3-0:7 + >----< +0| int foo; + +[Leading delimiter] = 0:3-0:4 + >-< +0| int foo; + +[Domain] = 0:0-0:8 + >--------< +0| int foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/statement/statement.variable.initialized.scope b/data/fixtures/scopes/java/statement/statement.variable.initialized.scope new file mode 100644 index 0000000000..be2d642f7d --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.variable.initialized.scope @@ -0,0 +1,10 @@ +int foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| int foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/java/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..b1c55b3d76 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +int foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| int foo; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statementstatement.constant.scope b/data/fixtures/scopes/java/statement/statementstatement.constant.scope new file mode 100644 index 0000000000..5914aa32e2 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statementstatement.constant.scope @@ -0,0 +1,10 @@ +final int foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| int foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/type/type.constant.scope b/data/fixtures/scopes/java/type/type.constant.scope new file mode 100644 index 0000000000..e46d331b34 --- /dev/null +++ b/data/fixtures/scopes/java/type/type.constant.scope @@ -0,0 +1,24 @@ +final int foo = 0; +--- + +[Content] = 0:6-0:9 + >---< +0| final int foo = 0; + +[Removal] = 0:6-0:10 + >----< +0| final int foo = 0; + +[Leading delimiter] = 0:5-0:6 + >-< +0| final int foo = 0; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| final int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| final int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type/type.variable.initialized.scope b/data/fixtures/scopes/java/type/type.variable.initialized.scope new file mode 100644 index 0000000000..b3a492d68a --- /dev/null +++ b/data/fixtures/scopes/java/type/type.variable.initialized.scope @@ -0,0 +1,20 @@ +int foo = 0; +--- + +[Content] = 0:0-0:3 + >---< +0| int foo = 0; + +[Removal] = 0:0-0:4 + >----< +0| int foo = 0; + +[Trailing delimiter] = 0:3-0:4 + >-< +0| int foo = 0; + +[Domain] = 0:0-0:12 + >------------< +0| int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type/type.variable.uninitialized.scope b/data/fixtures/scopes/java/type/type.variable.uninitialized.scope new file mode 100644 index 0000000000..192f80ca15 --- /dev/null +++ b/data/fixtures/scopes/java/type/type.variable.uninitialized.scope @@ -0,0 +1,20 @@ +int foo; +--- + +[Content] = 0:0-0:3 + >---< +0| int foo; + +[Removal] = 0:0-0:4 + >----< +0| int foo; + +[Trailing delimiter] = 0:3-0:4 + >-< +0| int foo; + +[Domain] = 0:0-0:8 + >--------< +0| int foo; + +[Insertion delimiter] = " " diff --git a/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx b/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx index 7fbcd0359b..a60f4e93e0 100644 --- a/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx +++ b/packages/cursorless-org-docs/src/docs/components/ScopeVisualizer.tsx @@ -47,7 +47,9 @@ export function ScopeVisualizer({ languageId, scopeTypeType }: Props) { const [scopes] = useState( getScopeFixtures(scopeTests, languageId, scopeTypeType), ); - const [rangeType, setRangeType] = useState("content"); + const [rangeType, setRangeType] = useState( + scopeTypeType != null ? "blend" : "content", + ); const [renderWhitespace, setRenderWhitespace] = useState( scopeTypeType != null, ); diff --git a/queries/java.scm b/queries/java.scm index 3c0eb8fb38..dc941e1ee5 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -335,13 +335,6 @@ ")" @type.iteration.end.startOf @name.iteration.end.startOf ) -;;!! List list = value; -;;! ^^^^^^^^^^^^ -;;! -------------------------- -(local_variable_declaration - type: (_) @type -) @_.domain - ;;!! name = new ArrayList(); ;;! ^^^^^^^^^^^^^^^^^ ;;! ----------------------- @@ -412,38 +405,41 @@ value: (_) @value ) @branch @_.domain -;;!! int value = 0; -;;! ^ -;;! xxxx -;;! -------------- +;;!! int foo = 0; +;;! ^^^ +;;! ^^^ +;;! ^ (local_variable_declaration + type: (_) @type (variable_declarator name: (_) @name @value.leading.endOf - value: (_)? @value @name.trailing.startOf + value: (_)? @value ) ) @_.domain -;;!! int value = 0; +;;!! int foo = 0; ;;! ^^^ -;;! ^^^^^ -;;! ^ +;;! ^^^ +;;! ^ (field_declaration type: (_) @type (variable_declarator name: (_) @name @value.leading.endOf - value: (_)? @value @name.trailing.startOf + value: (_)? @value ) ) @_.domain ;;!! int value; ;;! ^^^ ;;! ^^^^^ -(constant_declaration - type: (_) @type - (variable_declarator - name: (_) @name - ) -) @_.domain +(interface_body + (constant_declaration + type: (_) @type + (variable_declarator + name: (_) @name + ) + ) @_.domain +) ;;!! int foo, bar; ;;! ^^^ ^^^ From 8f88622d07e18cbe04238a26b8901242e0f89e20 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 11:55:03 +0100 Subject: [PATCH 04/25] js/ts --- .../name/name.assignment.destructuring.scope | 20 +++++++++++++ .../javascript.core/name/name.constant.scope | 24 +++++++++++++++ .../name/name.variable.destructuring.scope | 24 +++++++++++++++ .../name/name.variable.initialized.scope | 24 +++++++++++++++ .../name/name.variable.uninitialized.scope | 20 +++++++++++++ .../statement.assignment.destructuring.scope | 10 +++++++ .../statement.variable.destructuring.scope | 10 +++++++ .../statement.variable.initialized.scope | 10 +++++++ .../statement.variable.uninitialized.scope | 10 +++++++ .../value/value.constant.scope | 20 +++++++++++++ .../value/value.variable.destructuring.scope | 20 +++++++++++++ .../value/value.variable.scope | 26 ++++++++-------- .../typescript.core/name/name.constant.scope | 20 +++++++++++++ .../name/name.variable.initialized.scope | 30 ++++++++----------- .../name/name.variable.uninitialized.scope | 28 ++++++++--------- ...pe.variable2.scope => type.constant.scope} | 0 .../type/type.variable.initialized.scope | 24 +++++++++++++++ ...cope => type.variable.uninitialized.scope} | 0 18 files changed, 274 insertions(+), 46 deletions(-) create mode 100644 data/fixtures/scopes/javascript.core/name/name.assignment.destructuring.scope create mode 100644 data/fixtures/scopes/javascript.core/name/name.constant.scope create mode 100644 data/fixtures/scopes/javascript.core/name/name.variable.destructuring.scope create mode 100644 data/fixtures/scopes/javascript.core/name/name.variable.initialized.scope create mode 100644 data/fixtures/scopes/javascript.core/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/javascript.core/statement/statement.assignment.destructuring.scope create mode 100644 data/fixtures/scopes/javascript.core/statement/statement.variable.destructuring.scope create mode 100644 data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope create mode 100644 data/fixtures/scopes/javascript.core/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/javascript.core/value/value.constant.scope create mode 100644 data/fixtures/scopes/javascript.core/value/value.variable.destructuring.scope create mode 100644 data/fixtures/scopes/typescript.core/name/name.constant.scope rename data/fixtures/scopes/typescript.core/type/{type.variable2.scope => type.constant.scope} (100%) create mode 100644 data/fixtures/scopes/typescript.core/type/type.variable.initialized.scope rename data/fixtures/scopes/typescript.core/type/{type.variable.scope => type.variable.uninitialized.scope} (100%) diff --git a/data/fixtures/scopes/javascript.core/name/name.assignment.destructuring.scope b/data/fixtures/scopes/javascript.core/name/name.assignment.destructuring.scope new file mode 100644 index 0000000000..bc19a63fe4 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.assignment.destructuring.scope @@ -0,0 +1,20 @@ +({ foo, bar } = baz); +--- + +[Content] = 0:1-0:13 + >------------< +0| ({ foo, bar } = baz); + +[Removal] = 0:1-0:16 + >---------------< +0| ({ foo, bar } = baz); + +[Trailing delimiter] = 0:13-0:16 + >---< +0| ({ foo, bar } = baz); + +[Domain] = 0:1-0:19 + >------------------< +0| ({ foo, bar } = baz); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.constant.scope b/data/fixtures/scopes/javascript.core/name/name.constant.scope new file mode 100644 index 0000000000..cd15b48a5a --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.constant.scope @@ -0,0 +1,24 @@ +const foo = 0; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo = 0; + +[Removal] = 0:0-0:12 + >------------< +0| const foo = 0; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo = 0; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = 0; + +[Domain] = 0:0-0:14 + >--------------< +0| const foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.variable.destructuring.scope b/data/fixtures/scopes/javascript.core/name/name.variable.destructuring.scope new file mode 100644 index 0000000000..b17d1857df --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.variable.destructuring.scope @@ -0,0 +1,24 @@ +const {foo, bar} = baz; +--- + +[Content] = 0:6-0:16 + >----------< +0| const {foo, bar} = baz; + +[Removal] = 0:0-0:19 + >-------------------< +0| const {foo, bar} = baz; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const {foo, bar} = baz; + +[Trailing delimiter] = 0:16-0:17 + >-< +0| const {foo, bar} = baz; + +[Domain] = 0:0-0:23 + >-----------------------< +0| const {foo, bar} = baz; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.variable.initialized.scope b/data/fixtures/scopes/javascript.core/name/name.variable.initialized.scope new file mode 100644 index 0000000000..b29e4d221e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.variable.initialized.scope @@ -0,0 +1,24 @@ +let foo = 0; +--- + +[Content] = 0:4-0:7 + >---< +0| let foo = 0; + +[Removal] = 0:0-0:10 + >----------< +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/javascript.core/name/name.variable.uninitialized.scope b/data/fixtures/scopes/javascript.core/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..40f480ded1 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +let foo; +--- + +[Content] = 0:4-0:7 + >---< +0| let foo; + +[Removal] = 0:0-0:7 + >-------< +0| let foo; + +[Leading delimiter] = 0:3-0:4 + >-< +0| let foo; + +[Domain] = 0:0-0:8 + >--------< +0| let foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/statement/statement.assignment.destructuring.scope b/data/fixtures/scopes/javascript.core/statement/statement.assignment.destructuring.scope new file mode 100644 index 0000000000..3eea24590e --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.assignment.destructuring.scope @@ -0,0 +1,10 @@ +({ foo, bar } = baz); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| ({ foo, bar } = baz); + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.variable.destructuring.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable.destructuring.scope new file mode 100644 index 0000000000..0724a8ee09 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.variable.destructuring.scope @@ -0,0 +1,10 @@ +const {foo, bar} = baz; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:23 + >-----------------------< +0| const {foo, bar} = baz; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope new file mode 100644 index 0000000000..9ec6744100 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope @@ -0,0 +1,10 @@ +const foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| const foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..a14d088ca6 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +let foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| let foo; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/value/value.constant.scope b/data/fixtures/scopes/javascript.core/value/value.constant.scope new file mode 100644 index 0000000000..b52ad1e5c6 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value/value.constant.scope @@ -0,0 +1,20 @@ +const foo = 0; +--- + +[Content] = 0:12-0:13 + >-< +0| const foo = 0; + +[Removal] = 0:9-0:13 + >----< +0| const foo = 0; + +[Leading delimiter] = 0:9-0:12 + >---< +0| const foo = 0; + +[Domain] = 0:0-0:14 + >--------------< +0| const foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/value/value.variable.destructuring.scope b/data/fixtures/scopes/javascript.core/value/value.variable.destructuring.scope new file mode 100644 index 0000000000..9b09d6c108 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value/value.variable.destructuring.scope @@ -0,0 +1,20 @@ +const {foo, bar} = baz; +--- + +[Content] = 0:19-0:22 + >---< +0| const {foo, bar} = baz; + +[Removal] = 0:16-0:22 + >------< +0| const {foo, bar} = baz; + +[Leading delimiter] = 0:16-0:19 + >---< +0| const {foo, bar} = baz; + +[Domain] = 0:0-0:23 + >-----------------------< +0| const {foo, bar} = baz; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/value/value.variable.scope b/data/fixtures/scopes/javascript.core/value/value.variable.scope index b52ad1e5c6..f8b68f4784 100644 --- a/data/fixtures/scopes/javascript.core/value/value.variable.scope +++ b/data/fixtures/scopes/javascript.core/value/value.variable.scope @@ -1,20 +1,20 @@ -const foo = 0; +let foo = 0; --- -[Content] = 0:12-0:13 - >-< -0| const foo = 0; +[Content] = 0:10-0:11 + >-< +0| let foo = 0; -[Removal] = 0:9-0:13 - >----< -0| const foo = 0; +[Removal] = 0:7-0:11 + >----< +0| let foo = 0; -[Leading delimiter] = 0:9-0:12 - >---< -0| const foo = 0; +[Leading delimiter] = 0:7-0:10 + >---< +0| let foo = 0; -[Domain] = 0:0-0:14 - >--------------< -0| const foo = 0; +[Domain] = 0:0-0:12 + >------------< +0| let foo = 0; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.constant.scope b/data/fixtures/scopes/typescript.core/name/name.constant.scope new file mode 100644 index 0000000000..93f40fc7af --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.constant.scope @@ -0,0 +1,20 @@ +const foo: number = 0; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo: number = 0; + +[Removal] = 0:0-0:20 + >--------------------< +0| const foo: number = 0; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo: number = 0; + +[Domain] = 0:0-0:22 + >----------------------< +0| const foo: number = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope b/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope index 39cc72eef2..7139b87465 100644 --- a/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/typescript.core/name/name.variable.initialized.scope @@ -1,24 +1,20 @@ -const foo: number = 0; +let foo: number = 0; --- -[Content] = 0:12-0:15 - >---< -0| export type Foo = Bar; +[Content] = 0:4-0:7 + >---< +0| let foo: number = 0; -[Removal] = 0:12-0:16 - >----< -0| export type Foo = Bar; +[Removal] = 0:0-0:18 + >------------------< +0| let foo: number = 0; -[Leading delimiter] = 0:11-0:12 - >-< -0| export type Foo = Bar; +[Leading delimiter] = 0:3-0:4 + >-< +0| let foo: number = 0; -[Trailing delimiter] = 0:15-0:16 - >-< -0| export type Foo = Bar; - -[Domain] = 0:0-0:27 - >---------------------------< -0| export type Foo = Bar; +[Domain] = 0:0-0:20 + >--------------------< +0| let foo: number = 0; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope b/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope index d07a2ba9cc..5fa591115e 100644 --- a/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope @@ -1,24 +1,20 @@ let foo: number; --- -[Content] = 0:12-0:15 - >---< -0| export type Foo = Bar; +[Content] = 0:4-0:7 + >---< +0| let foo: number; -[Removal] = 0:12-0:16 - >----< -0| export type Foo = Bar; +[Removal] = 0:0-0:7 + >-------< +0| let foo: number; -[Leading delimiter] = 0:11-0:12 - >-< -0| export type Foo = Bar; +[Leading delimiter] = 0:3-0:4 + >-< +0| let foo: number; -[Trailing delimiter] = 0:15-0:16 - >-< -0| export type Foo = Bar; - -[Domain] = 0:0-0:27 - >---------------------------< -0| export type Foo = Bar; +[Domain] = 0:0-0:16 + >----------------< +0| let foo: number; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.variable2.scope b/data/fixtures/scopes/typescript.core/type/type.constant.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/type/type.variable2.scope rename to data/fixtures/scopes/typescript.core/type/type.constant.scope diff --git a/data/fixtures/scopes/typescript.core/type/type.variable.initialized.scope b/data/fixtures/scopes/typescript.core/type/type.variable.initialized.scope new file mode 100644 index 0000000000..42ce292103 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type/type.variable.initialized.scope @@ -0,0 +1,24 @@ +let foo: number = 0; +--- + +[Content] = 0:9-0:15 + >------< +0| let foo: number = 0; + +[Removal] = 0:7-0:15 + >--------< +0| let foo: number = 0; + +[Leading delimiter] = 0:8-0:9 + >-< +0| let foo: number = 0; + +[Trailing delimiter] = 0:15-0:16 + >-< +0| let foo: number = 0; + +[Domain] = 0:0-0:20 + >--------------------< +0| let foo: number = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.variable.scope b/data/fixtures/scopes/typescript.core/type/type.variable.uninitialized.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/type/type.variable.scope rename to data/fixtures/scopes/typescript.core/type/type.variable.uninitialized.scope From d84b38dae3353d5c1d36e1df05715a3db363e765 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:02:39 +0100 Subject: [PATCH 05/25] kotlin --- .../java/statement/statement.constant.scope | 10 ++++++++ .../scopes/kotlin/name/name.constant.scope | 24 +++++++++++++++++++ .../name/name.variable.destructuring.scope | 24 +++++++++++++++++++ .../name/name.variable.initialized.scope | 24 +++++++++++++++++++ .../name/name.variable.uninitialized.scope | 20 ++++++++++++++++ .../kotlin/statement/statement.constant.scope | 10 ++++++++ .../statement.variable.destructuring.scope | 10 ++++++++ .../statement.variable.initialized.scope | 10 ++++++++ .../statement.variable.uninitialized.scope} | 4 ++-- .../scopes/kotlin/type/type.constant.scope | 20 ++++++++++++++++ .../type/type.variable.initialized.scope | 20 ++++++++++++++++ .../type/type.variable.initialized2.scope | 20 ++++++++++++++++ .../type/type.variable.uninitialized.scope | 20 ++++++++++++++++ .../type/type.variable.uninitialized2.scope | 20 ++++++++++++++++ .../type/type.variable.uninitialized3.scope | 20 ++++++++++++++++ .../scopes/kotlin/value/value.constant.scope | 20 ++++++++++++++++ .../value/value.variable.destructuring.scope | 20 ++++++++++++++++ 17 files changed, 294 insertions(+), 2 deletions(-) create mode 100644 data/fixtures/scopes/java/statement/statement.constant.scope create mode 100644 data/fixtures/scopes/kotlin/name/name.constant.scope create mode 100644 data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope create mode 100644 data/fixtures/scopes/kotlin/name/name.variable.initialized.scope create mode 100644 data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/kotlin/statement/statement.constant.scope create mode 100644 data/fixtures/scopes/kotlin/statement/statement.variable.destructuring.scope create mode 100644 data/fixtures/scopes/kotlin/statement/statement.variable.initialized.scope rename data/fixtures/scopes/{java/statement/statementstatement.constant.scope => kotlin/statement/statement.variable.uninitialized.scope} (73%) create mode 100644 data/fixtures/scopes/kotlin/type/type.constant.scope create mode 100644 data/fixtures/scopes/kotlin/type/type.variable.initialized.scope create mode 100644 data/fixtures/scopes/kotlin/type/type.variable.initialized2.scope create mode 100644 data/fixtures/scopes/kotlin/type/type.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/kotlin/type/type.variable.uninitialized2.scope create mode 100644 data/fixtures/scopes/kotlin/type/type.variable.uninitialized3.scope create mode 100644 data/fixtures/scopes/kotlin/value/value.constant.scope create mode 100644 data/fixtures/scopes/kotlin/value/value.variable.destructuring.scope diff --git a/data/fixtures/scopes/java/statement/statement.constant.scope b/data/fixtures/scopes/java/statement/statement.constant.scope new file mode 100644 index 0000000000..a87fe2e7f7 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.constant.scope @@ -0,0 +1,10 @@ +final int foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| final int foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/name/name.constant.scope b/data/fixtures/scopes/kotlin/name/name.constant.scope new file mode 100644 index 0000000000..608e22c538 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.constant.scope @@ -0,0 +1,24 @@ +val foo = 0 +--- + +[Content] = 0:4-0:7 + >---< +0| val foo = 0 + +[Removal] = 0:4-0:8 + >----< +0| val foo = 0 + +[Leading delimiter] = 0:3-0:4 + >-< +0| val foo = 0 + +[Trailing delimiter] = 0:7-0:8 + >-< +0| val foo = 0 + +[Domain] = 0:0-0:11 + >-----------< +0| val foo = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope b/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope new file mode 100644 index 0000000000..41c7420ace --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope @@ -0,0 +1,24 @@ +var (foo, bar) = baz +--- + +[Content] = 0:4-0:14 + >----------< +0| var (foo, bar) = baz + +[Removal] = 0:4-0:15 + >-----------< +0| var (foo, bar) = baz + +[Leading delimiter] = 0:3-0:4 + >-< +0| var (foo, bar) = baz + +[Trailing delimiter] = 0:14-0:15 + >-< +0| var (foo, bar) = baz + +[Domain] = 0:0-0:20 + >--------------------< +0| var (foo, bar) = baz + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope b/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope new file mode 100644 index 0000000000..1cd9475d1d --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope @@ -0,0 +1,24 @@ +var foo = 0 +--- + +[Content] = 0:4-0:7 + >---< +0| var foo = 0 + +[Removal] = 0:4-0:8 + >----< +0| var foo = 0 + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo = 0 + +[Trailing delimiter] = 0:7-0:8 + >-< +0| var foo = 0 + +[Domain] = 0:0-0:11 + >-----------< +0| var foo = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope b/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..aadb078077 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +var foo: Int +--- + +[Content] = 0:4-0:7 + >---< +0| var foo: Int + +[Removal] = 0:3-0:7 + >----< +0| var foo: Int + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo: Int + +[Domain] = 0:0-0:12 + >------------< +0| var foo: Int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/statement/statement.constant.scope b/data/fixtures/scopes/kotlin/statement/statement.constant.scope new file mode 100644 index 0000000000..3e53923b5e --- /dev/null +++ b/data/fixtures/scopes/kotlin/statement/statement.constant.scope @@ -0,0 +1,10 @@ +val foo = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| val foo = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/statement/statement.variable.destructuring.scope b/data/fixtures/scopes/kotlin/statement/statement.variable.destructuring.scope new file mode 100644 index 0000000000..5631016198 --- /dev/null +++ b/data/fixtures/scopes/kotlin/statement/statement.variable.destructuring.scope @@ -0,0 +1,10 @@ +val (foo, bar) = baz +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:20 + >--------------------< +0| val (foo, bar) = baz + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/statement/statement.variable.initialized.scope b/data/fixtures/scopes/kotlin/statement/statement.variable.initialized.scope new file mode 100644 index 0000000000..4934548475 --- /dev/null +++ b/data/fixtures/scopes/kotlin/statement/statement.variable.initialized.scope @@ -0,0 +1,10 @@ +var foo = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| var foo = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement/statementstatement.constant.scope b/data/fixtures/scopes/kotlin/statement/statement.variable.uninitialized.scope similarity index 73% rename from data/fixtures/scopes/java/statement/statementstatement.constant.scope rename to data/fixtures/scopes/kotlin/statement/statement.variable.uninitialized.scope index 5914aa32e2..0c4f8800bd 100644 --- a/data/fixtures/scopes/java/statement/statementstatement.constant.scope +++ b/data/fixtures/scopes/kotlin/statement/statement.variable.uninitialized.scope @@ -1,10 +1,10 @@ -final int foo = 0; +var foo: Int --- [Content] = [Removal] = [Domain] = 0:0-0:12 >------------< -0| int foo = 0; +0| var foo: Int [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/type/type.constant.scope b/data/fixtures/scopes/kotlin/type/type.constant.scope new file mode 100644 index 0000000000..ded7ac42ef --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.constant.scope @@ -0,0 +1,20 @@ +val foo: Int = 0 +--- + +[Content] = 0:9-0:12 + >---< +0| val foo: Int = 0 + +[Removal] = 0:7-0:12 + >-----< +0| val foo: Int = 0 + +[Leading delimiter] = 0:7-0:9 + >--< +0| val foo: Int = 0 + +[Domain] = 0:0-0:16 + >----------------< +0| val foo: Int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable.initialized.scope b/data/fixtures/scopes/kotlin/type/type.variable.initialized.scope new file mode 100644 index 0000000000..28043523ca --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.variable.initialized.scope @@ -0,0 +1,20 @@ +var foo: Int = 0 +--- + +[Content] = 0:9-0:12 + >---< +0| var foo: Int = 0 + +[Removal] = 0:7-0:12 + >-----< +0| var foo: Int = 0 + +[Leading delimiter] = 0:7-0:9 + >--< +0| var foo: Int = 0 + +[Domain] = 0:0-0:16 + >----------------< +0| var foo: Int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable.initialized2.scope b/data/fixtures/scopes/kotlin/type/type.variable.initialized2.scope new file mode 100644 index 0000000000..3b1bf240f3 --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.variable.initialized2.scope @@ -0,0 +1,20 @@ +var foo: suspend () -> Int = { 0 } +--- + +[Content] = 0:9-0:26 + >-----------------< +0| var foo: suspend () -> Int = { 0 } + +[Removal] = 0:7-0:26 + >-------------------< +0| var foo: suspend () -> Int = { 0 } + +[Leading delimiter] = 0:7-0:9 + >--< +0| var foo: suspend () -> Int = { 0 } + +[Domain] = 0:0-0:34 + >----------------------------------< +0| var foo: suspend () -> Int = { 0 } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable.uninitialized.scope b/data/fixtures/scopes/kotlin/type/type.variable.uninitialized.scope new file mode 100644 index 0000000000..99f31b1b07 --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.variable.uninitialized.scope @@ -0,0 +1,20 @@ +var foo: Int +--- + +[Content] = 0:9-0:12 + >---< +0| var foo: Int + +[Removal] = 0:7-0:12 + >-----< +0| var foo: Int + +[Leading delimiter] = 0:7-0:9 + >--< +0| var foo: Int + +[Domain] = 0:0-0:12 + >------------< +0| var foo: Int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable.uninitialized2.scope b/data/fixtures/scopes/kotlin/type/type.variable.uninitialized2.scope new file mode 100644 index 0000000000..5e61175fa6 --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.variable.uninitialized2.scope @@ -0,0 +1,20 @@ +var foo: @Bar Int +--- + +[Content] = 0:9-0:17 + >--------< +0| var foo: @Bar Int + +[Removal] = 0:7-0:17 + >----------< +0| var foo: @Bar Int + +[Leading delimiter] = 0:7-0:9 + >--< +0| var foo: @Bar Int + +[Domain] = 0:0-0:17 + >-----------------< +0| var foo: @Bar Int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.variable.uninitialized3.scope b/data/fixtures/scopes/kotlin/type/type.variable.uninitialized3.scope new file mode 100644 index 0000000000..63b766ae0c --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.variable.uninitialized3.scope @@ -0,0 +1,20 @@ +var foo: suspend () -> Int +--- + +[Content] = 0:9-0:26 + >-----------------< +0| var foo: suspend () -> Int + +[Removal] = 0:7-0:26 + >-------------------< +0| var foo: suspend () -> Int + +[Leading delimiter] = 0:7-0:9 + >--< +0| var foo: suspend () -> Int + +[Domain] = 0:0-0:26 + >--------------------------< +0| var foo: suspend () -> Int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/value/value.constant.scope b/data/fixtures/scopes/kotlin/value/value.constant.scope new file mode 100644 index 0000000000..957dcc3e51 --- /dev/null +++ b/data/fixtures/scopes/kotlin/value/value.constant.scope @@ -0,0 +1,20 @@ +val foo = 0 +--- + +[Content] = 0:10-0:11 + >-< +0| val foo = 0 + +[Removal] = 0:7-0:11 + >----< +0| val foo = 0 + +[Leading delimiter] = 0:7-0:10 + >---< +0| val foo = 0 + +[Domain] = 0:0-0:11 + >-----------< +0| val foo = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/value/value.variable.destructuring.scope b/data/fixtures/scopes/kotlin/value/value.variable.destructuring.scope new file mode 100644 index 0000000000..8921d8a975 --- /dev/null +++ b/data/fixtures/scopes/kotlin/value/value.variable.destructuring.scope @@ -0,0 +1,20 @@ +val (foo, bar) = baz +--- + +[Content] = 0:17-0:20 + >---< +0| val (foo, bar) = baz + +[Removal] = 0:14-0:20 + >------< +0| val (foo, bar) = baz + +[Leading delimiter] = 0:14-0:17 + >---< +0| val (foo, bar) = baz + +[Domain] = 0:0-0:20 + >--------------------< +0| val (foo, bar) = baz + +[Insertion delimiter] = " " From d88fab8dcf749602e6c29625ff81c7678a874555 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:06:58 +0100 Subject: [PATCH 06/25] lua --- ...pe => name.assignment.destructuring.scope} | 0 ...cope => name.variable.destructuring.scope} | 0 ....scope => name.variable.initialized.scope} | 0 .../scopes/lua/name/name.variable2.scope | 24 ------------------- .../statement.assignment.destructuring.scope | 10 ++++++++ .../statement.variable.destructuring.scope | 10 ++++++++ ...e => statement.variable.initialized.scope} | 0 ...ope => value.variable.destructuring.scope} | 0 8 files changed, 20 insertions(+), 24 deletions(-) rename data/fixtures/scopes/lua/name/{name.assignment.pattern.scope => name.assignment.destructuring.scope} (100%) rename data/fixtures/scopes/lua/name/{name.variable.pattern.scope => name.variable.destructuring.scope} (100%) rename data/fixtures/scopes/lua/name/{name.variable.scope => name.variable.initialized.scope} (100%) delete mode 100644 data/fixtures/scopes/lua/name/name.variable2.scope create mode 100644 data/fixtures/scopes/lua/statement/statement.assignment.destructuring.scope create mode 100644 data/fixtures/scopes/lua/statement/statement.variable.destructuring.scope rename data/fixtures/scopes/lua/statement/{statement.variable.scope => statement.variable.initialized.scope} (100%) rename data/fixtures/scopes/lua/value/{value.variable.pattern.scope => value.variable.destructuring.scope} (100%) diff --git a/data/fixtures/scopes/lua/name/name.assignment.pattern.scope b/data/fixtures/scopes/lua/name/name.assignment.destructuring.scope similarity index 100% rename from data/fixtures/scopes/lua/name/name.assignment.pattern.scope rename to data/fixtures/scopes/lua/name/name.assignment.destructuring.scope diff --git a/data/fixtures/scopes/lua/name/name.variable.pattern.scope b/data/fixtures/scopes/lua/name/name.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/lua/name/name.variable.pattern.scope rename to data/fixtures/scopes/lua/name/name.variable.destructuring.scope diff --git a/data/fixtures/scopes/lua/name/name.variable.scope b/data/fixtures/scopes/lua/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/lua/name/name.variable.scope rename to data/fixtures/scopes/lua/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/lua/name/name.variable2.scope b/data/fixtures/scopes/lua/name/name.variable2.scope deleted file mode 100644 index a1a6bc3ae1..0000000000 --- a/data/fixtures/scopes/lua/name/name.variable2.scope +++ /dev/null @@ -1,24 +0,0 @@ -local foo, bar = 0, 1 ---- - -[Content] = 0:6-0:14 - >--------< -0| local foo, bar = 0, 1 - -[Removal] = 0:0-0:17 - >-----------------< -0| local foo, bar = 0, 1 - -[Leading delimiter] = 0:5-0:6 - >-< -0| local foo, bar = 0, 1 - -[Trailing delimiter] = 0:14-0:15 - >-< -0| local foo, bar = 0, 1 - -[Domain] = 0:0-0:21 - >---------------------< -0| local foo, bar = 0, 1 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/statement/statement.assignment.destructuring.scope b/data/fixtures/scopes/lua/statement/statement.assignment.destructuring.scope new file mode 100644 index 0000000000..9b330a1226 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.assignment.destructuring.scope @@ -0,0 +1,10 @@ +foo, bar = baz +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| foo, bar = baz + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.variable.destructuring.scope b/data/fixtures/scopes/lua/statement/statement.variable.destructuring.scope new file mode 100644 index 0000000000..6fa54a49fc --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.variable.destructuring.scope @@ -0,0 +1,10 @@ +local foo, bar = baz +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:20 + >--------------------< +0| local foo, bar = baz + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.variable.scope b/data/fixtures/scopes/lua/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/lua/statement/statement.variable.scope rename to data/fixtures/scopes/lua/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/lua/value/value.variable.pattern.scope b/data/fixtures/scopes/lua/value/value.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/lua/value/value.variable.pattern.scope rename to data/fixtures/scopes/lua/value/value.variable.destructuring.scope From 958912e36fcdc4bacfe0a5e64facf4d4ff1bf703 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:09:18 +0100 Subject: [PATCH 07/25] php and properties --- ...iable.scope => name.variable.initialized.scope} | 0 ...iable.scope => name.variable.initialized.scope} | 14 +++++++------- ...le2.scope => name.variable.uninitialized.scope} | 14 +++++++------- ....scope => statement.variable.initialized.scope} | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) rename data/fixtures/scopes/php/name/{name.variable.scope => name.variable.initialized.scope} (100%) rename data/fixtures/scopes/properties/{name.variable.scope => name.variable.initialized.scope} (59%) rename data/fixtures/scopes/properties/{name.variable2.scope => name.variable.uninitialized.scope} (57%) rename data/fixtures/scopes/properties/{statement.variable.scope => statement.variable.initialized.scope} (51%) diff --git a/data/fixtures/scopes/php/name/name.variable.scope b/data/fixtures/scopes/php/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/php/name/name.variable.scope rename to data/fixtures/scopes/php/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/properties/name.variable.scope b/data/fixtures/scopes/properties/name.variable.initialized.scope similarity index 59% rename from data/fixtures/scopes/properties/name.variable.scope rename to data/fixtures/scopes/properties/name.variable.initialized.scope index 5f9cb8fbe1..7a03d93749 100644 --- a/data/fixtures/scopes/properties/name.variable.scope +++ b/data/fixtures/scopes/properties/name.variable.initialized.scope @@ -1,20 +1,20 @@ -foo = bar +foo = 0 --- [Content] = 0:0-0:3 >---< -0| foo = bar +0| foo = 0 [Removal] = 0:0-0:6 >------< -0| foo = bar +0| foo = 0 [Trailing delimiter] = 0:3-0:6 >---< -0| foo = bar +0| foo = 0 -[Domain] = 0:0-0:9 - >---------< -0| foo = bar +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/properties/name.variable2.scope b/data/fixtures/scopes/properties/name.variable.uninitialized.scope similarity index 57% rename from data/fixtures/scopes/properties/name.variable2.scope rename to data/fixtures/scopes/properties/name.variable.uninitialized.scope index 27942e0abe..a9bf1438ab 100644 --- a/data/fixtures/scopes/properties/name.variable2.scope +++ b/data/fixtures/scopes/properties/name.variable.uninitialized.scope @@ -1,20 +1,20 @@ -foo.bar=baz +foo.bar=0 --- [Content] = 0:0-0:7 >-------< -0| foo.bar=baz +0| foo.bar=0 [Removal] = 0:0-0:8 >--------< -0| foo.bar=baz +0| foo.bar=0 [Trailing delimiter] = 0:7-0:8 >-< -0| foo.bar=baz +0| foo.bar=0 -[Domain] = 0:0-0:11 - >-----------< -0| foo.bar=baz +[Domain] = 0:0-0:9 + >---------< +0| foo.bar=0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/properties/statement.variable.scope b/data/fixtures/scopes/properties/statement.variable.initialized.scope similarity index 51% rename from data/fixtures/scopes/properties/statement.variable.scope rename to data/fixtures/scopes/properties/statement.variable.initialized.scope index d70f2aa18e..acdb2b1498 100644 --- a/data/fixtures/scopes/properties/statement.variable.scope +++ b/data/fixtures/scopes/properties/statement.variable.initialized.scope @@ -1,10 +1,10 @@ -foo = bar +foo = 0 --- [Content] = [Removal] = -[Domain] = 0:0-0:9 - >---------< -0| foo = bar +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 [Insertion delimiter] = "\n" From 162092b236d9f7516ce42d079f8f7c2f235e4277 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:13:13 +0100 Subject: [PATCH 08/25] python --- ...pe => name.assignment.destructuring.scope} | 0 ...cope => name.variable.destructuring.scope} | 0 ....scope => name.variable.initialized.scope} | 0 .../statement.assignment.destructuring.scope | 10 ++++++++++ .../statement.variable.destructuring.scope | 10 ++++++++++ ...e => statement.variable.initialized.scope} | 0 ....scope => type.variable.initialized.scope} | 0 ...cope => type.variable.uninitialized.scope} | 0 ...ope => value.variable.destructuring.scope} | 0 .../scopes/python/value/value.variable2.scope | 20 +++++++++++++++++++ 10 files changed, 40 insertions(+) rename data/fixtures/scopes/python/name/{name.assignment.pattern.scope => name.assignment.destructuring.scope} (100%) rename data/fixtures/scopes/python/name/{name.variable.pattern.scope => name.variable.destructuring.scope} (100%) rename data/fixtures/scopes/python/name/{name.variable.scope => name.variable.initialized.scope} (100%) create mode 100644 data/fixtures/scopes/python/statement/statement.assignment.destructuring.scope create mode 100644 data/fixtures/scopes/python/statement/statement.variable.destructuring.scope rename data/fixtures/scopes/python/statement/{statement.variable.scope => statement.variable.initialized.scope} (100%) rename data/fixtures/scopes/python/type/{type.variable2.scope => type.variable.initialized.scope} (100%) rename data/fixtures/scopes/python/type/{type.variable.scope => type.variable.uninitialized.scope} (100%) rename data/fixtures/scopes/python/value/{value.variable.pattern.scope => value.variable.destructuring.scope} (100%) create mode 100644 data/fixtures/scopes/python/value/value.variable2.scope diff --git a/data/fixtures/scopes/python/name/name.assignment.pattern.scope b/data/fixtures/scopes/python/name/name.assignment.destructuring.scope similarity index 100% rename from data/fixtures/scopes/python/name/name.assignment.pattern.scope rename to data/fixtures/scopes/python/name/name.assignment.destructuring.scope diff --git a/data/fixtures/scopes/python/name/name.variable.pattern.scope b/data/fixtures/scopes/python/name/name.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/python/name/name.variable.pattern.scope rename to data/fixtures/scopes/python/name/name.variable.destructuring.scope diff --git a/data/fixtures/scopes/python/name/name.variable.scope b/data/fixtures/scopes/python/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/python/name/name.variable.scope rename to data/fixtures/scopes/python/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/python/statement/statement.assignment.destructuring.scope b/data/fixtures/scopes/python/statement/statement.assignment.destructuring.scope new file mode 100644 index 0000000000..1cbfbcfa67 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.assignment.destructuring.scope @@ -0,0 +1,10 @@ +foo, bar, = baz +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| foo, bar, = baz + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.variable.destructuring.scope b/data/fixtures/scopes/python/statement/statement.variable.destructuring.scope new file mode 100644 index 0000000000..9b330a1226 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.variable.destructuring.scope @@ -0,0 +1,10 @@ +foo, bar = baz +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| foo, bar = baz + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/python/statement/statement.variable.scope b/data/fixtures/scopes/python/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/python/statement/statement.variable.scope rename to data/fixtures/scopes/python/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/python/type/type.variable2.scope b/data/fixtures/scopes/python/type/type.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/python/type/type.variable2.scope rename to data/fixtures/scopes/python/type/type.variable.initialized.scope diff --git a/data/fixtures/scopes/python/type/type.variable.scope b/data/fixtures/scopes/python/type/type.variable.uninitialized.scope similarity index 100% rename from data/fixtures/scopes/python/type/type.variable.scope rename to data/fixtures/scopes/python/type/type.variable.uninitialized.scope diff --git a/data/fixtures/scopes/python/value/value.variable.pattern.scope b/data/fixtures/scopes/python/value/value.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/python/value/value.variable.pattern.scope rename to data/fixtures/scopes/python/value/value.variable.destructuring.scope diff --git a/data/fixtures/scopes/python/value/value.variable2.scope b/data/fixtures/scopes/python/value/value.variable2.scope new file mode 100644 index 0000000000..87b9000a7a --- /dev/null +++ b/data/fixtures/scopes/python/value/value.variable2.scope @@ -0,0 +1,20 @@ +foo: int = 0 +--- + +[Content] = 0:11-0:12 + >-< +0| foo: int = 0 + +[Removal] = 0:8-0:12 + >----< +0| foo: int = 0 + +[Leading delimiter] = 0:8-0:11 + >---< +0| foo: int = 0 + +[Domain] = 0:0-0:12 + >------------< +0| foo: int = 0 + +[Insertion delimiter] = " " From d9c006c11079d045dbe0f49464dfedb9fd09c17c Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:22:18 +0100 Subject: [PATCH 09/25] rust --- ....scope => name.variable.initialized.scope} | 0 ...pe => name.assignment.destructuring.scope} | 0 .../scopes/rust/name/name.constant.scope | 20 +++++++++++++++++++ ...cope => name.variable.destructuring.scope} | 0 ....scope => name.variable.initialized.scope} | 0 .../statement.assignment.destructuring.scope | 10 ++++++++++ .../rust/statement/statement.constant.scope | 10 ++++++++++ .../statement.variable.destructuring.scope | 10 ++++++++++ ...e => statement.variable.initialized.scope} | 0 .../scopes/rust/type/type.constant.scope | 20 +++++++++++++++++++ ....scope => type.variable.initialized.scope} | 0 .../type/type.variable.uninitialized.scope | 20 +++++++++++++++++++ .../scopes/rust/value/value.constant.scope | 20 +++++++++++++++++++ ...ope => value.variable.destructuring.scope} | 0 .../scopes/rust/value/value.variable2.scope | 20 +++++++++++++++++++ 15 files changed, 130 insertions(+) rename data/fixtures/scopes/r/{name.variable.scope => name.variable.initialized.scope} (100%) rename data/fixtures/scopes/rust/name/{name.assignment.pattern.scope => name.assignment.destructuring.scope} (100%) create mode 100644 data/fixtures/scopes/rust/name/name.constant.scope rename data/fixtures/scopes/rust/name/{name.variable.pattern.scope => name.variable.destructuring.scope} (100%) rename data/fixtures/scopes/rust/name/{name.variable.scope => name.variable.initialized.scope} (100%) create mode 100644 data/fixtures/scopes/rust/statement/statement.assignment.destructuring.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.constant.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.variable.destructuring.scope rename data/fixtures/scopes/rust/statement/{statement.variable.scope => statement.variable.initialized.scope} (100%) create mode 100644 data/fixtures/scopes/rust/type/type.constant.scope rename data/fixtures/scopes/rust/type/{type.variable.scope => type.variable.initialized.scope} (100%) create mode 100644 data/fixtures/scopes/rust/type/type.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/rust/value/value.constant.scope rename data/fixtures/scopes/rust/value/{value.variable.pattern.scope => value.variable.destructuring.scope} (100%) create mode 100644 data/fixtures/scopes/rust/value/value.variable2.scope diff --git a/data/fixtures/scopes/r/name.variable.scope b/data/fixtures/scopes/r/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/r/name.variable.scope rename to data/fixtures/scopes/r/name.variable.initialized.scope diff --git a/data/fixtures/scopes/rust/name/name.assignment.pattern.scope b/data/fixtures/scopes/rust/name/name.assignment.destructuring.scope similarity index 100% rename from data/fixtures/scopes/rust/name/name.assignment.pattern.scope rename to data/fixtures/scopes/rust/name/name.assignment.destructuring.scope diff --git a/data/fixtures/scopes/rust/name/name.constant.scope b/data/fixtures/scopes/rust/name/name.constant.scope new file mode 100644 index 0000000000..22d3cdeefc --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.constant.scope @@ -0,0 +1,20 @@ +const foo: i32 = 0; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo: i32 = 0; + +[Removal] = 0:5-0:9 + >----< +0| const foo: i32 = 0; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo: i32 = 0; + +[Domain] = 0:0-0:19 + >-------------------< +0| const foo: i32 = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/name/name.variable.pattern.scope b/data/fixtures/scopes/rust/name/name.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/rust/name/name.variable.pattern.scope rename to data/fixtures/scopes/rust/name/name.variable.destructuring.scope diff --git a/data/fixtures/scopes/rust/name/name.variable.scope b/data/fixtures/scopes/rust/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/rust/name/name.variable.scope rename to data/fixtures/scopes/rust/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/rust/statement/statement.assignment.destructuring.scope b/data/fixtures/scopes/rust/statement/statement.assignment.destructuring.scope new file mode 100644 index 0000000000..bba4760f82 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.assignment.destructuring.scope @@ -0,0 +1,10 @@ +(foo, bar) = baz; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| (foo, bar) = baz; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.constant.scope b/data/fixtures/scopes/rust/statement/statement.constant.scope new file mode 100644 index 0000000000..a316117ba5 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.constant.scope @@ -0,0 +1,10 @@ +const foo: i32 = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| const foo: i32 = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.variable.destructuring.scope b/data/fixtures/scopes/rust/statement/statement.variable.destructuring.scope new file mode 100644 index 0000000000..bdd161f434 --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.variable.destructuring.scope @@ -0,0 +1,10 @@ +let Foo {bar, baz} = bongo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:27 + >---------------------------< +0| let Foo {bar, baz} = bongo; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/statement/statement.variable.scope b/data/fixtures/scopes/rust/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/rust/statement/statement.variable.scope rename to data/fixtures/scopes/rust/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/rust/type/type.constant.scope b/data/fixtures/scopes/rust/type/type.constant.scope new file mode 100644 index 0000000000..e0414a7734 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.constant.scope @@ -0,0 +1,20 @@ +const foo: i32 = 0; +--- + +[Content] = 0:11-0:14 + >---< +0| const foo: i32 = 0; + +[Removal] = 0:9-0:14 + >-----< +0| const foo: i32 = 0; + +[Leading delimiter] = 0:9-0:11 + >--< +0| const foo: i32 = 0; + +[Domain] = 0:0-0:19 + >-------------------< +0| const foo: i32 = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.variable.scope b/data/fixtures/scopes/rust/type/type.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/rust/type/type.variable.scope rename to data/fixtures/scopes/rust/type/type.variable.initialized.scope diff --git a/data/fixtures/scopes/rust/type/type.variable.uninitialized.scope b/data/fixtures/scopes/rust/type/type.variable.uninitialized.scope new file mode 100644 index 0000000000..a11737ed80 --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.variable.uninitialized.scope @@ -0,0 +1,20 @@ +let foo: i32; +--- + +[Content] = 0:9-0:12 + >---< +0| let foo: i32; + +[Removal] = 0:7-0:12 + >-----< +0| let foo: i32; + +[Leading delimiter] = 0:7-0:9 + >--< +0| let foo: i32; + +[Domain] = 0:0-0:13 + >-------------< +0| let foo: i32; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.constant.scope b/data/fixtures/scopes/rust/value/value.constant.scope new file mode 100644 index 0000000000..c7cf71a808 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.constant.scope @@ -0,0 +1,20 @@ +const foo: i32 = 0; +--- + +[Content] = 0:17-0:18 + >-< +0| const foo: i32 = 0; + +[Removal] = 0:14-0:18 + >----< +0| const foo: i32 = 0; + +[Leading delimiter] = 0:14-0:17 + >---< +0| const foo: i32 = 0; + +[Domain] = 0:0-0:19 + >-------------------< +0| const foo: i32 = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/value/value.variable.pattern.scope b/data/fixtures/scopes/rust/value/value.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/rust/value/value.variable.pattern.scope rename to data/fixtures/scopes/rust/value/value.variable.destructuring.scope diff --git a/data/fixtures/scopes/rust/value/value.variable2.scope b/data/fixtures/scopes/rust/value/value.variable2.scope new file mode 100644 index 0000000000..a16de95b57 --- /dev/null +++ b/data/fixtures/scopes/rust/value/value.variable2.scope @@ -0,0 +1,20 @@ +let foo: i32 = 0; +--- + +[Content] = 0:15-0:16 + >-< +0| let foo: i32 = 0; + +[Removal] = 0:12-0:16 + >----< +0| let foo: i32 = 0; + +[Leading delimiter] = 0:12-0:15 + >---< +0| let foo: i32 = 0; + +[Domain] = 0:0-0:17 + >-----------------< +0| let foo: i32 = 0; + +[Insertion delimiter] = " " From 8d58b92561f0ca2ab44875322819eff8830d8b69 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:27:24 +0100 Subject: [PATCH 10/25] scala --- ...me.variable2.scope => name.constant.scope} | 0 ...cope => name.variable.destructuring.scope} | 0 ....scope => name.variable.initialized.scope} | 0 ...riable2.scope => statement.constant.scope} | 0 .../statement.variable.destructuring.scope | 10 +++++++++ ...e => statement.variable.initialized.scope} | 0 ...pe.variable2.scope => type.constant.scope} | 0 ....scope => type.variable.initialized.scope} | 0 .../type/type.variable.uninitialized.scope | 20 +++++++++++++++++ .../scopes/scala/type/type.variable3.scope | 22 ------------------- ...e.variable2.scope => value.constant.scope} | 0 ...ope => value.variable.destructuring.scope} | 0 12 files changed, 30 insertions(+), 22 deletions(-) rename data/fixtures/scopes/scala/name/{name.variable2.scope => name.constant.scope} (100%) rename data/fixtures/scopes/scala/name/{name.variable.pattern.scope => name.variable.destructuring.scope} (100%) rename data/fixtures/scopes/scala/name/{name.variable.scope => name.variable.initialized.scope} (100%) rename data/fixtures/scopes/scala/statement/{statement.variable2.scope => statement.constant.scope} (100%) create mode 100644 data/fixtures/scopes/scala/statement/statement.variable.destructuring.scope rename data/fixtures/scopes/scala/statement/{statement.variable.scope => statement.variable.initialized.scope} (100%) rename data/fixtures/scopes/scala/type/{type.variable2.scope => type.constant.scope} (100%) rename data/fixtures/scopes/scala/type/{type.variable.scope => type.variable.initialized.scope} (100%) create mode 100644 data/fixtures/scopes/scala/type/type.variable.uninitialized.scope delete mode 100644 data/fixtures/scopes/scala/type/type.variable3.scope rename data/fixtures/scopes/scala/value/{value.variable2.scope => value.constant.scope} (100%) rename data/fixtures/scopes/scala/value/{value.variable.pattern.scope => value.variable.destructuring.scope} (100%) diff --git a/data/fixtures/scopes/scala/name/name.variable2.scope b/data/fixtures/scopes/scala/name/name.constant.scope similarity index 100% rename from data/fixtures/scopes/scala/name/name.variable2.scope rename to data/fixtures/scopes/scala/name/name.constant.scope diff --git a/data/fixtures/scopes/scala/name/name.variable.pattern.scope b/data/fixtures/scopes/scala/name/name.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/scala/name/name.variable.pattern.scope rename to data/fixtures/scopes/scala/name/name.variable.destructuring.scope diff --git a/data/fixtures/scopes/scala/name/name.variable.scope b/data/fixtures/scopes/scala/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/scala/name/name.variable.scope rename to data/fixtures/scopes/scala/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/scala/statement/statement.variable2.scope b/data/fixtures/scopes/scala/statement/statement.constant.scope similarity index 100% rename from data/fixtures/scopes/scala/statement/statement.variable2.scope rename to data/fixtures/scopes/scala/statement/statement.constant.scope diff --git a/data/fixtures/scopes/scala/statement/statement.variable.destructuring.scope b/data/fixtures/scopes/scala/statement/statement.variable.destructuring.scope new file mode 100644 index 0000000000..5631016198 --- /dev/null +++ b/data/fixtures/scopes/scala/statement/statement.variable.destructuring.scope @@ -0,0 +1,10 @@ +val (foo, bar) = baz +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:20 + >--------------------< +0| val (foo, bar) = baz + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/statement/statement.variable.scope b/data/fixtures/scopes/scala/statement/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/scala/statement/statement.variable.scope rename to data/fixtures/scopes/scala/statement/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/scala/type/type.variable2.scope b/data/fixtures/scopes/scala/type/type.constant.scope similarity index 100% rename from data/fixtures/scopes/scala/type/type.variable2.scope rename to data/fixtures/scopes/scala/type/type.constant.scope diff --git a/data/fixtures/scopes/scala/type/type.variable.scope b/data/fixtures/scopes/scala/type/type.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/scala/type/type.variable.scope rename to data/fixtures/scopes/scala/type/type.variable.initialized.scope diff --git a/data/fixtures/scopes/scala/type/type.variable.uninitialized.scope b/data/fixtures/scopes/scala/type/type.variable.uninitialized.scope new file mode 100644 index 0000000000..99f31b1b07 --- /dev/null +++ b/data/fixtures/scopes/scala/type/type.variable.uninitialized.scope @@ -0,0 +1,20 @@ +var foo: Int +--- + +[Content] = 0:9-0:12 + >---< +0| var foo: Int + +[Removal] = 0:7-0:12 + >-----< +0| var foo: Int + +[Leading delimiter] = 0:7-0:9 + >--< +0| var foo: Int + +[Domain] = 0:0-0:12 + >------------< +0| var foo: Int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/type/type.variable3.scope b/data/fixtures/scopes/scala/type/type.variable3.scope deleted file mode 100644 index 434e4aa5d5..0000000000 --- a/data/fixtures/scopes/scala/type/type.variable3.scope +++ /dev/null @@ -1,22 +0,0 @@ -foo match { - case foo: Foo => 0 -} ---- - -[Content] = 1:14-1:17 - >---< -1| case foo: Foo => 0 - -[Removal] = 1:12-1:17 - >-----< -1| case foo: Foo => 0 - -[Leading delimiter] = 1:12-1:14 - >--< -1| case foo: Foo => 0 - -[Domain] = 1:9-1:17 - >--------< -1| case foo: Foo => 0 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/value/value.variable2.scope b/data/fixtures/scopes/scala/value/value.constant.scope similarity index 100% rename from data/fixtures/scopes/scala/value/value.variable2.scope rename to data/fixtures/scopes/scala/value/value.constant.scope diff --git a/data/fixtures/scopes/scala/value/value.variable.pattern.scope b/data/fixtures/scopes/scala/value/value.variable.destructuring.scope similarity index 100% rename from data/fixtures/scopes/scala/value/value.variable.pattern.scope rename to data/fixtures/scopes/scala/value/value.variable.destructuring.scope From 7b1f419b3be04374ce508f687ce99e790618f4cf Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 12:32:26 +0100 Subject: [PATCH 11/25] talon --- .../{name.variable.scope => name.variable.initialized.scope} | 0 .../{name.variable2.scope => name.variable.initialized2.scope} | 0 ...tement.variable.scope => statement.variable.initialized.scope} | 0 ...ment.variable2.scope => statement.variable.initialized2.scope} | 0 .../name/{name.variable.scope => name.variable.initialized.scope} | 0 ...tement.variable.scope => statement.variable.initialized.scope} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename data/fixtures/scopes/talon-list/{name.variable.scope => name.variable.initialized.scope} (100%) rename data/fixtures/scopes/talon-list/{name.variable2.scope => name.variable.initialized2.scope} (100%) rename data/fixtures/scopes/talon-list/{statement.variable.scope => statement.variable.initialized.scope} (100%) rename data/fixtures/scopes/talon-list/{statement.variable2.scope => statement.variable.initialized2.scope} (100%) rename data/fixtures/scopes/talon/name/{name.variable.scope => name.variable.initialized.scope} (100%) rename data/fixtures/scopes/talon/{statement.variable.scope => statement.variable.initialized.scope} (100%) diff --git a/data/fixtures/scopes/talon-list/name.variable.scope b/data/fixtures/scopes/talon-list/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/talon-list/name.variable.scope rename to data/fixtures/scopes/talon-list/name.variable.initialized.scope diff --git a/data/fixtures/scopes/talon-list/name.variable2.scope b/data/fixtures/scopes/talon-list/name.variable.initialized2.scope similarity index 100% rename from data/fixtures/scopes/talon-list/name.variable2.scope rename to data/fixtures/scopes/talon-list/name.variable.initialized2.scope diff --git a/data/fixtures/scopes/talon-list/statement.variable.scope b/data/fixtures/scopes/talon-list/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/talon-list/statement.variable.scope rename to data/fixtures/scopes/talon-list/statement.variable.initialized.scope diff --git a/data/fixtures/scopes/talon-list/statement.variable2.scope b/data/fixtures/scopes/talon-list/statement.variable.initialized2.scope similarity index 100% rename from data/fixtures/scopes/talon-list/statement.variable2.scope rename to data/fixtures/scopes/talon-list/statement.variable.initialized2.scope diff --git a/data/fixtures/scopes/talon/name/name.variable.scope b/data/fixtures/scopes/talon/name/name.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/talon/name/name.variable.scope rename to data/fixtures/scopes/talon/name/name.variable.initialized.scope diff --git a/data/fixtures/scopes/talon/statement.variable.scope b/data/fixtures/scopes/talon/statement.variable.initialized.scope similarity index 100% rename from data/fixtures/scopes/talon/statement.variable.scope rename to data/fixtures/scopes/talon/statement.variable.initialized.scope From 6b78c4976955044203ba01bc4028c335d79a9ec7 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 14:03:23 +0100 Subject: [PATCH 12/25] lua --- .../scopes/c/value/value.constant.scope | 20 +++++ .../scopes/java/value/value.constant.scope | 20 +++++ .../scopes/java/value/value.variable.scope | 26 +++---- .../statement/statement.constant.scope | 10 +++ .../statement.variable.initialized.scope | 8 +- .../name/name.variable.uninitialized.scope | 17 +++++ .../statement.variable.uninitialized.scope | 10 +++ .../properties/key.mapPair.iteration.scope | 4 +- .../scopes/properties/key.mapPair.scope | 14 ++-- .../scopes/properties/key.mapPair2.scope | 22 +++--- .../properties/name.iteration.document.scope | 4 +- ...scope => name.variable.initialized2.scope} | 0 .../statement.iteration.document.scope | 4 +- .../properties/value.iteration.document.scope | 4 +- .../properties/value.mapPair.iteration.scope | 4 +- .../scopes/properties/value.mapPair.scope | 22 +++--- .../scopes/properties/value.variable.scope | 22 +++--- .../name/name.variable.uninitialized.scope | 13 ++++ .../statement.variable.uninitialized.scope | 10 +++ .../name/name.variable.uninitialized.scope | 20 +++++ .../statement.variable.uninitialized.scope | 10 +++ .../name/name.variable.uninitialized.scope | 20 +++++ .../statement.variable.uninitialized.scope | 10 +++ .../scopes/scala/value/value.variable2.scope | 20 +++++ packages/common/src/scopeSupportFacets/c.ts | 6 +- .../common/src/scopeSupportFacets/csharp.ts | 10 ++- packages/common/src/scopeSupportFacets/css.ts | 6 ++ .../common/src/scopeSupportFacets/html.ts | 6 ++ .../common/src/scopeSupportFacets/java.ts | 10 ++- .../src/scopeSupportFacets/javascript.ts | 8 +- .../common/src/scopeSupportFacets/json.ts | 6 ++ .../common/src/scopeSupportFacets/kotlin.ts | 15 ++-- .../common/src/scopeSupportFacets/latex.ts | 6 ++ packages/common/src/scopeSupportFacets/lua.ts | 10 ++- .../common/src/scopeSupportFacets/markdown.ts | 6 ++ packages/common/src/scopeSupportFacets/php.ts | 15 +++- .../src/scopeSupportFacets/properties.ts | 12 ++- .../common/src/scopeSupportFacets/python.ts | 20 +++-- packages/common/src/scopeSupportFacets/r.ts | 7 +- .../common/src/scopeSupportFacets/rust.ts | 14 +++- .../common/src/scopeSupportFacets/scala.ts | 12 ++- packages/common/src/scopeSupportFacets/scm.ts | 6 ++ .../common/src/scopeSupportFacets/talon.ts | 12 ++- .../src/scopeSupportFacets/talonList.ts | 10 ++- .../src/scopeSupportFacets/typescript.ts | 1 + packages/common/src/scopeSupportFacets/xml.ts | 6 ++ .../common/src/scopeSupportFacets/yaml.ts | 10 ++- queries/lua.scm | 73 +++++++------------ queries/scala.scm | 1 + 49 files changed, 448 insertions(+), 154 deletions(-) create mode 100644 data/fixtures/scopes/c/value/value.constant.scope create mode 100644 data/fixtures/scopes/java/value/value.constant.scope create mode 100644 data/fixtures/scopes/javascript.core/statement/statement.constant.scope create mode 100644 data/fixtures/scopes/lua/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/lua/statement/statement.variable.uninitialized.scope rename data/fixtures/scopes/properties/{name.variable.uninitialized.scope => name.variable.initialized2.scope} (100%) create mode 100644 data/fixtures/scopes/python/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/python/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/rust/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/rust/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/scala/name/name.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/scala/statement/statement.variable.uninitialized.scope create mode 100644 data/fixtures/scopes/scala/value/value.variable2.scope diff --git a/data/fixtures/scopes/c/value/value.constant.scope b/data/fixtures/scopes/c/value/value.constant.scope new file mode 100644 index 0000000000..ef4c0a7e95 --- /dev/null +++ b/data/fixtures/scopes/c/value/value.constant.scope @@ -0,0 +1,20 @@ +const int foo = 0; +--- + +[Content] = 0:16-0:17 + >-< +0| const int foo = 0; + +[Removal] = 0:13-0:17 + >----< +0| const int foo = 0; + +[Leading delimiter] = 0:13-0:16 + >---< +0| const int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value/value.constant.scope b/data/fixtures/scopes/java/value/value.constant.scope new file mode 100644 index 0000000000..0500050c25 --- /dev/null +++ b/data/fixtures/scopes/java/value/value.constant.scope @@ -0,0 +1,20 @@ +final int foo = 0; +--- + +[Content] = 0:16-0:17 + >-< +0| final int foo = 0; + +[Removal] = 0:13-0:17 + >----< +0| final int foo = 0; + +[Leading delimiter] = 0:13-0:16 + >---< +0| final int foo = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| final int foo = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/value/value.variable.scope b/data/fixtures/scopes/java/value/value.variable.scope index a614198096..e9f99d43e1 100644 --- a/data/fixtures/scopes/java/value/value.variable.scope +++ b/data/fixtures/scopes/java/value/value.variable.scope @@ -1,20 +1,20 @@ -foo = 0; +int foo = 0; --- -[Content] = 0:6-0:7 - >-< -0| foo = 0; +[Content] = 0:10-0:11 + >-< +0| int foo = 0; -[Removal] = 0:3-0:7 - >----< -0| foo = 0; +[Removal] = 0:7-0:11 + >----< +0| int foo = 0; -[Leading delimiter] = 0:3-0:6 - >---< -0| foo = 0; +[Leading delimiter] = 0:7-0:10 + >---< +0| int foo = 0; -[Domain] = 0:0-0:8 - >--------< -0| foo = 0; +[Domain] = 0:0-0:12 + >------------< +0| int foo = 0; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/statement/statement.constant.scope b/data/fixtures/scopes/javascript.core/statement/statement.constant.scope new file mode 100644 index 0000000000..9ec6744100 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement/statement.constant.scope @@ -0,0 +1,10 @@ +const foo = 0; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| const foo = 0; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope b/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope index 9ec6744100..cebc33100e 100644 --- a/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.variable.initialized.scope @@ -1,10 +1,10 @@ -const foo = 0; +let foo = 0; --- [Content] = [Removal] = -[Domain] = 0:0-0:14 - >--------------< -0| const foo = 0; +[Domain] = 0:0-0:12 + >------------< +0| let foo = 0; [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/name/name.variable.uninitialized.scope b/data/fixtures/scopes/lua/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..3770d083d1 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.variable.uninitialized.scope @@ -0,0 +1,17 @@ +local foo +--- + +[Content] = 0:6-0:9 + >---< +0| local foo + +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| local foo + +[Leading delimiter] = 0:5-0:6 + >-< +0| local foo + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/lua/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..93e3fa1290 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +local foo +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| local foo + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/properties/key.mapPair.iteration.scope b/data/fixtures/scopes/properties/key.mapPair.iteration.scope index 379107f231..b87a9062f4 100644 --- a/data/fixtures/scopes/properties/key.mapPair.iteration.scope +++ b/data/fixtures/scopes/properties/key.mapPair.iteration.scope @@ -1,5 +1,5 @@ -foo=bar +foo=0 --- @@ -7,6 +7,6 @@ foo=bar [Domain] = 0:0-2:0 > 0| -1| foo=bar +1| foo=0 2| < diff --git a/data/fixtures/scopes/properties/key.mapPair.scope b/data/fixtures/scopes/properties/key.mapPair.scope index 5f9cb8fbe1..7a03d93749 100644 --- a/data/fixtures/scopes/properties/key.mapPair.scope +++ b/data/fixtures/scopes/properties/key.mapPair.scope @@ -1,20 +1,20 @@ -foo = bar +foo = 0 --- [Content] = 0:0-0:3 >---< -0| foo = bar +0| foo = 0 [Removal] = 0:0-0:6 >------< -0| foo = bar +0| foo = 0 [Trailing delimiter] = 0:3-0:6 >---< -0| foo = bar +0| foo = 0 -[Domain] = 0:0-0:9 - >---------< -0| foo = bar +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/properties/key.mapPair2.scope b/data/fixtures/scopes/properties/key.mapPair2.scope index a71c1ed9d4..a9bf1438ab 100644 --- a/data/fixtures/scopes/properties/key.mapPair2.scope +++ b/data/fixtures/scopes/properties/key.mapPair2.scope @@ -1,20 +1,20 @@ -foo.bar = baz +foo.bar=0 --- [Content] = 0:0-0:7 >-------< -0| foo.bar = baz +0| foo.bar=0 -[Removal] = 0:0-0:10 - >----------< -0| foo.bar = baz +[Removal] = 0:0-0:8 + >--------< +0| foo.bar=0 -[Trailing delimiter] = 0:7-0:10 - >---< -0| foo.bar = baz +[Trailing delimiter] = 0:7-0:8 + >-< +0| foo.bar=0 -[Domain] = 0:0-0:13 - >-------------< -0| foo.bar = baz +[Domain] = 0:0-0:9 + >---------< +0| foo.bar=0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/properties/name.iteration.document.scope b/data/fixtures/scopes/properties/name.iteration.document.scope index 379107f231..b87a9062f4 100644 --- a/data/fixtures/scopes/properties/name.iteration.document.scope +++ b/data/fixtures/scopes/properties/name.iteration.document.scope @@ -1,5 +1,5 @@ -foo=bar +foo=0 --- @@ -7,6 +7,6 @@ foo=bar [Domain] = 0:0-2:0 > 0| -1| foo=bar +1| foo=0 2| < diff --git a/data/fixtures/scopes/properties/name.variable.uninitialized.scope b/data/fixtures/scopes/properties/name.variable.initialized2.scope similarity index 100% rename from data/fixtures/scopes/properties/name.variable.uninitialized.scope rename to data/fixtures/scopes/properties/name.variable.initialized2.scope diff --git a/data/fixtures/scopes/properties/statement.iteration.document.scope b/data/fixtures/scopes/properties/statement.iteration.document.scope index 379107f231..b87a9062f4 100644 --- a/data/fixtures/scopes/properties/statement.iteration.document.scope +++ b/data/fixtures/scopes/properties/statement.iteration.document.scope @@ -1,5 +1,5 @@ -foo=bar +foo=0 --- @@ -7,6 +7,6 @@ foo=bar [Domain] = 0:0-2:0 > 0| -1| foo=bar +1| foo=0 2| < diff --git a/data/fixtures/scopes/properties/value.iteration.document.scope b/data/fixtures/scopes/properties/value.iteration.document.scope index 379107f231..b87a9062f4 100644 --- a/data/fixtures/scopes/properties/value.iteration.document.scope +++ b/data/fixtures/scopes/properties/value.iteration.document.scope @@ -1,5 +1,5 @@ -foo=bar +foo=0 --- @@ -7,6 +7,6 @@ foo=bar [Domain] = 0:0-2:0 > 0| -1| foo=bar +1| foo=0 2| < diff --git a/data/fixtures/scopes/properties/value.mapPair.iteration.scope b/data/fixtures/scopes/properties/value.mapPair.iteration.scope index 379107f231..b87a9062f4 100644 --- a/data/fixtures/scopes/properties/value.mapPair.iteration.scope +++ b/data/fixtures/scopes/properties/value.mapPair.iteration.scope @@ -1,5 +1,5 @@ -foo=bar +foo=0 --- @@ -7,6 +7,6 @@ foo=bar [Domain] = 0:0-2:0 > 0| -1| foo=bar +1| foo=0 2| < diff --git a/data/fixtures/scopes/properties/value.mapPair.scope b/data/fixtures/scopes/properties/value.mapPair.scope index fbe8b66676..6e89de0927 100644 --- a/data/fixtures/scopes/properties/value.mapPair.scope +++ b/data/fixtures/scopes/properties/value.mapPair.scope @@ -1,20 +1,20 @@ -foo = bar +foo = 0 --- -[Content] = 0:6-0:9 - >---< -0| foo = bar +[Content] = 0:6-0:7 + >-< +0| foo = 0 -[Removal] = 0:3-0:9 - >------< -0| foo = bar +[Removal] = 0:3-0:7 + >----< +0| foo = 0 [Leading delimiter] = 0:3-0:6 >---< -0| foo = bar +0| foo = 0 -[Domain] = 0:0-0:9 - >---------< -0| foo = bar +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/properties/value.variable.scope b/data/fixtures/scopes/properties/value.variable.scope index fbe8b66676..6e89de0927 100644 --- a/data/fixtures/scopes/properties/value.variable.scope +++ b/data/fixtures/scopes/properties/value.variable.scope @@ -1,20 +1,20 @@ -foo = bar +foo = 0 --- -[Content] = 0:6-0:9 - >---< -0| foo = bar +[Content] = 0:6-0:7 + >-< +0| foo = 0 -[Removal] = 0:3-0:9 - >------< -0| foo = bar +[Removal] = 0:3-0:7 + >----< +0| foo = 0 [Leading delimiter] = 0:3-0:6 >---< -0| foo = bar +0| foo = 0 -[Domain] = 0:0-0:9 - >---------< -0| foo = bar +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.variable.uninitialized.scope b/data/fixtures/scopes/python/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..3a8dfd9fd0 --- /dev/null +++ b/data/fixtures/scopes/python/name/name.variable.uninitialized.scope @@ -0,0 +1,13 @@ +foo: int +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo: int + +[Domain] = 0:0-0:8 + >--------< +0| foo: int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/python/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..f19c75f073 --- /dev/null +++ b/data/fixtures/scopes/python/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +foo: int +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo: int + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope b/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..a023865b04 --- /dev/null +++ b/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +let foo: i32; +--- + +[Content] = 0:4-0:7 + >---< +0| let foo: i32; + +[Removal] = 0:3-0:7 + >----< +0| let foo: i32; + +[Leading delimiter] = 0:3-0:4 + >-< +0| let foo: i32; + +[Domain] = 0:0-0:13 + >-------------< +0| let foo: i32; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/rust/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..3943b4027c --- /dev/null +++ b/data/fixtures/scopes/rust/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +let foo: i32; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| let foo: i32; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope b/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope new file mode 100644 index 0000000000..aadb078077 --- /dev/null +++ b/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope @@ -0,0 +1,20 @@ +var foo: Int +--- + +[Content] = 0:4-0:7 + >---< +0| var foo: Int + +[Removal] = 0:3-0:7 + >----< +0| var foo: Int + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo: Int + +[Domain] = 0:0-0:12 + >------------< +0| var foo: Int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/statement/statement.variable.uninitialized.scope b/data/fixtures/scopes/scala/statement/statement.variable.uninitialized.scope new file mode 100644 index 0000000000..0c4f8800bd --- /dev/null +++ b/data/fixtures/scopes/scala/statement/statement.variable.uninitialized.scope @@ -0,0 +1,10 @@ +var foo: Int +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| var foo: Int + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/value/value.variable2.scope b/data/fixtures/scopes/scala/value/value.variable2.scope new file mode 100644 index 0000000000..4ef2ac039c --- /dev/null +++ b/data/fixtures/scopes/scala/value/value.variable2.scope @@ -0,0 +1,20 @@ +var foo: Int = 0 +--- + +[Content] = 0:15-0:16 + >-< +0| var foo: Int = 0 + +[Removal] = 0:12-0:16 + >----< +0| var foo: Int = 0 + +[Leading delimiter] = 0:12-0:15 + >---< +0| var foo: Int = 0 + +[Domain] = 0:0-0:16 + >----------------< +0| var foo: Int = 0 + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index f93282c3c1..cc7b4763cf 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -18,9 +18,10 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "statement.for": supported, "statement.while": supported, "statement.doWhile": supported, + "statement.assignment": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, "statement.return": supported, "statement.break": supported, "statement.continue": supported, @@ -91,6 +92,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "condition.switchCase.iteration": supported, "name.assignment": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.function": supported, @@ -106,6 +108,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.enum": supported, "value.assignment": supported, + "value.constant": supported, "value.variable": supported, "value.return": supported, "value.switch": supported, @@ -115,6 +118,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.enum": supported, "value.iteration.document": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.argument.formal": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index d5174eb089..e3c083efbb 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -58,7 +58,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": supported, "name.argument.formal": supported, "name.argument.catch": supported, - "name.assignment": supported, "name.class": supported, "name.interface": supported, "name.enum": supported, @@ -69,6 +68,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.assignment": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.iteration.block": supported, @@ -83,7 +84,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, "value.argument.formal": supported, - "value.assignment": supported, "value.field.class": supported, "value.field.enum": supported, "value.foreach": supported, @@ -91,6 +91,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.mapPair.iteration": supported, "value.return.lambda": supported, "value.return": supported, + "value.assignment": supported, + "value.constant": supported, "value.variable": supported, "value.yield": supported, "value.switch": supported, @@ -114,6 +116,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.typeArgument": supported, @@ -189,9 +192,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, + "statement.assignment": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, "statement.return": supported, "statement.yield": supported, "statement.break": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 904ae77868..b3120055aa 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -61,6 +61,12 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 9d25e2b573..4b7e9e230a 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -35,6 +35,12 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 9e7ad976b2..804a8201de 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -106,9 +106,10 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, + "statement.assignment": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, "statement.return": supported, "statement.yield": supported, "statement.break": supported, @@ -134,7 +135,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method": supported, "name.argument.formal.method.iteration": supported, "name.argument.catch": supported, - "name.assignment": supported, "name.class": supported, "name.interface": supported, "name.enum": supported, @@ -144,6 +144,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.field.enum": supported, "name.foreach": supported, "name.method": supported, + "name.assignment": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.iteration.document": supported, @@ -154,13 +156,14 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.resource": supported, "value.assignment": supported, + "value.constant": supported, + "value.variable": supported, "value.foreach": supported, "value.switch": supported, "value.field.class": supported, "value.return": supported, "value.yield": supported, "value.return.lambda": supported, - "value.variable": supported, "value.resource": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -175,6 +178,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.typeArgument": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 884699c5fd..8eadbc629f 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -34,9 +34,12 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, + "statement.assignment": supported, + "statement.assignment.destructuring": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, + "statement.variable.destructuring": supported, "statement.return": supported, "statement.yield": supported, "statement.break": supported, @@ -146,6 +149,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.assignment": supported, "name.assignment.destructuring": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.variable.destructuring": supported, @@ -170,6 +174,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.mapPair": supported, "value.mapPair.iteration": supported, "value.assignment": supported, + "value.constant": supported, "value.variable": supported, "value.variable.destructuring": supported, "value.foreach": supported, @@ -283,6 +288,7 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": notApplicable, "type.foreach": notApplicable, "type.return": notApplicable, + "type.constant": notApplicable, "type.variable.uninitialized": notApplicable, "type.variable.initialized": notApplicable, "type.typeArgument": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index ce89ef6f76..d902c05570 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -38,6 +38,12 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index 0cda0492cc..92303a2746 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -107,9 +107,11 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, + "statement.assignment": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, + "statement.variable.destructuring": supported, "statement.return": supported, "statement.break": supported, "statement.continue": supported, @@ -146,11 +148,11 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.assignment": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.variable.destructuring": supported, - "name.assignment": supported, - "name.assignment.destructuring": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.interface": supported, @@ -169,13 +171,14 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, "value.assignment": supported, + "value.constant": supported, + "value.variable": supported, + "value.variable.destructuring": supported, "value.foreach": supported, "value.switch": supported, "value.field.class": supported, "value.return": supported, "value.return.lambda": supported, - "value.variable": supported, - "value.variable.destructuring": supported, "value.typeAlias": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -194,6 +197,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.typeArgument": supported, @@ -304,4 +308,5 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "class.iteration.block": notApplicable, "type.cast": notApplicable, "statement.misc": notApplicable, + "name.assignment.destructuring": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index 4e7c3f046f..0e1730f574 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -49,6 +49,12 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index c1772c4f1c..8f63946ccc 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -105,9 +105,11 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "statement.doWhile": supported, "statement.for": supported, "statement.foreach": supported, + "statement.assignment": supported, + "statement.assignment.destructuring": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, + "statement.variable.destructuring": supported, "statement.return": supported, "statement.break": supported, "statement.iteration.document": supported, @@ -311,6 +313,12 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { notebookCell: notApplicable, "interior.cell": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Miscellaneous "statement.misc": notApplicable, pairDelimiter: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index c133a53258..348114403b 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -39,6 +39,12 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index 413d21aac5..05c657b47e 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -1,8 +1,7 @@ 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; +const { supported, notApplicable } = ScopeSupportFacetLevel; export const phpScopeSupport: LanguageScopeSupportFacetMap = { "comment.line": supported, @@ -29,7 +28,6 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.multiLine": supported, "argument.actual.iteration": supported, - "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.assignment": supported, @@ -55,4 +53,15 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "string.singleLine": supported, disqualifyDelimiter: supported, + + /* NOT APPLICABLE */ + + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + + // Miscellaneous + "name.variable.uninitialized": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 1f5ad0b76c..24cdefee9a 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -4,11 +4,9 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; const { supported, notApplicable } = ScopeSupportFacetLevel; export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { - "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, "statement.iteration.document": supported, - "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.iteration.document": supported, @@ -327,6 +325,16 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "type.variable.uninitialized": notApplicable, "type.variable.initialized": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + + // Uninitialized variables + "statement.variable.uninitialized": notApplicable, + "name.variable.uninitialized": notApplicable, + // Miscellaneous "statement.misc": notApplicable, disqualifyDelimiter: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 678fe5b235..16081316aa 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -18,6 +18,9 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.catch": supported, "name.assignment": supported, "name.assignment.destructuring": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, "name.class": supported, "name.constructor": supported, "name.field.class": supported, @@ -26,9 +29,6 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.class": supported, "name.iteration.document": supported, "name.method": supported, - "name.variable.uninitialized": supported, - "name.variable.initialized": supported, - "name.variable.destructuring": supported, "value.foreach": supported, "value.yield": supported, @@ -43,13 +43,13 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, "value.assignment": supported, + "value.variable": supported, + "value.variable.destructuring": supported, "value.field.class": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, "value.return": supported, "value.return.lambda": supported, - "value.variable": supported, - "value.variable.destructuring": supported, "value.switch": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -187,9 +187,11 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "statement.switch": supported, "statement.foreach": supported, "statement.while": supported, + "statement.assignment": supported, + "statement.assignment.destructuring": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, + "statement.variable.destructuring": supported, "statement.return": supported, "statement.yield": supported, "statement.break": supported, @@ -305,6 +307,12 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "interior.static": notApplicable, "statement.static": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Miscellaneous "statement.misc": notApplicable, environment: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index c480360037..0cf51e5bff 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -34,7 +34,6 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, "name.assignment": supported, "name.function": supported, - "name.variable.uninitialized": supported, "name.variable.initialized": supported, namedFunction: supported, "value.assignment": supported, @@ -84,6 +83,11 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.chain": notApplicable, "functionCallee.chain": notApplicable, + // Uninitialized variables + "statement.variable.uninitialized": notApplicable, + "name.variable.uninitialized": notApplicable, + "type.variable.uninitialized": notApplicable, + "interior.cell": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, @@ -113,7 +117,6 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.class": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, - "type.variable.uninitialized": notApplicable, "type.variable.initialized": notApplicable, "value.typeAlias": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 2574d66b20..a6af570788 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -82,9 +82,12 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "statement.switch": supported, "statement.foreach": supported, "statement.while": supported, + "statement.assignment": supported, + "statement.assignment.destructuring": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, + "statement.variable.destructuring": supported, "statement.return": supported, "statement.break": supported, "statement.continue": supported, @@ -107,6 +110,10 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": supported, "name.assignment": supported, "name.assignment.destructuring": supported, + "name.constant": supported, + "name.variable.uninitialized": supported, + "name.variable.initialized": supported, + "name.variable.destructuring": supported, "name.class": supported, "name.enum": supported, "name.field.class": supported, @@ -115,9 +122,6 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "name.function": supported, "name.method": supported, "name.namespace": supported, - "name.variable.uninitialized": supported, - "name.variable.initialized": supported, - "name.variable.destructuring": supported, "name.iteration.block": supported, "name.iteration.class": supported, "name.iteration.enum": supported, @@ -132,6 +136,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "value.return.lambda": supported, "value.switch": supported, "value.typeAlias": supported, + "value.constant": supported, "value.variable": supported, "value.variable.destructuring": supported, "value.iteration.block": supported, @@ -148,6 +153,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": supported, "type.field.class": supported, "type.return": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.typeArgument": supported, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 3dd7a973dc..ea096efffe 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -107,9 +107,11 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "statement.foreach": supported, "statement.while": supported, "statement.doWhile": supported, + "statement.assignment": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, + "statement.variable.destructuring": supported, "statement.return": supported, "statement.namespace": supported, "statement.iteration.document": supported, @@ -143,11 +145,11 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.assignment": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.variable.destructuring": supported, - "name.assignment": supported, - "name.assignment.destructuring": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.interface": supported, @@ -164,6 +166,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, "value.assignment": supported, + "value.constant": supported, "value.foreach": supported, "value.switch": supported, "value.field.class": supported, @@ -187,6 +190,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.field.interface": supported, "type.return": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.typeArgument": supported, @@ -309,4 +313,6 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { attribute: notApplicable, "type.cast": notApplicable, "statement.misc": notApplicable, + "statement.assignment.destructuring": notApplicable, + "name.assignment.destructuring": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 7248a64bc4..bd2c844382 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -40,6 +40,12 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index bcca11d4a4..aa0dc78e2a 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -18,13 +18,11 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment": supported, "name.command": supported, - "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.iteration.block": supported, "name.iteration.document": supported, "statement.command": supported, - "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, "statement.assignment": supported, "statement.iteration.block": supported, @@ -336,6 +334,16 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.block": notApplicable, "type.iteration.document": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + + // Uninitialized variables + "name.variable.uninitialized": notApplicable, + "statement.variable.uninitialized": notApplicable, + // Miscellaneous list: notApplicable, map: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index 37d3df899d..7c34c55398 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -327,8 +327,14 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "type.variable.initialized": notApplicable, // Uninitialized variables - "statement.variable.uninitialized": supported, - "name.variable.uninitialized": supported, + "statement.variable.uninitialized": notApplicable, + "name.variable.uninitialized": notApplicable, + + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, // Miscellaneous "statement.misc": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 56b6333973..23b3a5e862 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -22,6 +22,7 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.interface": supported, "type.enum": supported, "type.return": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.typeArgument": supported, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index bb1a62606f..6ab867d005 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -35,6 +35,12 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 313083152c..279881a248 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -29,9 +29,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ - // Single line unenclosed item - "collectionItem.unenclosed.singleLine": notApplicable, - // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, @@ -47,6 +44,12 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.variable.destructuring": notApplicable, + // Constant + "statement.constant": notApplicable, + "name.constant": notApplicable, + "value.constant": notApplicable, + "type.constant": notApplicable, + // Class class: notApplicable, "class.iteration.block": notApplicable, @@ -331,6 +334,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.document": notApplicable, "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, + "collectionItem.unenclosed.singleLine": notApplicable, selector: notApplicable, unit: notApplicable, }; diff --git a/queries/lua.scm b/queries/lua.scm index 60ece77c99..80b022f9e5 100644 --- a/queries/lua.scm +++ b/queries/lua.scm @@ -13,6 +13,9 @@ (repeat_statement) (return_statement) (while_statement) + + ;; Disabled on purpose. We have a better definition of this below. + ;; (assignment_statement) ] @statement ;; Only treat function declarions and calls as statements if they @@ -25,14 +28,6 @@ (#not-parent-type? @statement expression_list) ) -;; Capture assignment only if without variable prefix -;;!! count = count + 1 -;;! ^^^^^^^^^^^^^^^^^ -( - (assignment_statement) @statement - (#not-parent-type? @statement variable_declaration) -) - ;; Document iteration scopes ( @@ -288,57 +283,43 @@ ;; Names and values -;; Handle variable assignments -;;!! a = 42 -;;! ^----- -;;! xxxx-- -( - (assignment_statement +;;!! local foo +;;! ^^^ +(_ + local_declaration: (variable_declaration (variable_list) @name - (_) @_.trailing.startOf - ) @_dummy @_.domain - (#not-parent-type? @_dummy variable_declaration) + ) @name.domain @name.removal ) -;; Handle variable declarations -;;!! local a = 42 -;;! ------^----- -;;! xxxxxxxxxx-- -local_declaration: (variable_declaration - (assignment_statement - (variable_list) @name - (_) @_.removal.end.startOf - ) -) @_.domain @_.removal.start.startOf -;; Handle assignment values -;;!! a = 42 -;;! ----^^ -;;! -xxxxx +;;!! foo = 0 +;;! ^^^ +;;! ^ ( (assignment_statement - (_) @_.leading.endOf - (expression_list) @value - ) @_dummy @_.domain - (#not-parent-type? @_dummy variable_declaration) + (variable_list) @name @value.leading.endOf + (_) @value @name.trailing.startOf + ) @statement @_.domain + (#not-parent-type? @statement variable_declaration) ) -;; Handle variable declaration values -;;!! local a = 42 -;;! ----------^^ -;;! -------xxxxx -local_declaration: (variable_declaration - (assignment_statement - (_) @_.leading.endOf - (expression_list) @value - ) -) @_.domain +;;!! local foo = 0 +;;! ^^^ +;;! ^ +(_ + local_declaration: (variable_declaration + (assignment_statement + (variable_list) @name @value.leading.endOf + (_) @value @name.removal.end.startOf + ) + ) @_.domain @name.removal.start.startOf +) ;;!! return a + b ;;! -------^^^^^ ;;! ------xxxxxx (return_statement (_) @value -) @_.domain +) @value.domain ;; match a ternary condition ;;!! local max = x > y and x or y diff --git a/queries/scala.scm b/queries/scala.scm index 8afa69b232..01e2e8d2b3 100644 --- a/queries/scala.scm +++ b/queries/scala.scm @@ -18,6 +18,7 @@ (do_while_expression) (for_expression) (try_expression) + (var_declaration) ;; Disabled on purpose. We have a better definition of this below. ;; (if_expression) From 840a94355e0acdaadb7d713bedf41df3523aec3a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 14:23:33 +0100 Subject: [PATCH 13/25] type and value --- .../scopes/cpp/type/type.field.class.scope | 14 ++--- .../scopes/lua/value/value.variable2.scope | 20 ------- .../scopes/python/type/type.field.class.scope | 25 ++++++++- .../python/value/value.field.class.scope | 52 +++++++++---------- .../scopes/scala/type/type.field.class.scope | 32 ++++++------ .../scala/value/value.field.class.scope | 40 ++++++++++---- .../value/value.field.enum.scope | 32 ++++++------ 7 files changed, 118 insertions(+), 97 deletions(-) delete mode 100644 data/fixtures/scopes/lua/value/value.variable2.scope diff --git a/data/fixtures/scopes/cpp/type/type.field.class.scope b/data/fixtures/scopes/cpp/type/type.field.class.scope index f38bc25a02..528fd810c8 100644 --- a/data/fixtures/scopes/cpp/type/type.field.class.scope +++ b/data/fixtures/scopes/cpp/type/type.field.class.scope @@ -1,6 +1,6 @@ class Foo { int bar; - int baz = 1; + int baz = 0; } --- @@ -10,7 +10,7 @@ class Foo { >----------- 0| class Foo { 1| int bar; -2| int baz = 1; +2| int baz = 0; 3| } -< @@ -42,22 +42,22 @@ class Foo { [#3 Content] = 2:4-2:7 >---< -2| int baz = 1; +2| int baz = 0; [#3 Removal] = 2:4-2:8 >----< -2| int baz = 1; +2| int baz = 0; [#3 Leading delimiter] = 2:0-2:4 >----< -2| int baz = 1; +2| int baz = 0; [#3 Trailing delimiter] = 2:7-2:8 >-< -2| int baz = 1; +2| int baz = 0; [#3 Domain] = 2:4-2:16 >------------< -2| int baz = 1; +2| int baz = 0; [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/value/value.variable2.scope b/data/fixtures/scopes/lua/value/value.variable2.scope deleted file mode 100644 index 3725f30c9f..0000000000 --- a/data/fixtures/scopes/lua/value/value.variable2.scope +++ /dev/null @@ -1,20 +0,0 @@ -local foo, bar = 0, 1 ---- - -[Content] = 0:17-0:21 - >----< -0| local foo, bar = 0, 1 - -[Removal] = 0:14-0:21 - >-------< -0| local foo, bar = 0, 1 - -[Leading delimiter] = 0:14-0:17 - >---< -0| local foo, bar = 0, 1 - -[Domain] = 0:0-0:21 - >---------------------< -0| local foo, bar = 0, 1 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/type/type.field.class.scope b/data/fixtures/scopes/python/type/type.field.class.scope index 61915292ae..cae2966f4c 100644 --- a/data/fixtures/scopes/python/type/type.field.class.scope +++ b/data/fixtures/scopes/python/type/type.field.class.scope @@ -1,14 +1,16 @@ class Foo: bar: int + baz: int = 0 --- [#1 Content] = [#1 Removal] = -[#1 Domain] = 0:0-1:12 +[#1 Domain] = 0:0-2:16 >---------- 0| class Foo: 1| bar: int - ------------< +2| baz: int = 0 + ----------------< [#1 Insertion delimiter] = " " @@ -30,3 +32,22 @@ class Foo: 1| bar: int [#2 Insertion delimiter] = " " + + +[#3 Content] = 2:9-2:12 + >---< +2| baz: int = 0 + +[#3 Removal] = 2:7-2:12 + >-----< +2| baz: int = 0 + +[#3 Leading delimiter] = 2:7-2:9 + >--< +2| baz: int = 0 + +[#3 Domain] = 2:4-2:16 + >------------< +2| baz: int = 0 + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/value/value.field.class.scope b/data/fixtures/scopes/python/value/value.field.class.scope index 13729bc22f..332b888a88 100644 --- a/data/fixtures/scopes/python/value/value.field.class.scope +++ b/data/fixtures/scopes/python/value/value.field.class.scope @@ -1,41 +1,41 @@ class Foo: - bar = 0 - baz: int = 1 + bar: int = 0 + baz = 1 --- -[#1 Content] = 1:10-1:11 - >-< -1| bar = 0 +[#1 Content] = 1:15-1:16 + >-< +1| bar: int = 0 -[#1 Removal] = 1:7-1:11 - >----< -1| bar = 0 +[#1 Removal] = 1:12-1:16 + >----< +1| bar: int = 0 -[#1 Leading delimiter] = 1:7-1:10 - >---< -1| bar = 0 +[#1 Leading delimiter] = 1:12-1:15 + >---< +1| bar: int = 0 -[#1 Domain] = 1:4-1:11 - >-------< -1| bar = 0 +[#1 Domain] = 1:4-1:16 + >------------< +1| bar: int = 0 [#1 Insertion delimiter] = " " -[#2 Content] = 2:15-2:16 - >-< -2| baz: int = 1 +[#2 Content] = 2:10-2:11 + >-< +2| baz = 1 -[#2 Removal] = 2:12-2:16 - >----< -2| baz: int = 1 +[#2 Removal] = 2:7-2:11 + >----< +2| baz = 1 -[#2 Leading delimiter] = 2:12-2:15 - >---< -2| baz: int = 1 +[#2 Leading delimiter] = 2:7-2:10 + >---< +2| baz = 1 -[#2 Domain] = 2:4-2:16 - >------------< -2| baz: int = 1 +[#2 Domain] = 2:4-2:11 + >-------< +2| baz = 1 [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/type/type.field.class.scope b/data/fixtures/scopes/scala/type/type.field.class.scope index 3dd8780a46..dc31054ef7 100644 --- a/data/fixtures/scopes/scala/type/type.field.class.scope +++ b/data/fixtures/scopes/scala/type/type.field.class.scope @@ -1,6 +1,6 @@ class Foo { - val bar: Int = 0 - val baz: Int + val bar: Int + val baz: Int = 0 } --- @@ -9,8 +9,8 @@ class Foo { [#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| val bar: Int = 0 -2| val baz: Int +1| val bar: Int +2| val baz: Int = 0 3| } -< @@ -19,37 +19,37 @@ class Foo { [#2 Content] = 1:13-1:16 >---< -1| val bar: Int = 0 +1| val bar: Int [#2 Removal] = 1:11-1:16 >-----< -1| val bar: Int = 0 +1| val bar: Int [#2 Leading delimiter] = 1:11-1:13 >--< -1| val bar: Int = 0 +1| val bar: Int -[#2 Domain] = 1:4-1:20 - >----------------< -1| val bar: Int = 0 +[#2 Domain] = 1:4-1:16 + >------------< +1| val bar: Int [#2 Insertion delimiter] = " " [#3 Content] = 2:13-2:16 >---< -2| val baz: Int +2| val baz: Int = 0 [#3 Removal] = 2:11-2:16 >-----< -2| val baz: Int +2| val baz: Int = 0 [#3 Leading delimiter] = 2:11-2:13 >--< -2| val baz: Int +2| val baz: Int = 0 -[#3 Domain] = 2:4-2:16 - >------------< -2| val baz: Int +[#3 Domain] = 2:4-2:20 + >----------------< +2| val baz: Int = 0 [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/value/value.field.class.scope b/data/fixtures/scopes/scala/value/value.field.class.scope index e5f47606d8..07cf45ff71 100644 --- a/data/fixtures/scopes/scala/value/value.field.class.scope +++ b/data/fixtures/scopes/scala/value/value.field.class.scope @@ -1,22 +1,42 @@ class Foo { - var bar = 0 + var bar: Int = 0 + var baz = 1 } --- -[Content] = 1:14-1:15 +[#1 Content] = 1:19-1:20 + >-< +1| var bar: Int = 0 + +[#1 Removal] = 1:16-1:20 + >----< +1| var bar: Int = 0 + +[#1 Leading delimiter] = 1:16-1:19 + >---< +1| var bar: Int = 0 + +[#1 Domain] = 1:4-1:20 + >----------------< +1| var bar: Int = 0 + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:14-2:15 >-< -1| var bar = 0 +2| var baz = 1 -[Removal] = 1:11-1:15 +[#2 Removal] = 2:11-2:15 >----< -1| var bar = 0 +2| var baz = 1 -[Leading delimiter] = 1:11-1:14 +[#2 Leading delimiter] = 2:11-2:14 >---< -1| var bar = 0 +2| var baz = 1 -[Domain] = 1:4-1:15 +[#2 Domain] = 2:4-2:15 >-----------< -1| var bar = 0 +2| var baz = 1 -[Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/value/value.field.enum.scope b/data/fixtures/scopes/typescript.core/value/value.field.enum.scope index e9b28b0b42..882ede0854 100644 --- a/data/fixtures/scopes/typescript.core/value/value.field.enum.scope +++ b/data/fixtures/scopes/typescript.core/value/value.field.enum.scope @@ -1,43 +1,43 @@ enum Foo { - bar = "-", - baz = 0, + bar = 0, + baz = 1, bongo } --- -[#1 Content] = 1:10-1:13 - >---< -1| bar = "-", +[#1 Content] = 1:10-1:11 + >-< +1| bar = 0, -[#1 Removal] = 1:7-1:13 - >------< -1| bar = "-", +[#1 Removal] = 1:7-1:11 + >----< +1| bar = 0, [#1 Leading delimiter] = 1:7-1:10 >---< -1| bar = "-", +1| bar = 0, -[#1 Domain] = 1:4-1:13 - >---------< -1| bar = "-", +[#1 Domain] = 1:4-1:11 + >-------< +1| bar = 0, [#1 Insertion delimiter] = " " [#2 Content] = 2:10-2:11 >-< -2| baz = 0, +2| baz = 1, [#2 Removal] = 2:7-2:11 >----< -2| baz = 0, +2| baz = 1, [#2 Leading delimiter] = 2:7-2:10 >---< -2| baz = 0, +2| baz = 1, [#2 Domain] = 2:4-2:11 >-------< -2| baz = 0, +2| baz = 1, [#2 Insertion delimiter] = " " From 9354c5b6678b03fccbb2ffbfdf7f39849113bae4 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 16:22:09 +0100 Subject: [PATCH 14/25] More work on variable removal ranges --- .../recorded/languages/rust/chuckName.yml | 6 +-- .../scopes/c/name/name.constant.scope | 4 +- .../c/name/name.variable.initialized.scope | 4 +- .../c/name/name.variable.uninitialized.scope | 9 ++-- .../scopes/csharp/name/name.constant.scope | 4 +- .../name/name.variable.initialized.scope | 4 +- .../name/name.variable.initialized2.scope | 4 +- .../name/name.variable.uninitialized.scope | 4 +- .../go/name/name.variable.initialized.scope | 4 +- .../go/name/name.variable.initialized2.scope | 4 +- .../go/name/name.variable.uninitialized.scope | 9 ++-- .../scopes/java/name/name.constant.scope | 4 +- .../java/name/name.variable.initialized.scope | 4 +- .../name/name.variable.uninitialized.scope | 4 +- .../scopes/kotlin/name/name.constant.scope | 4 +- .../scopes/kotlin/name/name.field.class.scope | 17 +++---- .../kotlin/name/name.field.interface.scope | 9 ++-- .../name/name.variable.destructuring.scope | 4 +- .../name/name.variable.initialized.scope | 4 +- .../name/name.variable.uninitialized.scope | 9 ++-- .../name/name.variable.uninitialized.scope | 4 +- .../scopes/rust/name/name.constant.scope | 4 +- .../name/name.variable.destructuring.scope | 4 +- .../rust/name/name.variable.initialized.scope | 4 +- .../name/name.variable.uninitialized.scope | 4 +- .../scopes/scala/name/name.constant.scope | 4 +- .../name/name.variable.destructuring.scope | 4 +- .../name/name.variable.initialized.scope | 4 +- .../name/name.variable.uninitialized.scope | 9 ++-- .../name.variable.initialized.scope | 4 +- .../name.variable.initialized2.scope | 7 ++- .../name/name.variable.initialized2.scope | 4 +- .../name/name.variable.uninitialized.scope | 4 +- queries/c.scm | 6 +-- queries/csharp.scm | 6 +-- queries/go.scm | 14 +++--- queries/java.scm | 18 ++++---- queries/javascript.core.scm | 31 +++++++++---- queries/kotlin.scm | 32 +++++-------- queries/python.scm | 35 ++++++-------- queries/rust.scm | 46 ++++++++----------- queries/scala.scm | 20 ++++++-- queries/talon-list.scm | 4 +- queries/typescript.core.scm | 14 +++--- 44 files changed, 196 insertions(+), 205 deletions(-) diff --git a/data/fixtures/recorded/languages/rust/chuckName.yml b/data/fixtures/recorded/languages/rust/chuckName.yml index 464a24c203..5f9aca9b09 100644 --- a/data/fixtures/recorded/languages/rust/chuckName.yml +++ b/data/fixtures/recorded/languages/rust/chuckName.yml @@ -17,7 +17,7 @@ initialState: active: {line: 0, character: 5} marks: {} finalState: - documentContents: "let mut: [i32; 3] = [0; 3];" + documentContents: "[0; 3];" selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 5} + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} diff --git a/data/fixtures/scopes/c/name/name.constant.scope b/data/fixtures/scopes/c/name/name.constant.scope index 3ec7116144..1c100372ae 100644 --- a/data/fixtures/scopes/c/name/name.constant.scope +++ b/data/fixtures/scopes/c/name/name.constant.scope @@ -5,8 +5,8 @@ const int foo = 0; >---< 0| const int foo = 0; -[Removal] = 0:10-0:14 - >----< +[Removal] = 0:0-0:16 + >----------------< 0| const int foo = 0; [Leading delimiter] = 0:9-0:10 diff --git a/data/fixtures/scopes/c/name/name.variable.initialized.scope b/data/fixtures/scopes/c/name/name.variable.initialized.scope index 65a4094cae..c0828198a5 100644 --- a/data/fixtures/scopes/c/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/c/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ int foo = 0; >---< 0| int foo = 0; -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| int foo = 0; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/c/name/name.variable.uninitialized.scope b/data/fixtures/scopes/c/name/name.variable.uninitialized.scope index 97f44e72b1..01e8468729 100644 --- a/data/fixtures/scopes/c/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/c/name/name.variable.uninitialized.scope @@ -5,16 +5,13 @@ int foo; >---< 0| int foo; -[Removal] = 0:3-0:7 - >----< +[Removal] = +[Domain] = 0:0-0:8 + >--------< 0| int foo; [Leading delimiter] = 0:3-0:4 >-< 0| int foo; -[Domain] = 0:0-0:8 - >--------< -0| int foo; - [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.constant.scope b/data/fixtures/scopes/csharp/name/name.constant.scope index 3ec7116144..1c100372ae 100644 --- a/data/fixtures/scopes/csharp/name/name.constant.scope +++ b/data/fixtures/scopes/csharp/name/name.constant.scope @@ -5,8 +5,8 @@ const int foo = 0; >---< 0| const int foo = 0; -[Removal] = 0:10-0:14 - >----< +[Removal] = 0:0-0:16 + >----------------< 0| const int foo = 0; [Leading delimiter] = 0:9-0:10 diff --git a/data/fixtures/scopes/csharp/name/name.variable.initialized.scope b/data/fixtures/scopes/csharp/name/name.variable.initialized.scope index 65a4094cae..c0828198a5 100644 --- a/data/fixtures/scopes/csharp/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/csharp/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ int foo = 0; >---< 0| int foo = 0; -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| int foo = 0; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/csharp/name/name.variable.initialized2.scope b/data/fixtures/scopes/csharp/name/name.variable.initialized2.scope index 62a273be8b..263bc28906 100644 --- a/data/fixtures/scopes/csharp/name/name.variable.initialized2.scope +++ b/data/fixtures/scopes/csharp/name/name.variable.initialized2.scope @@ -5,8 +5,8 @@ var foo = 0; >---< 0| var foo = 0; -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| var foo = 0; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope b/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope index 97f44e72b1..ceee24b3b0 100644 --- a/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/csharp/name/name.variable.uninitialized.scope @@ -5,8 +5,8 @@ int foo; >---< 0| int foo; -[Removal] = 0:3-0:7 - >----< +[Removal] = 0:0-0:7 + >-------< 0| int foo; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/go/name/name.variable.initialized.scope b/data/fixtures/scopes/go/name/name.variable.initialized.scope index 11adc00523..53488557ba 100644 --- a/data/fixtures/scopes/go/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/go/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ var foo int = 0 >---< 0| var foo int = 0 -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:14 + >--------------< 0| var foo int = 0 [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/go/name/name.variable.initialized2.scope b/data/fixtures/scopes/go/name/name.variable.initialized2.scope index cda5dd235d..3d7ef77aab 100644 --- a/data/fixtures/scopes/go/name/name.variable.initialized2.scope +++ b/data/fixtures/scopes/go/name/name.variable.initialized2.scope @@ -5,8 +5,8 @@ foo := 0 >---< 0| foo := 0 -[Removal] = 0:0-0:4 - >----< +[Removal] = 0:0-0:7 + >-------< 0| foo := 0 [Trailing delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/go/name/name.variable.uninitialized.scope b/data/fixtures/scopes/go/name/name.variable.uninitialized.scope index 78abad522f..606bb45554 100644 --- a/data/fixtures/scopes/go/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/go/name/name.variable.uninitialized.scope @@ -5,8 +5,9 @@ var foo int >---< 0| var foo int -[Removal] = 0:4-0:8 - >----< +[Removal] = +[Domain] = 0:0-0:11 + >-----------< 0| var foo int [Leading delimiter] = 0:3-0:4 @@ -17,8 +18,4 @@ var foo int >-< 0| var foo int -[Domain] = 0:0-0:11 - >-----------< -0| var foo int - [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.constant.scope b/data/fixtures/scopes/java/name/name.constant.scope index f25559df8e..9e3e536f22 100644 --- a/data/fixtures/scopes/java/name/name.constant.scope +++ b/data/fixtures/scopes/java/name/name.constant.scope @@ -5,8 +5,8 @@ final int foo = 0; >---< 0| final int foo = 0; -[Removal] = 0:10-0:14 - >----< +[Removal] = 0:0-0:16 + >----------------< 0| final int foo = 0; [Leading delimiter] = 0:9-0:10 diff --git a/data/fixtures/scopes/java/name/name.variable.initialized.scope b/data/fixtures/scopes/java/name/name.variable.initialized.scope index 65a4094cae..c0828198a5 100644 --- a/data/fixtures/scopes/java/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/java/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ int foo = 0; >---< 0| int foo = 0; -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| int foo = 0; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/java/name/name.variable.uninitialized.scope b/data/fixtures/scopes/java/name/name.variable.uninitialized.scope index 97f44e72b1..ceee24b3b0 100644 --- a/data/fixtures/scopes/java/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/java/name/name.variable.uninitialized.scope @@ -5,8 +5,8 @@ int foo; >---< 0| int foo; -[Removal] = 0:3-0:7 - >----< +[Removal] = 0:0-0:7 + >-------< 0| int foo; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/kotlin/name/name.constant.scope b/data/fixtures/scopes/kotlin/name/name.constant.scope index 608e22c538..31bd2cdb64 100644 --- a/data/fixtures/scopes/kotlin/name/name.constant.scope +++ b/data/fixtures/scopes/kotlin/name/name.constant.scope @@ -5,8 +5,8 @@ val foo = 0 >---< 0| val foo = 0 -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| val foo = 0 [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/kotlin/name/name.field.class.scope b/data/fixtures/scopes/kotlin/name/name.field.class.scope index c03fbe7548..fbd5d868fb 100644 --- a/data/fixtures/scopes/kotlin/name/name.field.class.scope +++ b/data/fixtures/scopes/kotlin/name/name.field.class.scope @@ -37,8 +37,8 @@ class Foo { >---< 1| var bar: Int = 0 -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = 1:4-1:19 + >---------------< 1| var bar: Int = 0 [#2 Leading delimiter] = 1:7-1:8 @@ -56,8 +56,8 @@ class Foo { >---< 2| val baz = 0 -[#3 Removal] = 2:8-2:12 - >----< +[#3 Removal] = 2:4-2:14 + >----------< 2| val baz = 0 [#3 Leading delimiter] = 2:7-2:8 @@ -79,16 +79,13 @@ class Foo { >-----< 3| val bongo: Int -[#4 Removal] = 3:7-3:13 - >------< +[#4 Removal] = +[#4 Domain] = 3:4-3:18 + >--------------< 3| val bongo: Int [#4 Leading delimiter] = 3:7-3:8 >-< 3| val bongo: Int -[#4 Domain] = 3:4-3:18 - >--------------< -3| val bongo: Int - [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.field.interface.scope b/data/fixtures/scopes/kotlin/name/name.field.interface.scope index 62b2cf00ea..6349336acb 100644 --- a/data/fixtures/scopes/kotlin/name/name.field.interface.scope +++ b/data/fixtures/scopes/kotlin/name/name.field.interface.scope @@ -33,16 +33,13 @@ interface Foo { >---< 1| val bar: Int -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = +[#2 Domain] = 1:4-1:16 + >------------< 1| val bar: Int [#2 Leading delimiter] = 1:7-1:8 >-< 1| val bar: Int -[#2 Domain] = 1:4-1:16 - >------------< -1| val bar: Int - [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope b/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope index 41c7420ace..34528a0606 100644 --- a/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope +++ b/data/fixtures/scopes/kotlin/name/name.variable.destructuring.scope @@ -5,8 +5,8 @@ var (foo, bar) = baz >----------< 0| var (foo, bar) = baz -[Removal] = 0:4-0:15 - >-----------< +[Removal] = 0:0-0:17 + >-----------------< 0| var (foo, bar) = baz [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope b/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope index 1cd9475d1d..ae1bd45fb4 100644 --- a/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/kotlin/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ var foo = 0 >---< 0| var foo = 0 -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| var foo = 0 [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope b/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope index aadb078077..a2ecd26dce 100644 --- a/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/kotlin/name/name.variable.uninitialized.scope @@ -5,16 +5,13 @@ var foo: Int >---< 0| var foo: Int -[Removal] = 0:3-0:7 - >----< +[Removal] = +[Domain] = 0:0-0:12 + >------------< 0| var foo: Int [Leading delimiter] = 0:3-0:4 >-< 0| var foo: Int -[Domain] = 0:0-0:12 - >------------< -0| var foo: Int - [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name/name.variable.uninitialized.scope b/data/fixtures/scopes/python/name/name.variable.uninitialized.scope index 3a8dfd9fd0..ce1545fb8e 100644 --- a/data/fixtures/scopes/python/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/python/name/name.variable.uninitialized.scope @@ -1,11 +1,11 @@ foo: int --- -[Content] = -[Removal] = 0:0-0:3 +[Content] = 0:0-0:3 >---< 0| foo: int +[Removal] = [Domain] = 0:0-0:8 >--------< 0| foo: int diff --git a/data/fixtures/scopes/rust/name/name.constant.scope b/data/fixtures/scopes/rust/name/name.constant.scope index 22d3cdeefc..df74c90ddc 100644 --- a/data/fixtures/scopes/rust/name/name.constant.scope +++ b/data/fixtures/scopes/rust/name/name.constant.scope @@ -5,8 +5,8 @@ const foo: i32 = 0; >---< 0| const foo: i32 = 0; -[Removal] = 0:5-0:9 - >----< +[Removal] = 0:0-0:17 + >-----------------< 0| const foo: i32 = 0; [Leading delimiter] = 0:5-0:6 diff --git a/data/fixtures/scopes/rust/name/name.variable.destructuring.scope b/data/fixtures/scopes/rust/name/name.variable.destructuring.scope index 1ab039d3b2..c1292881ec 100644 --- a/data/fixtures/scopes/rust/name/name.variable.destructuring.scope +++ b/data/fixtures/scopes/rust/name/name.variable.destructuring.scope @@ -5,8 +5,8 @@ let Foo {bar, baz} = bongo; >--------------< 0| let Foo {bar, baz} = bongo; -[Removal] = 0:4-0:19 - >---------------< +[Removal] = 0:0-0:21 + >---------------------< 0| let Foo {bar, baz} = bongo; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/rust/name/name.variable.initialized.scope b/data/fixtures/scopes/rust/name/name.variable.initialized.scope index 9cb426ea51..b29e4d221e 100644 --- a/data/fixtures/scopes/rust/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/rust/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ let foo = 0; >---< 0| let foo = 0; -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| let foo = 0; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope b/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope index a023865b04..c0569b3950 100644 --- a/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/rust/name/name.variable.uninitialized.scope @@ -5,8 +5,8 @@ let foo: i32; >---< 0| let foo: i32; -[Removal] = 0:3-0:7 - >----< +[Removal] = 0:0-0:12 + >------------< 0| let foo: i32; [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/scala/name/name.constant.scope b/data/fixtures/scopes/scala/name/name.constant.scope index 608e22c538..31bd2cdb64 100644 --- a/data/fixtures/scopes/scala/name/name.constant.scope +++ b/data/fixtures/scopes/scala/name/name.constant.scope @@ -5,8 +5,8 @@ val foo = 0 >---< 0| val foo = 0 -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| val foo = 0 [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/scala/name/name.variable.destructuring.scope b/data/fixtures/scopes/scala/name/name.variable.destructuring.scope index b919a2a8dd..1bc60f9384 100644 --- a/data/fixtures/scopes/scala/name/name.variable.destructuring.scope +++ b/data/fixtures/scopes/scala/name/name.variable.destructuring.scope @@ -5,8 +5,8 @@ val (foo, bar) = baz >----------< 0| val (foo, bar) = baz -[Removal] = 0:4-0:15 - >-----------< +[Removal] = 0:0-0:17 + >-----------------< 0| val (foo, bar) = baz [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/scala/name/name.variable.initialized.scope b/data/fixtures/scopes/scala/name/name.variable.initialized.scope index 1cd9475d1d..ae1bd45fb4 100644 --- a/data/fixtures/scopes/scala/name/name.variable.initialized.scope +++ b/data/fixtures/scopes/scala/name/name.variable.initialized.scope @@ -5,8 +5,8 @@ var foo = 0 >---< 0| var foo = 0 -[Removal] = 0:4-0:8 - >----< +[Removal] = 0:0-0:10 + >----------< 0| var foo = 0 [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope b/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope index aadb078077..a2ecd26dce 100644 --- a/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/scala/name/name.variable.uninitialized.scope @@ -5,16 +5,13 @@ var foo: Int >---< 0| var foo: Int -[Removal] = 0:3-0:7 - >----< +[Removal] = +[Domain] = 0:0-0:12 + >------------< 0| var foo: Int [Leading delimiter] = 0:3-0:4 >-< 0| var foo: Int -[Domain] = 0:0-0:12 - >------------< -0| var foo: Int - [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon-list/name.variable.initialized.scope b/data/fixtures/scopes/talon-list/name.variable.initialized.scope index 9822c0f598..30b2b2133d 100644 --- a/data/fixtures/scopes/talon-list/name.variable.initialized.scope +++ b/data/fixtures/scopes/talon-list/name.variable.initialized.scope @@ -6,8 +6,8 @@ not app: vscode >---< 0| not app: vscode -[Removal] = 0:3-0:7 - >----< +[Removal] = 0:0-0:9 + >---------< 0| not app: vscode [Leading delimiter] = 0:3-0:4 diff --git a/data/fixtures/scopes/talon-list/name.variable.initialized2.scope b/data/fixtures/scopes/talon-list/name.variable.initialized2.scope index 791ecaef96..cef7058dbf 100644 --- a/data/fixtures/scopes/talon-list/name.variable.initialized2.scope +++ b/data/fixtures/scopes/talon-list/name.variable.initialized2.scope @@ -1,11 +1,14 @@ foo: bar --- -[Content] = -[Removal] = 0:0-0:3 +[Content] = 0:0-0:3 >---< 0| foo: bar +[Removal] = 0:0-0:5 + >-----< +0| foo: bar + [Domain] = 0:0-0:8 >--------< 0| foo: bar diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope b/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope index 5a5650d856..9b0173fd0a 100644 --- a/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope +++ b/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope @@ -5,8 +5,8 @@ export type Foo = Bar; >---< 0| export type Foo = Bar; -[Removal] = 0:12-0:16 - >----< +[Removal] = 0:0-0:18 + >------------------< 0| export type Foo = Bar; [Leading delimiter] = 0:11-0:12 diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope b/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope index 5fa591115e..7ca2789834 100644 --- a/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope +++ b/data/fixtures/scopes/typescript.core/name/name.variable.uninitialized.scope @@ -5,8 +5,8 @@ let foo: number; >---< 0| let foo: number; -[Removal] = 0:0-0:7 - >-------< +[Removal] = 0:0-0:15 + >---------------< 0| let foo: number; [Leading delimiter] = 0:3-0:4 diff --git a/queries/c.scm b/queries/c.scm index fcc4082104..0586d11c16 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -193,16 +193,16 @@ (declaration declarator: (_ declarator: (_) @name @value.leading.endOf - value: (_) @value + value: (_) @value @name.removal.end.startOf ) -) @_.domain +) @_.domain @name.removal.start.startOf ;;!! int aaa; (declaration declarator: (_ !declarator ) @name -) @_.domain +) @_.domain @name.removal ;;!! aaa = 0; (_ diff --git a/queries/csharp.scm b/queries/csharp.scm index 2f215d2b68..d730d9b11a 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -351,13 +351,13 @@ (variable_declaration type: (_) @type (variable_declarator - (identifier) @name @value.leading.endOf + (identifier) @name @value.leading.endOf @name.removal.end.endOf (equals_value_clause - (_) @value + (_) @value @name.removal.end.startOf )? ) ) -) @_.domain +) @_.domain @name.removal.start.startOf ;;!! aaa = "bbb"; ;;! ^^^ diff --git a/queries/go.scm b/queries/go.scm index d8e003ead8..b77821a996 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -463,10 +463,10 @@ (var_declaration (var_spec name: (_) @name - type: (_) @type @value.leading.endOf - value: (_)? @value + type: (_) @type @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf ) -) @_.domain +) @_.domain @name.removal.start.startOf ;;!! var foo = 0 ;;! ^^^ @@ -475,17 +475,17 @@ (var_spec name: (_) @name @value.leading.endOf !type - value: (_) @value + value: (_) @value @name.removal.end.startOf ) -) @_.domain +) @_.domain @name.removal.start.startOf ;;!! foo := 0 ;;! ^^^ ;;! ^ (short_var_declaration left: (_) @name @value.leading.endOf - right: (_) @value -) @_.domain + right: (_) @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf ;;!! foo = 0 ;;! ^^^ diff --git a/queries/java.scm b/queries/java.scm index dc941e1ee5..96a6fff848 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -41,6 +41,7 @@ ;; Disabled on purpose. We have a better definition of this below. ;; (if_statement) ;; (enum_declaration) + ;; (local_variable_declaration) ] @statement ( @@ -412,10 +413,10 @@ (local_variable_declaration type: (_) @type (variable_declarator - name: (_) @name @value.leading.endOf - value: (_)? @value + name: (_) @name @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf ) -) @_.domain +) @_.domain @name.removal.start.startOf ;;!! int foo = 0; ;;! ^^^ @@ -424,10 +425,10 @@ (field_declaration type: (_) @type (variable_declarator - name: (_) @name @value.leading.endOf - value: (_)? @value + name: (_) @name @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf ) -) @_.domain +) @_.domain @name.removal.start.startOf ;;!! int value; ;;! ^^^ @@ -436,9 +437,10 @@ (constant_declaration type: (_) @type (variable_declarator - name: (_) @name + name: (_) @name @name.removal.end.endOf @value.leading.endOf + value: (_)? @value @name.removal.end.startOf ) - ) @_.domain + ) @_.domain @name.removal.start.startOf ) ;;!! int foo, bar; diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 1d4a81e8a8..bdcdf139a0 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -89,6 +89,7 @@ field_definition generic_type property_signature + type_alias_declaration ) ) @@ -100,7 +101,7 @@ ;; We have a special case for this one. Note we don't need to list the other ;; special cases from above because they can't be exported - (#not-type? @_dummy variable_declarator) + (#not-type? @_dummy variable_declarator type_alias_declaration) ) @_.domain ;; Special cases for `(let | const | var) foo = ...;` because the full statement @@ -120,10 +121,16 @@ ;;! ------------------------ (lexical_declaration . - (variable_declarator - name: (_) @name @name.removal.end.endOf - value: (_)? @name.removal.end.startOf - ) + [ + (variable_declarator + name: (_) @name + value: (_) @name.removal.end.startOf + ) + (variable_declarator + name: (_) @name + !value + ) @name.removal.end.endOf + ] ) ;; name: @@ -140,10 +147,16 @@ ;; of https://github.com/tree-sitter/tree-sitter/issues/1442#issuecomment-1584628651 (variable_declaration . - (variable_declarator - name: (_) @name @name.removal.end.endOf - value: (_)? @name.removal.end.startOf - ) + [ + (variable_declarator + name: (_) @name + value: (_) @name.removal.end.startOf + ) + (variable_declarator + name: (_) @name + !value + ) @name.removal.end.endOf + ] ) ] @_.domain @name.removal.start.startOf (#not-parent-type? @_.domain export_statement) diff --git a/queries/kotlin.scm b/queries/kotlin.scm index 7277364f1a..242c70b903 100644 --- a/queries/kotlin.scm +++ b/queries/kotlin.scm @@ -285,27 +285,17 @@ ;;! ^^^ ;;! ^ (property_declaration - (variable_declaration - (simple_identifier) @name @type.leading.endOf - (type_modifiers)? @type.start - [ - (user_type) - (function_type) - ] ? @type.end - ) @value.leading.endOf - ( - "=" - (_) @value - )? -) @_.domain - -;;!! val (foo: Int, bar: Int) = baz -;;! ^^^^^^^^^^^^^^^^^^ -;;! ^^^ -(property_declaration - (multi_variable_declaration) @name @value.leading.endOf - (_) @value -) @_.domain + [ + (variable_declaration + (simple_identifier) @name @type.leading.endOf + (type_modifiers)? @type.start + (_)? @type.end + . + ) + (multi_variable_declaration) @name + ] @value.leading.endOf @name.removal.end.endOf + (_)? @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf ;;!! foo = 0 ;;! ^^^ diff --git a/queries/python.scm b/queries/python.scm index 0cedb62a25..367bd6ad70 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -42,16 +42,24 @@ (block) @interior.end.endOf ) -;;!! a = 25 -;;! ^^ -;;! xxxxx -;;! ------ +;;!! foo = 0 +;;! ^^^ +;;! ^ (assignment - (_) @_.leading.endOf - . - right: (_) @value + left: (_) @name + !type + right: (_)? @value @name.trailing.end.startOf ) @_.domain +;;!! foo: int = 0 +;;! ^^^ +;;! ^ +(assignment + left: (_) @name + type: (_) @name.removal.end.endOf + right: (_)? @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf + ;; value: ;;!! a /= 25 ;;! ^^ @@ -67,19 +75,6 @@ right: (_) @value @name.trailing.startOf ) @_.domain -;;!! a = 25 -;;! ^ -;;! xxxx -;;! ------ -;;!! a: int = 25 -;;! ^ -;;! xxxxxxxxx -;;! ----------- -(assignment - left: (_) @name - right: (_)? @name.trailing.startOf -) @name.domain - ;;!! foo(aaa=1, bbb=2) ;;! ^^^ ^^^ (keyword_argument diff --git a/queries/rust.scm b/queries/rust.scm index 77b126aee3..ef1e025352 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -263,7 +263,7 @@ (_) @_.trailing.startOf ) @_.domain -;;!! let Foo {aaa: 1, bbb: 2} +;;!! let Foo {aaa: 0, bbb: 1} ;;! ^^^ ^^^ ;;! ^ ^ (field_initializer @@ -271,7 +271,7 @@ value: (_) @value @collectionKey.trailing.startOf ) @_.domain -;;!! Foo {aaa: 1, bbb: 2} +;;!! Foo {aaa: 0, bbb: 1} ;;! ^^^ ^^^ ;;! ^ ^ (field_pattern @@ -279,45 +279,37 @@ pattern: (_) @value @collectionKey.trailing.startOf ) @_.domain -;;!! const foo: u8 = 2; +;;!! const foo: u8 = 0; ;;! ^ (const_item name: (_) @name @type.leading.endOf type: (_) @type @value.leading.endOf - value: (_) @value -) @_.domain + value: (_) @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf -;;!! let foo = 2; +;;!! let foo: i32 = 0; ;;! ^^^ -;;! ^ -(let_declaration - pattern: (_) @name @value.leading.start.endOf - . - value: (_) @value -) @_.domain - -;;!! let foo: u8 = 2; -;;! ^^^ -;;! ^ +;;! ^^^ +;;! ^ (let_declaration pattern: (_) @name @type.leading.endOf - type: (_) @type @value.leading.start.endOf - value: (_) @value -) @_.domain + type: (_) @type @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf -;;!! let foo: u8; +;;!! let foo = 0; ;;! ^^^ ;;! ^ (let_declaration - pattern: (_) @name @type.leading.endOf - type: (_) @type - !value -) @_.domain + pattern: (_) @name @value.leading.endOf @name.removal.end.endOf + !type + value: (_)? @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf (expression_statement (assignment_expression - left: (_) @name @value.leading.start.endOf - right: (_) @value @name.trailing.start.startOf + left: (_) @name @value.leading.endOf + right: (_) @value @name.trailing.startOf ) ) @_.domain @@ -329,7 +321,7 @@ value: (_) @value ) @_.domain -;;!! return 2; +;;!! return 0; ;;! ^ (expression_statement (return_expression diff --git a/queries/scala.scm b/queries/scala.scm index 01e2e8d2b3..c6338a9f1a 100644 --- a/queries/scala.scm +++ b/queries/scala.scm @@ -185,20 +185,34 @@ (_ name: (_) @name ) @name.domain - (#not-type? @name.domain simple_enum_case full_enum_case) + (#not-type? @name.domain simple_enum_case full_enum_case var_declaration val_declaration) ) +;;!! var foo: Int +;;! ^^^ +(var_declaration + name: (_) @name +) @name.domain @name.removal + +;;!! val foo: Int +;;! ^^^ +(val_declaration + name: (_) @name +) @name.domain @name.removal + ;;!! var foo = 0 ;;! ^^^ (var_definition pattern: (_) @name -) @name.domain + value: (_) @name.removal.end.startOf +) @name.domain @name.removal.start.startOf ;;!! val foo = 0 ;;! ^^^ (val_definition pattern: (_) @name -) @name.domain + value: (_) @name.removal.end.startOf +) @name.domain @name.removal.start.startOf (enum_case_definitions [ diff --git a/queries/talon-list.scm b/queries/talon-list.scm index f0cd88fe40..a9a872cdf2 100644 --- a/queries/talon-list.scm +++ b/queries/talon-list.scm @@ -15,8 +15,8 @@ ;;! ^^^^^ (_ left: _ @name @value.leading.endOf - right: (_) @value -) @_.domain + right: (_) @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf ;;!! not mode: command ;;! ^^^^^^^^ diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index 02c8590100..d7a0cf580c 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -216,19 +216,19 @@ ;;!! type Foo = Bar; ( (type_alias_declaration - name: (_) @value.leading.endOf - value: (_) @value - ) @value.domain - (#not-parent-type? @value.domain export_statement) + name: (_) @name @value.leading.endOf + value: (_) @value @name.removal.end.startOf + ) @_.domain @name.removal.start.startOf + (#not-parent-type? @_.domain export_statement) ) ;;!! export type Foo = Bar; (export_statement (type_alias_declaration - name: (_) @value.leading.endOf - value: (_) @value + name: (_) @name @value.leading.endOf + value: (_) @value @name.removal.end.startOf ) -) @value.domain +) @_.domain @name.removal.start.startOf [ (interface_declaration) From fdcb7091e61e15edc6a61bc71258c6172e5d8db5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 16:29:28 +0100 Subject: [PATCH 15/25] Updates scope facet in foe markdown --- .../scopes/c/name/name.field.class.scope | 56 ++++++++++++++----- .../scopes/c/name/name.field.class2.scope | 56 ++++++++++++++----- .../scopes/csharp/name/name.field.class.scope | 8 +-- .../csharp/name/name.field.interface.scope | 4 +- .../scopes/java/name/name.field.class.scope | 8 +-- .../java/name/name.field.interface.scope | 4 +- .../scopes/python/name/name.field.class.scope | 9 +-- .../scopes/scala/name/name.field.class.scope | 4 +- .../scala/name/name.field.interface.scope | 9 +-- data/scopeSupportFacetInfos.md | 37 +++++++----- 10 files changed, 127 insertions(+), 68 deletions(-) diff --git a/data/fixtures/scopes/c/name/name.field.class.scope b/data/fixtures/scopes/c/name/name.field.class.scope index 6e3ee80426..68e30328c0 100644 --- a/data/fixtures/scopes/c/name/name.field.class.scope +++ b/data/fixtures/scopes/c/name/name.field.class.scope @@ -1,20 +1,48 @@ -struct { int foo; }; +struct foo { + int bar; +}; --- -[Content] = 0:13-0:16 - >---< -0| struct { int foo; }; +[#1 Content] = 0:7-0:10 + >---< +0| struct foo { -[Removal] = 0:12-0:16 - >----< -0| struct { int foo; }; +[#1 Removal] = 0:7-0:11 + >----< +0| struct foo { -[Leading delimiter] = 0:12-0:13 - >-< -0| struct { int foo; }; +[#1 Leading delimiter] = 0:6-0:7 + >-< +0| struct foo { -[Domain] = 0:9-0:17 - >--------< -0| struct { int foo; }; +[#1 Trailing delimiter] = 0:10-0:11 + >-< +0| struct foo { -[Insertion delimiter] = " " +[#1 Domain] = 0:0-2:2 + >------------ +0| struct foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.field.class2.scope b/data/fixtures/scopes/c/name/name.field.class2.scope index 1e7993f440..f9a0e8082b 100644 --- a/data/fixtures/scopes/c/name/name.field.class2.scope +++ b/data/fixtures/scopes/c/name/name.field.class2.scope @@ -1,20 +1,48 @@ -union { int foo; }; +union foo { + int bar; +}; --- -[Content] = 0:12-0:15 - >---< -0| union { int foo; }; +[#1 Content] = 0:6-0:9 + >---< +0| union foo { -[Removal] = 0:11-0:15 - >----< -0| union { int foo; }; +[#1 Removal] = 0:6-0:10 + >----< +0| union foo { -[Leading delimiter] = 0:11-0:12 - >-< -0| union { int foo; }; +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| union foo { -[Domain] = 0:8-0:16 - >--------< -0| union { int foo; }; +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| union foo { -[Insertion delimiter] = " " +[#1 Domain] = 0:0-2:2 + >----------- +0| union foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.field.class.scope b/data/fixtures/scopes/csharp/name/name.field.class.scope index aab4cc8539..70e4b1860e 100644 --- a/data/fixtures/scopes/csharp/name/name.field.class.scope +++ b/data/fixtures/scopes/csharp/name/name.field.class.scope @@ -35,8 +35,8 @@ class Foo { >---< 1| int bar; -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = 1:4-1:11 + >-------< 1| int bar; [#2 Leading delimiter] = 1:7-1:8 @@ -54,8 +54,8 @@ class Foo { >---< 2| int baz = 0; -[#3 Removal] = 2:8-2:12 - >----< +[#3 Removal] = 2:4-2:14 + >----------< 2| int baz = 0; [#3 Leading delimiter] = 2:7-2:8 diff --git a/data/fixtures/scopes/csharp/name/name.field.interface.scope b/data/fixtures/scopes/csharp/name/name.field.interface.scope index 94cb5a92cd..6899149376 100644 --- a/data/fixtures/scopes/csharp/name/name.field.interface.scope +++ b/data/fixtures/scopes/csharp/name/name.field.interface.scope @@ -33,8 +33,8 @@ interface IFoo { >---< 1| int bar; -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = 1:4-1:11 + >-------< 1| int bar; [#2 Leading delimiter] = 1:7-1:8 diff --git a/data/fixtures/scopes/java/name/name.field.class.scope b/data/fixtures/scopes/java/name/name.field.class.scope index da0b260bf5..ef5f13f58e 100644 --- a/data/fixtures/scopes/java/name/name.field.class.scope +++ b/data/fixtures/scopes/java/name/name.field.class.scope @@ -35,8 +35,8 @@ public class Foo { >---< 1| private int bar; -[#2 Removal] = 1:15-1:19 - >----< +[#2 Removal] = 1:4-1:19 + >---------------< 1| private int bar; [#2 Leading delimiter] = 1:15-1:16 @@ -54,8 +54,8 @@ public class Foo { >---< 2| private int baz = 0; -[#3 Removal] = 2:16-2:20 - >----< +[#3 Removal] = 2:4-2:22 + >------------------< 2| private int baz = 0; [#3 Leading delimiter] = 2:15-2:16 diff --git a/data/fixtures/scopes/java/name/name.field.interface.scope b/data/fixtures/scopes/java/name/name.field.interface.scope index 5aa2e06bca..70b5cb5271 100644 --- a/data/fixtures/scopes/java/name/name.field.interface.scope +++ b/data/fixtures/scopes/java/name/name.field.interface.scope @@ -33,8 +33,8 @@ public interface Foo { >---< 1| private int bar; -[#2 Removal] = 1:15-1:19 - >----< +[#2 Removal] = 1:4-1:19 + >---------------< 1| private int bar; [#2 Leading delimiter] = 1:15-1:16 diff --git a/data/fixtures/scopes/python/name/name.field.class.scope b/data/fixtures/scopes/python/name/name.field.class.scope index 151e029596..2f6f7c8855 100644 --- a/data/fixtures/scopes/python/name/name.field.class.scope +++ b/data/fixtures/scopes/python/name/name.field.class.scope @@ -29,18 +29,15 @@ class Foo: >---< 1| bar: int -[#2 Removal] = 1:0-1:7 - >-------< +[#2 Removal] = +[#2 Domain] = 1:4-1:12 + >--------< 1| bar: int [#2 Leading delimiter] = 1:0-1:4 >----< 1| bar: int -[#2 Domain] = 1:4-1:12 - >--------< -1| bar: int - [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/name/name.field.class.scope b/data/fixtures/scopes/scala/name/name.field.class.scope index d92efe371a..49f46c01c6 100644 --- a/data/fixtures/scopes/scala/name/name.field.class.scope +++ b/data/fixtures/scopes/scala/name/name.field.class.scope @@ -33,8 +33,8 @@ class Foo { . >---< 1| val bar = 0 -[#2 Removal] = 1:8-1:12 - >----< +[#2 Removal] = 1:4-1:14 + >----------< 1| val bar = 0 [#2 Leading delimiter] = 1:7-1:8 diff --git a/data/fixtures/scopes/scala/name/name.field.interface.scope b/data/fixtures/scopes/scala/name/name.field.interface.scope index cc7fddf3dc..c52ada5f31 100644 --- a/data/fixtures/scopes/scala/name/name.field.interface.scope +++ b/data/fixtures/scopes/scala/name/name.field.interface.scope @@ -33,16 +33,13 @@ trait Foo { >---< 1| val bar: Int -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = +[#2 Domain] = 1:4-1:16 + >------------< 1| val bar: Int [#2 Leading delimiter] = 1:7-1:8 >-< 1| val bar: Int -[#2 Domain] = 1:4-1:16 - >------------< -1| val bar: Int - [#2 Insertion delimiter] = " " diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 199fc5284b..0320e001f1 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -228,9 +228,10 @@ - `name.argument.formal.method` Name of a parameter in a class method declaration - `name.argument.formal.method.iteration` Iteration scope for names of formal parameters in a method declaration: the parameters list. The domain should be the entire method. - `name.assignment` Name (LHS) of an assignment -- `name.assignment.pattern` LHS of an assignment with pattern destructuring +- `name.assignment.destructuring` LHS of an assignment with pattern destructuring - `name.class` Name of a class - `name.command` LHS of a command, eg Talon spoken command or bash +- `name.constant` Name (LHS) of a constant declaration - `name.constructor` Name of a constructor - `name.enum` Name of an enum - `name.field.class` Name (LHS) of a field in a class @@ -248,8 +249,9 @@ - `name.namespace` Name of a namespace - `name.resource` Name in a 'with' / 'use' / 'using' statement - `name.resource.iteration` Iteration scope for names in a 'with' / 'use' / 'using' statement: the resource list. The domain should be the entire statement. -- `name.variable` Name (LHS) of a variable declaration -- `name.variable.pattern` Name (LHS) of a variable declaration with pattern destructuring +- `name.variable.destructuring` Name (LHS) of a variable declaration with pattern destructuring +- `name.variable.initialized` Name (LHS) of an initialized variable declaration +- `name.variable.uninitialized` Name (LHS) of an uninitialized variable declaration ### namedFunction @@ -300,9 +302,11 @@ ### statement - `statement.assignment` An assignment statement +- `statement.assignment.destructuring` An assignment statement with pattern destructuring - `statement.break` A break statement - `statement.class` A class/struct declaration - `statement.command` A command statement, eg Talon spoken command or bash +- `statement.constant` A constant declaration - `statement.constructor` A constructor declaration - `statement.continue` A continue statement - `statement.doWhile` A do-while loop statement @@ -326,7 +330,9 @@ - `statement.static` A static statement - `statement.switch` A switch statement - `statement.try` A try/catch/finally statement -- `statement.variable` A variable declaration +- `statement.variable.destructuring` A variable declaration pattern destructuring +- `statement.variable.initialized` An initialized variable declaration +- `statement.variable.uninitialized` An uninitialized variable declaration - `statement.while` A while loop statement - `statement.yield` A yield statement @@ -359,19 +365,20 @@ ### type - `type.alias` A type alias declaration -- `type.argument.catch` Type of parameter in a catch clause -- `type.argument.formal` Type of formal parameter in a function declaration -- `type.argument.formal.constructor` Type of formal parameter in a constructor declaration +- `type.argument.catch` Type of a parameter in a catch clause +- `type.argument.formal` Type of a formal parameter in a function declaration +- `type.argument.formal.constructor` Type of a formal parameter in a constructor declaration - `type.argument.formal.constructor.iteration` Iteration scope for types of formal parameters in a constructor declaration: the parameters list. The domain should be the entire constructor. - `type.argument.formal.iteration` Iteration scope for types of formal parameters in a function declaration: the parameters list. The domain should be the entire function. -- `type.argument.formal.method` Type of formal parameter in a class method declaration +- `type.argument.formal.method` Type of a formal parameter in a class method declaration - `type.argument.formal.method.iteration` Iteration scope for types of formal parameters in a method declaration: the parameters list. The domain should be the entire method. - `type.cast` A type cast - `type.class` A class declaration +- `type.constant` Type of a constant declaration - `type.enum` An enum declaration -- `type.field.class` Type of field in a class -- `type.field.interface` Type of field in a interface -- `type.foreach` Type of variable in a for each loop +- `type.field.class` Type of a field in a class +- `type.field.interface` Type of a field in a interface +- `type.foreach` Type of a variable in a for each loop - `type.interface` An interface declaration - `type.iteration.block` Iteration scope for types: statement blocks (body of functions/if-statements/for-loops/etc). - `type.iteration.class` Iteration scope for types: class bodies. @@ -379,10 +386,11 @@ - `type.iteration.interface` Iteration scope for types: interface bodies. - `type.resource` Type in a 'with' / 'use' / 'using' statement - `type.resource.iteration` Iteration scope for types in a 'with' / 'use' / 'using' statement: the resource list. The domain should be the entire statement. -- `type.return` Type of return value in a function declaration +- `type.return` Type of a return value in a function declaration - `type.typeArgument` Type argument to a generic / parametrized type - `type.typeArgument.iteration` Iteration scope for type arguments to a generic / parametrized type: the type argument list. -- `type.variable` Type of variable in a variable declaration +- `type.variable.initialized` Type of an initialized variable declaration +- `type.variable.uninitialized` Type of an uninitialized variable declaration ### unit @@ -405,6 +413,7 @@ - `value.assignment` Value (RHS) of an assignment - `value.attribute` Value (RHS) of an attribute eg in a xml element - `value.command` Value (RHS) of an command, eg Talon spoken command +- `value.constant` Value (RHS) of a constant declaration - `value.field.class` Value (RHS) of a field in a class - `value.field.enum` Value (RHS) of a field in an enum - `value.foreach` Iterable in a for each loop @@ -421,7 +430,7 @@ - `value.switch` The value / subject of a switch statement - `value.typeAlias` Value of a type alias declaration - `value.variable` Value (RHS) of a variable declaration -- `value.variable.pattern` Value (RHS) of a variable declaration with pattern destructuring +- `value.variable.destructuring` Value (RHS) of a variable declaration with pattern destructuring - `value.yield` Value of a yield statement ### word From 5b5a3405f60a895aa905432a03d13fe1cfaaae99 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 16:46:38 +0100 Subject: [PATCH 16/25] Fix python --- .../scopes/c/name/name.field.class.scope | 9 +++----- .../scopes/c/name/name.field.class2.scope | 9 +++----- .../scopes/cpp/name/name.field.class.scope | 21 +++++++------------ queries/c.scm | 5 +++-- queries/cpp.scm | 7 ++++--- queries/python.scm | 4 ++-- 6 files changed, 22 insertions(+), 33 deletions(-) diff --git a/data/fixtures/scopes/c/name/name.field.class.scope b/data/fixtures/scopes/c/name/name.field.class.scope index 68e30328c0..ba9ddb2d64 100644 --- a/data/fixtures/scopes/c/name/name.field.class.scope +++ b/data/fixtures/scopes/c/name/name.field.class.scope @@ -33,16 +33,13 @@ struct foo { >---< 1| int bar; -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = +[#2 Domain] = 1:4-1:12 + >--------< 1| int bar; [#2 Leading delimiter] = 1:7-1:8 >-< 1| int bar; -[#2 Domain] = 1:4-1:12 - >--------< -1| int bar; - [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/name/name.field.class2.scope b/data/fixtures/scopes/c/name/name.field.class2.scope index f9a0e8082b..dcbb88eb80 100644 --- a/data/fixtures/scopes/c/name/name.field.class2.scope +++ b/data/fixtures/scopes/c/name/name.field.class2.scope @@ -33,16 +33,13 @@ union foo { >---< 1| int bar; -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = +[#2 Domain] = 1:4-1:12 + >--------< 1| int bar; [#2 Leading delimiter] = 1:7-1:8 >-< 1| int bar; -[#2 Domain] = 1:4-1:12 - >--------< -1| int bar; - [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.field.class.scope b/data/fixtures/scopes/cpp/name/name.field.class.scope index 91f93b5cc5..3758bdddea 100644 --- a/data/fixtures/scopes/cpp/name/name.field.class.scope +++ b/data/fixtures/scopes/cpp/name/name.field.class.scope @@ -35,18 +35,15 @@ class Foo { >---< 1| int bar; -[#2 Removal] = 1:7-1:11 - >----< +[#2 Removal] = +[#2 Domain] = 1:4-1:12 + >--------< 1| int bar; [#2 Leading delimiter] = 1:7-1:8 >-< 1| int bar; -[#2 Domain] = 1:4-1:12 - >--------< -1| int bar; - [#2 Insertion delimiter] = " " @@ -54,16 +51,12 @@ class Foo { >---< 2| int baz = 1; -[#3 Removal] = 2:8-2:12 - >----< +[#3 Removal] = 2:4-2:14 + >----------< 2| int baz = 1; -[#3 Leading delimiter] = 2:7-2:8 - >-< -2| int baz = 1; - -[#3 Trailing delimiter] = 2:11-2:12 - >-< +[#3 Leading delimiter] = 2:8-2:11 + >---< 2| int baz = 1; [#3 Domain] = 2:4-2:16 diff --git a/queries/c.scm b/queries/c.scm index 0586d11c16..7e718ce153 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -172,13 +172,14 @@ declarator: (_ !declarator ) @name -) @statement @name.domain + . +) @statement @name.domain @name.removal (field_declaration declarator: (_ declarator: (_) @name ) -) @statement @name.domain +) @statement @name.domain @name.removal (initializer_list) @list diff --git a/queries/cpp.scm b/queries/cpp.scm index 86fea784a1..61b74fd73f 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -44,11 +44,12 @@ ) @_.domain ;;!! int aaa = 0; +;;! ^^^ ;;! ^ (field_declaration - declarator: (_) @_.leading.endOf - default_value: (_) @value -) @_.domain + declarator: (_) @name @_.leading.endOf + default_value: (_) @value @name.removal.end.startOf +) @_.domain @name.removal.start.startOf ;;!! []() {} ;;! ^^^^^^^ diff --git a/queries/python.scm b/queries/python.scm index 367bd6ad70..178427524c 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -46,7 +46,7 @@ ;;! ^^^ ;;! ^ (assignment - left: (_) @name + left: (_) @name @value.leading.endOf !type right: (_)? @value @name.trailing.end.startOf ) @_.domain @@ -56,7 +56,7 @@ ;;! ^ (assignment left: (_) @name - type: (_) @name.removal.end.endOf + type: (_) @name.removal.end.endOf @value.leading.endOf right: (_)? @value @name.removal.end.startOf ) @_.domain @name.removal.start.startOf From fdfad5302a421d293a9cb6808fa6ec80197498d5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 17:15:27 +0100 Subject: [PATCH 17/25] javascript --- .../javascript.core/name/name.method4.scope | 14 ++++++++++---- .../scopes/php/name/name.field.class.scope | 8 ++++---- .../scopes/rust/name/name.field.class.scope | 9 +++------ queries/javascript.scm | 18 ++++++++++++++++-- queries/php.scm | 8 +++++--- queries/rust.scm | 2 +- 6 files changed, 39 insertions(+), 20 deletions(-) diff --git a/data/fixtures/scopes/javascript.core/name/name.method4.scope b/data/fixtures/scopes/javascript.core/name/name.method4.scope index 2c13166d2f..00228ef0af 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method4.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method4.scope @@ -35,12 +35,18 @@ class Foo { >---< 2| bar = () => {} -[#2 Removal] = 2:4-2:10 - >------< +[#2 Removal] = 1:4-2:10 + >---- +1| @baz +2| bar = () => {} + ----------< + +[#2 Leading delimiter] = 2:0-2:4 + >----< 2| bar = () => {} -[#2 Trailing delimiter] = 2:7-2:10 - >---< +[#2 Trailing delimiter] = 2:7-2:8 + >-< 2| bar = () => {} [#2 Domain] = 1:4-2:18 diff --git a/data/fixtures/scopes/php/name/name.field.class.scope b/data/fixtures/scopes/php/name/name.field.class.scope index ab1085f671..144115fde5 100644 --- a/data/fixtures/scopes/php/name/name.field.class.scope +++ b/data/fixtures/scopes/php/name/name.field.class.scope @@ -36,8 +36,8 @@ class Foo { >----< 2| public number $bar; -[#2 Removal] = 2:17-2:22 - >-----< +[#2 Removal] = 2:4-2:22 + >------------------< 2| public number $bar; [#2 Leading delimiter] = 2:17-2:18 @@ -55,8 +55,8 @@ class Foo { >----< 3| public $baz = 0; -[#3 Removal] = 3:11-3:16 - >-----< +[#3 Removal] = 3:4-3:18 + >--------------< 3| public $baz = 0; [#3 Leading delimiter] = 3:10-3:11 diff --git a/data/fixtures/scopes/rust/name/name.field.class.scope b/data/fixtures/scopes/rust/name/name.field.class.scope index 4b850b0b22..4c187d6fb0 100644 --- a/data/fixtures/scopes/rust/name/name.field.class.scope +++ b/data/fixtures/scopes/rust/name/name.field.class.scope @@ -33,16 +33,13 @@ struct Foo { >---< 1| bar: i32 -[#2 Removal] = 1:0-1:7 - >-------< +[#2 Removal] = +[#2 Domain] = 1:4-1:12 + >--------< 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/queries/javascript.scm b/queries/javascript.scm index 857c6c8b4a..93796792c8 100644 --- a/queries/javascript.scm +++ b/queries/javascript.scm @@ -79,9 +79,10 @@ ) (_ - ;;!! foo = ...; - ;;! ^^^------- + ;;!! foo = 0; + ;;! ^^^ (field_definition + . property: (_) @name @value.leading.endOf value: (_)? @value @name.trailing.startOf ) @statement.start @_.domain.start @@ -89,6 +90,19 @@ ";"? @statement.end @_.domain.end ) +(_ + ;;!! [at]baz foo = 0; + ;;! ^^^ + (field_definition + . + (_) @name.removal.start.startOf + property: (_) @name @name.removal.end.startOf @value.leading.endOf + value: (_)? @value @name.removal.end.startOf + ) @statement.start @_.domain.start + . + ";"? @statement.end @_.domain.end +) + ;;!! foo(name) {} ;;! ^^^^ (formal_parameters diff --git a/queries/php.scm b/queries/php.scm index 455f40c669..e72f4fe7de 100644 --- a/queries/php.scm +++ b/queries/php.scm @@ -265,10 +265,12 @@ ;;! ^^^^^^ ;;! ^^^^^^ (property_declaration - type: (_)? @type + (_)? @name.removal.start.startOf + type: (_)? @type @name.removal.start.startOf (property_element - (variable_name) @name - ) + name: (_) @name @name.removal.end.endOf @value.leading.endOf + default_value: (_)? @value @name.removal.end.startOf + ) @name.removal.start.startOf ) @_.domain operator: [ diff --git a/queries/rust.scm b/queries/rust.scm index ef1e025352..f8b9c4acf5 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -207,7 +207,7 @@ (field_declaration name: (_) @name @type.leading.endOf type: (_) @type -) @statement @_.domain +) @statement @_.domain @name.removal ;;!! (t: &T, u: &U) ;;! ^ ^ From d6b4d278d3725ec1b4439f7b835fa320c5315aa8 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 17:31:19 +0100 Subject: [PATCH 18/25] More clean up --- .../name/name.field.class.scope | 38 +++++++++++--- .../name/name.field.class2.scope | 52 ------------------- .../javascript.core/name/name.method4.scope | 8 +-- .../name/name.field.class.scope | 35 +++++++++++-- queries/typescript.core.scm | 12 ++--- 5 files changed, 70 insertions(+), 75 deletions(-) delete mode 100644 data/fixtures/scopes/javascript.core/name/name.field.class2.scope diff --git a/data/fixtures/scopes/javascript.core/name/name.field.class.scope b/data/fixtures/scopes/javascript.core/name/name.field.class.scope index 633fe566bd..0874562796 100644 --- a/data/fixtures/scopes/javascript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/javascript.core/name/name.field.class.scope @@ -1,6 +1,8 @@ class Foo { bar; baz = 0; + @Dec + bongo = 0; } --- @@ -20,25 +22,24 @@ class Foo { >-< 0| class Foo { -[#1 Domain] = 0:0-3:1 +[#1 Domain] = 0:0-5:1 >----------- 0| class Foo { 1| bar; 2| baz = 0; -3| } +3| @Dec +4| bongo = 0; +5| } -< [#1 Insertion delimiter] = " " -[#2 Content] = 1:4-1:7 +[#2 Content] = +[#2 Removal] = 1:4-1:7 >---< 1| bar; -[#2 Removal] = 1:0-1:7 - >-------< -1| bar; - [#2 Leading delimiter] = 1:0-1:4 >----< 1| bar; @@ -67,3 +68,26 @@ class Foo { 2| baz = 0; [#3 Insertion delimiter] = " " + + +[#4 Content] = 4:4-4:9 + >-----< +4| bongo = 0; + +[#4 Removal] = 3:4-4:12 + >---- +3| @Dec +4| bongo = 0; + ------------< + +[#4 Trailing delimiter] = 4:9-4:12 + >---< +4| bongo = 0; + +[#4 Domain] = 3:4-4:14 + >---- +3| @Dec +4| bongo = 0; + --------------< + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.field.class2.scope b/data/fixtures/scopes/javascript.core/name/name.field.class2.scope deleted file mode 100644 index f71e2ad583..0000000000 --- a/data/fixtures/scopes/javascript.core/name/name.field.class2.scope +++ /dev/null @@ -1,52 +0,0 @@ -class Foo { - @baz - bar = 0; -} ---- - -[#1 Content] = 0:6-0:9 - >---< -0| class Foo { - -[#1 Removal] = 0:6-0:10 - >----< -0| class Foo { - -[#1 Leading delimiter] = 0:5-0:6 - >-< -0| class Foo { - -[#1 Trailing delimiter] = 0:9-0:10 - >-< -0| class Foo { - -[#1 Domain] = 0:0-3:1 - >----------- -0| class Foo { -1| @baz -2| bar = 0; -3| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 2:4-2:7 - >---< -2| bar = 0; - -[#2 Removal] = 2:4-2:10 - >------< -2| bar = 0; - -[#2 Trailing delimiter] = 2:7-2:10 - >---< -2| bar = 0; - -[#2 Domain] = 1:4-2:12 - >---- -1| @baz -2| bar = 0; - ------------< - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method4.scope b/data/fixtures/scopes/javascript.core/name/name.method4.scope index 00228ef0af..0521099027 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method4.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method4.scope @@ -41,12 +41,8 @@ class Foo { 2| bar = () => {} ----------< -[#2 Leading delimiter] = 2:0-2:4 - >----< -2| bar = () => {} - -[#2 Trailing delimiter] = 2:7-2:8 - >-< +[#2 Trailing delimiter] = 2:7-2:10 + >---< 2| bar = () => {} [#2 Domain] = 1:4-2:18 diff --git a/data/fixtures/scopes/typescript.core/name/name.field.class.scope b/data/fixtures/scopes/typescript.core/name/name.field.class.scope index e1c039904a..e11a401586 100644 --- a/data/fixtures/scopes/typescript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/typescript.core/name/name.field.class.scope @@ -1,6 +1,8 @@ class Foo { bar: number; baz = 0; + @Dec + bongo: number = 0; } --- @@ -20,12 +22,14 @@ class Foo { >-< 0| class Foo { -[#1 Domain] = 0:0-3:1 +[#1 Domain] = 0:0-5:1 >----------- 0| class Foo { 1| bar: number; 2| baz = 0; -3| } +3| @Dec +4| bongo: number = 0; +5| } -< [#1 Insertion delimiter] = " " @@ -35,8 +39,8 @@ class Foo { >---< 1| bar: number; -[#2 Removal] = 1:0-1:7 - >-------< +[#2 Removal] = 1:4-1:15 + >-----------< 1| bar: number; [#2 Leading delimiter] = 1:0-1:4 @@ -67,3 +71,26 @@ class Foo { 2| baz = 0; [#3 Insertion delimiter] = " " + + +[#4 Content] = 4:4-4:9 + >-----< +4| bongo: number = 0; + +[#4 Removal] = 3:4-4:20 + >---- +3| @Dec +4| bongo: number = 0; + --------------------< + +[#4 Leading delimiter] = 4:0-4:4 + >----< +4| bongo: number = 0; + +[#4 Domain] = 3:4-4:22 + >---- +3| @Dec +4| bongo: number = 0; + ----------------------< + +[#4 Insertion delimiter] = " " diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index d7a0cf580c..9e9246f51f 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -190,10 +190,10 @@ ;;!! (public | private | protected) foo = ...; ;;! ----------------------------------------- (public_field_definition - name: (_) @name @value.leading.endOf + name: (_) @name @name.removal.end.endOf @value.leading.endOf !type - value: (_)? @value @name.trailing.startOf - ) @_.domain.start + value: (_)? @value @name.trailing.startOf @name.removal.end.startOf + ) @_.domain.start @name.removal.start.startOf . ";"? @_.domain.end ) @@ -206,9 +206,9 @@ type: (_ ":" (_) @type - ) @value.leading.endOf - value: (_)? @value - ) @_.domain.start + ) @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf + ) @_.domain.start @name.removal.start.startOf . ";"? @_.domain.end ) From b922c4e5f4741934ae6100a252bb4d1849405ea9 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 17:57:37 +0100 Subject: [PATCH 19/25] js fix --- .../scopes/java/name/name.field.class.scope | 29 +++++++++++++- .../name/name.field.class.scope | 38 ++++++++----------- .../name/name.field.class.scope | 38 ++++++++----------- queries/javascript.scm | 20 ++-------- 4 files changed, 62 insertions(+), 63 deletions(-) diff --git a/data/fixtures/scopes/java/name/name.field.class.scope b/data/fixtures/scopes/java/name/name.field.class.scope index ef5f13f58e..74d83ca0bf 100644 --- a/data/fixtures/scopes/java/name/name.field.class.scope +++ b/data/fixtures/scopes/java/name/name.field.class.scope @@ -1,6 +1,7 @@ public class Foo { private int bar; private int baz = 0; + @Att int bongo = 0; } --- @@ -20,12 +21,13 @@ public class Foo { >-< 0| public class Foo { -[#1 Domain] = 0:0-3:1 +[#1 Domain] = 0:0-4:1 >------------------ 0| public class Foo { 1| private int bar; 2| private int baz = 0; -3| } +3| @Att int bongo = 0; +4| } -< [#1 Insertion delimiter] = " " @@ -71,3 +73,26 @@ public class Foo { 2| private int baz = 0; [#3 Insertion delimiter] = " " + + +[#4 Content] = 3:13-3:18 + >-----< +3| @Att int bongo = 0; + +[#4 Removal] = 3:4-3:21 + >-----------------< +3| @Att int bongo = 0; + +[#4 Leading delimiter] = 3:12-3:13 + >-< +3| @Att int bongo = 0; + +[#4 Trailing delimiter] = 3:18-3:19 + >-< +3| @Att int bongo = 0; + +[#4 Domain] = 3:4-3:23 + >-------------------< +3| @Att int bongo = 0; + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.field.class.scope b/data/fixtures/scopes/javascript.core/name/name.field.class.scope index 0874562796..e02e47a825 100644 --- a/data/fixtures/scopes/javascript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/javascript.core/name/name.field.class.scope @@ -1,8 +1,7 @@ class Foo { bar; baz = 0; - @Dec - bongo = 0; + @Att bongo = 0; } --- @@ -22,14 +21,13 @@ class Foo { >-< 0| class Foo { -[#1 Domain] = 0:0-5:1 +[#1 Domain] = 0:0-4:1 >----------- 0| class Foo { 1| bar; 2| baz = 0; -3| @Dec -4| bongo = 0; -5| } +3| @Att bongo = 0; +4| } -< [#1 Insertion delimiter] = " " @@ -70,24 +68,20 @@ class Foo { [#3 Insertion delimiter] = " " -[#4 Content] = 4:4-4:9 - >-----< -4| bongo = 0; +[#4 Content] = 3:9-3:14 + >-----< +3| @Att bongo = 0; -[#4 Removal] = 3:4-4:12 - >---- -3| @Dec -4| bongo = 0; - ------------< +[#4 Removal] = 3:4-3:17 + >-------------< +3| @Att bongo = 0; -[#4 Trailing delimiter] = 4:9-4:12 - >---< -4| bongo = 0; +[#4 Trailing delimiter] = 3:14-3:17 + >---< +3| @Att bongo = 0; -[#4 Domain] = 3:4-4:14 - >---- -3| @Dec -4| bongo = 0; - --------------< +[#4 Domain] = 3:4-3:19 + >---------------< +3| @Att bongo = 0; [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.field.class.scope b/data/fixtures/scopes/typescript.core/name/name.field.class.scope index e11a401586..0809dadc8a 100644 --- a/data/fixtures/scopes/typescript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/typescript.core/name/name.field.class.scope @@ -1,8 +1,7 @@ class Foo { bar: number; baz = 0; - @Dec - bongo: number = 0; + @Att bongo: number = 0; } --- @@ -22,14 +21,13 @@ class Foo { >-< 0| class Foo { -[#1 Domain] = 0:0-5:1 +[#1 Domain] = 0:0-4:1 >----------- 0| class Foo { 1| bar: number; 2| baz = 0; -3| @Dec -4| bongo: number = 0; -5| } +3| @Att bongo: number = 0; +4| } -< [#1 Insertion delimiter] = " " @@ -73,24 +71,20 @@ class Foo { [#3 Insertion delimiter] = " " -[#4 Content] = 4:4-4:9 - >-----< -4| bongo: number = 0; +[#4 Content] = 3:9-3:14 + >-----< +3| @Att bongo: number = 0; -[#4 Removal] = 3:4-4:20 - >---- -3| @Dec -4| bongo: number = 0; - --------------------< +[#4 Removal] = 3:4-3:25 + >---------------------< +3| @Att bongo: number = 0; -[#4 Leading delimiter] = 4:0-4:4 - >----< -4| bongo: number = 0; +[#4 Leading delimiter] = 3:8-3:9 + >-< +3| @Att bongo: number = 0; -[#4 Domain] = 3:4-4:22 - >---- -3| @Dec -4| bongo: number = 0; - ----------------------< +[#4 Domain] = 3:4-3:27 + >-----------------------< +3| @Att bongo: number = 0; [#4 Insertion delimiter] = " " diff --git a/queries/javascript.scm b/queries/javascript.scm index 93796792c8..cbc4109b8a 100644 --- a/queries/javascript.scm +++ b/queries/javascript.scm @@ -82,23 +82,9 @@ ;;!! foo = 0; ;;! ^^^ (field_definition - . - property: (_) @name @value.leading.endOf - value: (_)? @value @name.trailing.startOf - ) @statement.start @_.domain.start - . - ";"? @statement.end @_.domain.end -) - -(_ - ;;!! [at]baz foo = 0; - ;;! ^^^ - (field_definition - . - (_) @name.removal.start.startOf - property: (_) @name @name.removal.end.startOf @value.leading.endOf - value: (_)? @value @name.removal.end.startOf - ) @statement.start @_.domain.start + property: (_) @name @name.removal.end.endOf @value.leading.endOf + value: (_)? @value @name.trailing.startOf @name.removal.end.startOf + ) @statement.start @_.domain.start @name.removal.start.startOf . ";"? @statement.end @_.domain.end ) From c1c03ebd8048bf1a7a849449bdb2b4c196927422 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 18:16:29 +0100 Subject: [PATCH 20/25] added missing --- .../scopes/go/name/name.constant.scope | 24 +++++++++++++++++++ .../go/statement/statement.constant.scope | 10 ++++++++ .../scopes/go/type/type.constant.scope | 24 +++++++++++++++++++ .../scopes/go/value/value.constant.scope | 20 ++++++++++++++++ packages/common/src/scopeSupportFacets/c.ts | 2 ++ .../common/src/scopeSupportFacets/csharp.ts | 2 ++ packages/common/src/scopeSupportFacets/css.ts | 2 ++ packages/common/src/scopeSupportFacets/go.ts | 10 ++++++-- .../common/src/scopeSupportFacets/html.ts | 2 ++ .../common/src/scopeSupportFacets/java.ts | 2 ++ .../common/src/scopeSupportFacets/json.ts | 2 ++ .../common/src/scopeSupportFacets/kotlin.ts | 1 + .../common/src/scopeSupportFacets/latex.ts | 2 ++ .../common/src/scopeSupportFacets/markdown.ts | 2 ++ .../src/scopeSupportFacets/properties.ts | 2 ++ packages/common/src/scopeSupportFacets/scm.ts | 2 ++ .../common/src/scopeSupportFacets/talon.ts | 2 ++ .../src/scopeSupportFacets/talonList.ts | 2 ++ packages/common/src/scopeSupportFacets/xml.ts | 2 ++ .../common/src/scopeSupportFacets/yaml.ts | 2 ++ queries/go.scm | 23 ++++++++++++++++++ 21 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 data/fixtures/scopes/go/name/name.constant.scope create mode 100644 data/fixtures/scopes/go/statement/statement.constant.scope create mode 100644 data/fixtures/scopes/go/type/type.constant.scope create mode 100644 data/fixtures/scopes/go/value/value.constant.scope diff --git a/data/fixtures/scopes/go/name/name.constant.scope b/data/fixtures/scopes/go/name/name.constant.scope new file mode 100644 index 0000000000..a57b6bfe63 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.constant.scope @@ -0,0 +1,24 @@ +const foo int = 0 +--- + +[Content] = 0:6-0:9 + >---< +0| const foo int = 0 + +[Removal] = 0:0-0:16 + >----------------< +0| const foo int = 0 + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo int = 0 + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const foo int = 0 + +[Domain] = 0:0-0:17 + >-----------------< +0| const foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/statement/statement.constant.scope b/data/fixtures/scopes/go/statement/statement.constant.scope new file mode 100644 index 0000000000..bb32ec7fb0 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.constant.scope @@ -0,0 +1,10 @@ +const foo int = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| const foo int = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/type/type.constant.scope b/data/fixtures/scopes/go/type/type.constant.scope new file mode 100644 index 0000000000..07aa95e670 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.constant.scope @@ -0,0 +1,24 @@ +const foo int = 0 +--- + +[Content] = 0:10-0:13 + >---< +0| const foo int = 0 + +[Removal] = 0:10-0:14 + >----< +0| const foo int = 0 + +[Leading delimiter] = 0:9-0:10 + >-< +0| const foo int = 0 + +[Trailing delimiter] = 0:13-0:14 + >-< +0| const foo int = 0 + +[Domain] = 0:0-0:17 + >-----------------< +0| const foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.constant.scope b/data/fixtures/scopes/go/value/value.constant.scope new file mode 100644 index 0000000000..7f34604dfe --- /dev/null +++ b/data/fixtures/scopes/go/value/value.constant.scope @@ -0,0 +1,20 @@ +const foo int = 0 +--- + +[Content] = 0:16-0:17 + >-< +0| const foo int = 0 + +[Removal] = 0:13-0:17 + >----< +0| const foo int = 0 + +[Leading delimiter] = 0:13-0:16 + >---< +0| const foo int = 0 + +[Domain] = 0:0-0:17 + >-----------------< +0| const foo int = 0 + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index cc7b4763cf..c0bb1a9a4b 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -189,6 +189,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index e3c083efbb..b439c520a8 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -266,6 +266,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.resource.iteration": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index b3120055aa..f143348018 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -49,7 +49,9 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index e363d5a339..a683784ac1 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -25,9 +25,10 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "statement.switch": supported, "statement.for": supported, "statement.foreach": supported, + "statement.assignment": supported, + "statement.constant": supported, "statement.variable.uninitialized": supported, "statement.variable.initialized": supported, - "statement.assignment": supported, "statement.return": supported, "statement.break": supported, "statement.continue": supported, @@ -109,6 +110,7 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "condition.switchCase.iteration": supported, "name.assignment": supported, + "name.constant": supported, "name.variable.uninitialized": supported, "name.variable.initialized": supported, "name.foreach": supported, @@ -131,6 +133,7 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "key.mapPair.iteration": supported, "value.assignment": supported, + "value.constant": supported, "value.variable": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, @@ -141,6 +144,7 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.block": supported, "value.iteration.document": supported, + "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, "type.argument.formal": supported, @@ -308,9 +312,11 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.interface": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, + "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, - "name.assignment.destructuring": notApplicable, // Miscellaneous "statement.misc": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 4b7e9e230a..d562b23591 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -23,7 +23,9 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 804a8201de..502a0331ef 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -251,6 +251,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual.iteration": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index d902c05570..4a36c0a9a3 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -26,7 +26,9 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index 92303a2746..869aec4ec3 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -308,5 +308,6 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "class.iteration.block": notApplicable, "type.cast": notApplicable, "statement.misc": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index 0e1730f574..26c5f16218 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -37,7 +37,9 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 348114403b..f0021b08d4 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -27,7 +27,9 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 24cdefee9a..d7d630fd30 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -236,6 +236,8 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "value.resource.iteration": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index bd2c844382..ef8a518cc3 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -28,7 +28,9 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index aa0dc78e2a..9a48cba82b 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -264,6 +264,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.resource.iteration": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index 7c34c55398..30696adfb1 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -239,6 +239,8 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "value.resource.iteration": notApplicable, // Pattern destructuring + "statement.variable.destructuring": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.destructuring": notApplicable, "value.variable.destructuring": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 6ab867d005..e34a14dad8 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -23,7 +23,9 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 279881a248..89362390f3 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -32,7 +32,9 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { // Variable "statement.variable.uninitialized": notApplicable, "statement.variable.initialized": notApplicable, + "statement.variable.destructuring": notApplicable, "statement.assignment": notApplicable, + "statement.assignment.destructuring": notApplicable, "name.assignment": notApplicable, "name.assignment.destructuring": notApplicable, "name.variable.uninitialized": notApplicable, diff --git a/queries/go.scm b/queries/go.scm index b77821a996..df358c9cf0 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -479,6 +479,29 @@ ) ) @_.domain @name.removal.start.startOf +;;!! const foo int = 0 +;;! ^^^ +;;! ^^^ +;;! ^ +(const_declaration + (const_spec + name: (_) @name + type: (_) @type @value.leading.endOf @name.removal.end.endOf + value: (_)? @value @name.removal.end.startOf + ) +) @_.domain @name.removal.start.startOf + +;;!! const foo = 0 +;;! ^^^ +;;! ^ +(const_declaration + (const_spec + name: (_) @name @value.leading.endOf + !type + value: (_) @value @name.removal.end.startOf + ) +) @_.domain @name.removal.start.startOf + ;;!! foo := 0 ;;! ^^^ ;;! ^ From 71a6e710e952e55d14394af41f5bcd4fb32aa2b1 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 18:55:41 +0100 Subject: [PATCH 21/25] More fixes --- .../scopes/c/name/name.field.enum.scope | 24 +++------ .../scopes/cpp/name/name.field.enum.scope | 24 +++------ .../scopes/csharp/name/name.field.enum.scope | 42 +++------------ .../scopes/java/name/name.field.class.scope | 14 ++--- .../scopes/java/name/name.field.enum.scope | 18 +++---- .../scopes/java/name/name.method2.scope | 6 +-- .../scopes/java/namedFunction.method2.scope | 8 +-- .../java/statement/statement.method2.scope | 10 ++-- .../argument.formal.method.iteration2.scope | 4 +- .../argument.formal.method.iteration4.scope | 4 +- .../argumentList.formal.method.empty2.scope | 4 +- .../argumentList.formal.method.empty4.scope | 4 +- .../name/name.field.class.scope | 12 ++--- .../javascript.core/name/name.method2.scope | 6 +-- .../javascript.core/name/name.method4.scope | 8 +-- .../namedFunction/namedFunction.method2.scope | 8 +-- .../namedFunction/namedFunction.method4.scope | 8 +-- .../statement/statement.method2.scope | 10 ++-- .../statement/statement.method4.scope | 10 ++-- .../namedFunction/namedFunction.method2.scope | 8 +-- .../kotlin/statement/statement.method2.scope | 10 ++-- .../scopes/scala/name/name.field.enum.scope | 26 +++------- .../name/name.field.class.scope | 12 ++--- .../name/name.field.enum.scope | 52 ++++++++----------- .../name/name.field.interface.scope | 4 +- queries/c.scm | 2 +- queries/cpp.scm | 2 +- queries/csharp.scm | 8 +-- queries/html.scm | 4 +- queries/javascript.jsx.scm | 10 ++-- queries/rust.scm | 4 +- queries/typescript.core.scm | 4 +- queries/xml.scm | 4 +- 33 files changed, 156 insertions(+), 218 deletions(-) diff --git a/data/fixtures/scopes/c/name/name.field.enum.scope b/data/fixtures/scopes/c/name/name.field.enum.scope index be33789056..c4bc85d925 100644 --- a/data/fixtures/scopes/c/name/name.field.enum.scope +++ b/data/fixtures/scopes/c/name/name.field.enum.scope @@ -37,16 +37,12 @@ enum Foo { >---< 1| bar = 0, -[#2 Removal] = 1:4-1:8 - >----< +[#2 Removal] = 1:4-1:10 + >------< 1| bar = 0, -[#2 Leading delimiter] = 1:0-1:4 - >----< -1| bar = 0, - -[#2 Trailing delimiter] = 1:7-1:8 - >-< +[#2 Trailing delimiter] = 1:7-1:10 + >---< 1| bar = 0, [#2 Domain] = 1:4-1:11 @@ -60,16 +56,12 @@ enum Foo { >---< 2| baz = 1, -[#3 Removal] = 2:4-2:8 - >----< -2| baz = 1, - -[#3 Leading delimiter] = 2:0-2:4 - >----< +[#3 Removal] = 2:4-2:10 + >------< 2| baz = 1, -[#3 Trailing delimiter] = 2:7-2:8 - >-< +[#3 Trailing delimiter] = 2:7-2:10 + >---< 2| baz = 1, [#3 Domain] = 2:4-2:11 diff --git a/data/fixtures/scopes/cpp/name/name.field.enum.scope b/data/fixtures/scopes/cpp/name/name.field.enum.scope index 6fc638a279..0e5601140a 100644 --- a/data/fixtures/scopes/cpp/name/name.field.enum.scope +++ b/data/fixtures/scopes/cpp/name/name.field.enum.scope @@ -37,16 +37,12 @@ enum class Foo { >---< 1| bar = 0, -[#2 Removal] = 1:4-1:8 - >----< +[#2 Removal] = 1:4-1:10 + >------< 1| bar = 0, -[#2 Leading delimiter] = 1:0-1:4 - >----< -1| bar = 0, - -[#2 Trailing delimiter] = 1:7-1:8 - >-< +[#2 Trailing delimiter] = 1:7-1:10 + >---< 1| bar = 0, [#2 Domain] = 1:4-1:11 @@ -60,16 +56,12 @@ enum class Foo { >---< 2| baz = 1, -[#3 Removal] = 2:4-2:8 - >----< -2| baz = 1, - -[#3 Leading delimiter] = 2:0-2:4 - >----< +[#3 Removal] = 2:4-2:10 + >------< 2| baz = 1, -[#3 Trailing delimiter] = 2:7-2:8 - >-< +[#3 Trailing delimiter] = 2:7-2:10 + >---< 2| baz = 1, [#3 Domain] = 2:4-2:11 diff --git a/data/fixtures/scopes/csharp/name/name.field.enum.scope b/data/fixtures/scopes/csharp/name/name.field.enum.scope index be33789056..7807b59aa4 100644 --- a/data/fixtures/scopes/csharp/name/name.field.enum.scope +++ b/data/fixtures/scopes/csharp/name/name.field.enum.scope @@ -37,16 +37,12 @@ enum Foo { >---< 1| bar = 0, -[#2 Removal] = 1:4-1:8 - >----< +[#2 Removal] = 1:4-1:10 + >------< 1| bar = 0, -[#2 Leading delimiter] = 1:0-1:4 - >----< -1| bar = 0, - -[#2 Trailing delimiter] = 1:7-1:8 - >-< +[#2 Trailing delimiter] = 1:7-1:10 + >---< 1| bar = 0, [#2 Domain] = 1:4-1:11 @@ -60,16 +56,12 @@ enum Foo { >---< 2| baz = 1, -[#3 Removal] = 2:4-2:8 - >----< -2| baz = 1, - -[#3 Leading delimiter] = 2:0-2:4 - >----< +[#3 Removal] = 2:4-2:10 + >------< 2| baz = 1, -[#3 Trailing delimiter] = 2:7-2:8 - >-< +[#3 Trailing delimiter] = 2:7-2:10 + >---< 2| baz = 1, [#3 Domain] = 2:4-2:11 @@ -77,21 +69,3 @@ enum Foo { 2| baz = 1, [#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Domain] = 3:4-3:9 - >-----< -3| bongo - -[#4 Removal] = 3:0-4:0 - >--------- -3| bongo -4| } - < - -[#4 Leading delimiter] = 3:0-3:4 - >----< -3| bongo - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.field.class.scope b/data/fixtures/scopes/java/name/name.field.class.scope index 74d83ca0bf..e223ad4bbd 100644 --- a/data/fixtures/scopes/java/name/name.field.class.scope +++ b/data/fixtures/scopes/java/name/name.field.class.scope @@ -1,7 +1,7 @@ public class Foo { private int bar; private int baz = 0; - @Att int bongo = 0; + @An int bongo = 0; } --- @@ -26,7 +26,7 @@ public class Foo { 0| public class Foo { 1| private int bar; 2| private int baz = 0; -3| @Att int bongo = 0; +3| @An int bongo = 0; 4| } -< @@ -77,22 +77,22 @@ public class Foo { [#4 Content] = 3:13-3:18 >-----< -3| @Att int bongo = 0; +3| @An int bongo = 0; [#4 Removal] = 3:4-3:21 >-----------------< -3| @Att int bongo = 0; +3| @An int bongo = 0; [#4 Leading delimiter] = 3:12-3:13 >-< -3| @Att int bongo = 0; +3| @An int bongo = 0; [#4 Trailing delimiter] = 3:18-3:19 >-< -3| @Att int bongo = 0; +3| @An int bongo = 0; [#4 Domain] = 3:4-3:23 >-------------------< -3| @Att int bongo = 0; +3| @An int bongo = 0; [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.field.enum.scope b/data/fixtures/scopes/java/name/name.field.enum.scope index d40f9e2933..576b5c26a4 100644 --- a/data/fixtures/scopes/java/name/name.field.enum.scope +++ b/data/fixtures/scopes/java/name/name.field.enum.scope @@ -1,6 +1,6 @@ public enum Foo { bar, - baz; + baz(); } --- @@ -24,7 +24,7 @@ public enum Foo { >----------------- 0| public enum Foo { 1| bar, -2| baz; +2| baz(); 3| } -< @@ -48,16 +48,16 @@ public enum Foo { [#3 Content] = -[#3 Domain] = 2:4-2:7 +[#3 Removal] = 2:4-2:7 >---< -2| baz; - -[#3 Removal] = 2:0-2:7 - >-------< -2| baz; +2| baz(); [#3 Leading delimiter] = 2:0-2:4 >----< -2| baz; +2| baz(); + +[#3 Domain] = 2:4-2:9 + >-----< +2| baz(); [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.method2.scope b/data/fixtures/scopes/java/name/name.method2.scope index 84b4e78150..ffb7fa0456 100644 --- a/data/fixtures/scopes/java/name/name.method2.scope +++ b/data/fixtures/scopes/java/name/name.method2.scope @@ -1,5 +1,5 @@ public class Foo { - @baz + @An public void bar() {} } --- @@ -23,7 +23,7 @@ public class Foo { [#1 Domain] = 0:0-3:1 >------------------ 0| public class Foo { -1| @baz +1| @An 2| public void bar() {} 3| } -< @@ -42,7 +42,7 @@ public class Foo { [#2 Domain] = 1:4-2:24 >---- -1| @baz +1| @An 2| public void bar() {} ------------------------< diff --git a/data/fixtures/scopes/java/namedFunction.method2.scope b/data/fixtures/scopes/java/namedFunction.method2.scope index 877c7afe23..670faac11c 100644 --- a/data/fixtures/scopes/java/namedFunction.method2.scope +++ b/data/fixtures/scopes/java/namedFunction.method2.scope @@ -1,5 +1,5 @@ public class Foo { - @baz + @An public void bar() {} } --- @@ -7,19 +7,19 @@ public class Foo { [Content] = [Domain] = 1:4-2:24 >---- -1| @baz +1| @An 2| public void bar() {} ------------------------< [Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| public void bar() {} 3| } < [Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/java/statement/statement.method2.scope b/data/fixtures/scopes/java/statement/statement.method2.scope index 25b3db5e69..4dd6b2518b 100644 --- a/data/fixtures/scopes/java/statement/statement.method2.scope +++ b/data/fixtures/scopes/java/statement/statement.method2.scope @@ -1,5 +1,5 @@ public class Foo { - @baz + @An public void bar() {} } --- @@ -9,7 +9,7 @@ public class Foo { [#1 Domain] = 0:0-3:1 >------------------ 0| public class Foo { -1| @baz +1| @An 2| public void bar() {} 3| } -< @@ -20,19 +20,19 @@ public class Foo { [#2 Content] = [#2 Domain] = 1:4-2:24 >---- -1| @baz +1| @An 2| public void bar() {} ------------------------< [#2 Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| public void bar() {} 3| } < [#2 Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope index b201c9bfcc..c88fdd0c9c 100644 --- a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope +++ b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar(aaa, bbb) {} } --- @@ -10,6 +10,6 @@ class Foo { [Domain] = 1:4-2:20 >---- -1| @baz +1| @An 2| bar(aaa, bbb) {} --------------------< diff --git a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope index fb6944fe96..48296da910 100644 --- a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope +++ b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar = (aaa, bbb) => {} } --- @@ -10,6 +10,6 @@ class Foo { [Domain] = 1:4-2:26 >---- -1| @baz +1| @An 2| bar = (aaa, bbb) => {} --------------------------< diff --git a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope index 680af8018e..7948d353aa 100644 --- a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope +++ b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar() {} } --- @@ -11,7 +11,7 @@ class Foo { [Domain] = 1:4-2:12 >---- -1| @baz +1| @An 2| bar() {} ------------< diff --git a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope index 0dfd01f24c..e520972461 100644 --- a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope +++ b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar = () => {} } --- @@ -11,7 +11,7 @@ class Foo { [Domain] = 1:4-2:18 >---- -1| @baz +1| @An 2| bar = () => {} ------------------< diff --git a/data/fixtures/scopes/javascript.core/name/name.field.class.scope b/data/fixtures/scopes/javascript.core/name/name.field.class.scope index e02e47a825..ec5e470d5b 100644 --- a/data/fixtures/scopes/javascript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/javascript.core/name/name.field.class.scope @@ -1,7 +1,7 @@ class Foo { bar; baz = 0; - @Att bongo = 0; + @An bongo = 0; } --- @@ -26,7 +26,7 @@ class Foo { 0| class Foo { 1| bar; 2| baz = 0; -3| @Att bongo = 0; +3| @An bongo = 0; 4| } -< @@ -70,18 +70,18 @@ class Foo { [#4 Content] = 3:9-3:14 >-----< -3| @Att bongo = 0; +3| @An bongo = 0; [#4 Removal] = 3:4-3:17 >-------------< -3| @Att bongo = 0; +3| @An bongo = 0; [#4 Trailing delimiter] = 3:14-3:17 >---< -3| @Att bongo = 0; +3| @An bongo = 0; [#4 Domain] = 3:4-3:19 >---------------< -3| @Att bongo = 0; +3| @An bongo = 0; [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method2.scope b/data/fixtures/scopes/javascript.core/name/name.method2.scope index c70d6c2bb1..c6049d8df9 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method2.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar() {} } --- @@ -23,7 +23,7 @@ class Foo { [#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| @baz +1| @An 2| bar() {} 3| } -< @@ -42,7 +42,7 @@ class Foo { [#2 Domain] = 1:4-2:12 >---- -1| @baz +1| @An 2| bar() {} ------------< diff --git a/data/fixtures/scopes/javascript.core/name/name.method4.scope b/data/fixtures/scopes/javascript.core/name/name.method4.scope index 0521099027..9ab748b227 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method4.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method4.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar = () => {} } --- @@ -23,7 +23,7 @@ class Foo { [#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| @baz +1| @An 2| bar = () => {} 3| } -< @@ -37,7 +37,7 @@ class Foo { [#2 Removal] = 1:4-2:10 >---- -1| @baz +1| @An 2| bar = () => {} ----------< @@ -47,7 +47,7 @@ class Foo { [#2 Domain] = 1:4-2:18 >---- -1| @baz +1| @An 2| bar = () => {} ------------------< diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope index 50878c3485..88e8b82287 100644 --- a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar() {} } --- @@ -7,19 +7,19 @@ class Foo { [Content] = [Domain] = 1:4-2:12 >---- -1| @baz +1| @An 2| bar() {} ------------< [Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| bar() {} 3| } < [Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope index 5ac9812e1b..b457e8101a 100644 --- a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar = () => {} } --- @@ -7,19 +7,19 @@ class Foo { [Content] = [Domain] = 1:4-2:18 >---- -1| @baz +1| @An 2| bar = () => {} ------------------< [Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| bar = () => {} 3| } < [Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method2.scope b/data/fixtures/scopes/javascript.core/statement/statement.method2.scope index e707554b60..97655d4369 100644 --- a/data/fixtures/scopes/javascript.core/statement/statement.method2.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.method2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar() {} } --- @@ -9,7 +9,7 @@ class Foo { [#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| @baz +1| @An 2| bar() {} 3| } -< @@ -20,19 +20,19 @@ class Foo { [#2 Content] = [#2 Domain] = 1:4-2:12 >---- -1| @baz +1| @An 2| bar() {} ------------< [#2 Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| bar() {} 3| } < [#2 Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method4.scope b/data/fixtures/scopes/javascript.core/statement/statement.method4.scope index d370211186..2f88c02be8 100644 --- a/data/fixtures/scopes/javascript.core/statement/statement.method4.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.method4.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An bar = () => {} } --- @@ -9,7 +9,7 @@ class Foo { [#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| @baz +1| @An 2| bar = () => {} 3| } -< @@ -20,19 +20,19 @@ class Foo { [#2 Content] = [#2 Domain] = 1:4-2:18 >---- -1| @baz +1| @An 2| bar = () => {} ------------------< [#2 Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| bar = () => {} 3| } < [#2 Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope b/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope index bf3dc71914..879332082b 100644 --- a/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope +++ b/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An fun bar() {} } --- @@ -7,19 +7,19 @@ class Foo { [Content] = [Domain] = 1:4-2:16 >---- -1| @baz +1| @An 2| fun bar() {} ----------------< [Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| fun bar() {} 3| } < [Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/kotlin/statement/statement.method2.scope b/data/fixtures/scopes/kotlin/statement/statement.method2.scope index d065bdf278..a3ac4b369b 100644 --- a/data/fixtures/scopes/kotlin/statement/statement.method2.scope +++ b/data/fixtures/scopes/kotlin/statement/statement.method2.scope @@ -1,5 +1,5 @@ class Foo { - @baz + @An fun bar() {} } --- @@ -9,7 +9,7 @@ class Foo { [#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| @baz +1| @An 2| fun bar() {} 3| } -< @@ -20,19 +20,19 @@ class Foo { [#2 Content] = [#2 Domain] = 1:4-2:16 >---- -1| @baz +1| @An 2| fun bar() {} ----------------< [#2 Removal] = 1:0-3:0 >-------- -1| @baz +1| @An 2| fun bar() {} 3| } < [#2 Leading delimiter] = 1:0-1:4 >----< -1| @baz +1| @An [#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/name/name.field.enum.scope b/data/fixtures/scopes/scala/name/name.field.enum.scope index 1df71cd6f4..e94e2d5510 100644 --- a/data/fixtures/scopes/scala/name/name.field.enum.scope +++ b/data/fixtures/scopes/scala/name/name.field.enum.scope @@ -1,6 +1,6 @@ enum Foo { case Bar - case Baz(x: Int) + case Baz() } --- @@ -24,7 +24,7 @@ enum Foo { >---------- 0| enum Foo { 1| case Bar -2| case Baz(x: Int) +2| case Baz() 3| } -< @@ -53,26 +53,14 @@ enum Foo { [#3 Content] = [#3 Removal] = 2:9-2:12 >---< -2| case Baz(x: Int) +2| case Baz() [#3 Leading delimiter] = 2:8-2:9 >-< -2| case Baz(x: Int) +2| case Baz() -[#3 Domain] = 2:4-2:20 - >----------------< -2| case Baz(x: Int) +[#3 Domain] = 2:4-2:14 + >----------< +2| case Baz() [#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 2:13-2:14 - >-< -2| case Baz(x: Int) - -[#4 Domain] = 2:13-2:19 - >------< -2| case Baz(x: Int) - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.field.class.scope b/data/fixtures/scopes/typescript.core/name/name.field.class.scope index 0809dadc8a..774ce0e9cd 100644 --- a/data/fixtures/scopes/typescript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/typescript.core/name/name.field.class.scope @@ -1,7 +1,7 @@ class Foo { bar: number; baz = 0; - @Att bongo: number = 0; + @An bongo: number = 0; } --- @@ -26,7 +26,7 @@ class Foo { 0| class Foo { 1| bar: number; 2| baz = 0; -3| @Att bongo: number = 0; +3| @An bongo: number = 0; 4| } -< @@ -73,18 +73,18 @@ class Foo { [#4 Content] = 3:9-3:14 >-----< -3| @Att bongo: number = 0; +3| @An bongo: number = 0; [#4 Removal] = 3:4-3:25 >---------------------< -3| @Att bongo: number = 0; +3| @An bongo: number = 0; [#4 Leading delimiter] = 3:8-3:9 >-< -3| @Att bongo: number = 0; +3| @An bongo: number = 0; [#4 Domain] = 3:4-3:27 >-----------------------< -3| @Att bongo: number = 0; +3| @An bongo: number = 0; [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.field.enum.scope b/data/fixtures/scopes/typescript.core/name/name.field.enum.scope index e0fdaa48df..c4bc85d925 100644 --- a/data/fixtures/scopes/typescript.core/name/name.field.enum.scope +++ b/data/fixtures/scopes/typescript.core/name/name.field.enum.scope @@ -1,6 +1,6 @@ enum Foo { - bar = "-", - baz = 0, + bar = 0, + baz = 1, bongo } --- @@ -24,8 +24,8 @@ enum Foo { [#1 Domain] = 0:0-4:1 >---------- 0| enum Foo { -1| bar = "-", -2| baz = 0, +1| bar = 0, +2| baz = 1, 3| bongo 4| } -< @@ -35,46 +35,38 @@ enum Foo { [#2 Content] = 1:4-1:7 >---< -1| bar = "-", +1| bar = 0, -[#2 Removal] = 1:4-1:8 - >----< -1| bar = "-", +[#2 Removal] = 1:4-1:10 + >------< +1| bar = 0, -[#2 Leading delimiter] = 1:0-1:4 - >----< -1| bar = "-", - -[#2 Trailing delimiter] = 1:7-1:8 - >-< -1| bar = "-", +[#2 Trailing delimiter] = 1:7-1:10 + >---< +1| bar = 0, -[#2 Domain] = 1:4-1:13 - >---------< -1| bar = "-", +[#2 Domain] = 1:4-1:11 + >-------< +1| bar = 0, [#2 Insertion delimiter] = " " [#3 Content] = 2:4-2:7 >---< -2| baz = 0, +2| baz = 1, -[#3 Removal] = 2:4-2:8 - >----< -2| baz = 0, - -[#3 Leading delimiter] = 2:0-2:4 - >----< -2| baz = 0, +[#3 Removal] = 2:4-2:10 + >------< +2| baz = 1, -[#3 Trailing delimiter] = 2:7-2:8 - >-< -2| baz = 0, +[#3 Trailing delimiter] = 2:7-2:10 + >---< +2| baz = 1, [#3 Domain] = 2:4-2:11 >-------< -2| baz = 0, +2| baz = 1, [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name/name.field.interface.scope b/data/fixtures/scopes/typescript.core/name/name.field.interface.scope index 24ebe3b8d7..7f360f6127 100644 --- a/data/fixtures/scopes/typescript.core/name/name.field.interface.scope +++ b/data/fixtures/scopes/typescript.core/name/name.field.interface.scope @@ -33,8 +33,8 @@ interface Foo { >---< 1| bar: number; -[#2 Removal] = 1:0-1:7 - >-------< +[#2 Removal] = 1:4-1:15 + >-----------< 1| bar: number; [#2 Leading delimiter] = 1:0-1:4 diff --git a/queries/c.scm b/queries/c.scm index 7e718ce153..e151706833 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -128,7 +128,7 @@ ;;! ^^^ ^ (enumerator name: (_) @name @value.leading.endOf - value: (_)? @value + value: (_)? @value @name.trailing.startOf ) @_.domain ;;!! void foo(); diff --git a/queries/cpp.scm b/queries/cpp.scm index 61b74fd73f..c09b521cce 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -57,7 +57,7 @@ ;;!! [[attribute]] ;;! ^^^^^^^^^ -(attribute) @attribute +(attribute) @Anribute ;; > curl https://raw.githubusercontent.com/tree-sitter/tree-sitter-cpp/master/src/node-types.json | jq '[.[] | select(.type == "_type_specifier") | .subtypes[].type]' [ diff --git a/queries/csharp.scm b/queries/csharp.scm index d730d9b11a..2441e24734 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -225,7 +225,7 @@ ;;!! [Obsolete("Deprecated")] ;;! ^^^^^^^^^^^^^^^^^^^^^^ -(attribute) @attribute +(attribute) @Anribute [ (delegate_declaration @@ -383,7 +383,7 @@ (_ name: (_) @name - (#not-parent-type? @name catch_declaration) + (#not-parent-type? @name catch_declaration enum_member_declaration) ) @_.domain ( @@ -412,8 +412,8 @@ ;;!! bar = 0 ;;! ^ (enum_member_declaration - name: (_) @value.leading.endOf - value: (_) @value + name: (_) @name @value.leading.endOf + value: (_) @value @name.trailing.startOf ) @_.domain ;; Dictionary values; diff --git a/queries/html.scm b/queries/html.scm index d9bb38df44..cd3195c2ba 100644 --- a/queries/html.scm +++ b/queries/html.scm @@ -16,7 +16,7 @@ ;;!! ;;! ^^^^^^^ -(attribute) @attribute +(attribute) @Anribute ;;!! ;;! ^^ @@ -48,7 +48,7 @@ ;;!! ;;! ^^^^^ -(start_tag) @attribute.iteration @collectionKey.iteration @value.iteration +(start_tag) @Anribute.iteration @collectionKey.iteration @value.iteration ;;!! ;;! ^^^^^^^^^^^^^^^^ diff --git a/queries/javascript.jsx.scm b/queries/javascript.jsx.scm index d673455c01..57fa17bbb8 100644 --- a/queries/javascript.jsx.scm +++ b/queries/javascript.jsx.scm @@ -55,7 +55,7 @@ ;;!! ;;! ^^^^^^^^^ -(jsx_attribute) @attribute +(jsx_attribute) @Anribute ;;!! ;;! ^^^ @@ -76,15 +76,15 @@ ;;!! ;;! ^^^^ (jsx_self_closing_element - "<" @attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf - "/>" @attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "<" @Anribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf + "/>" @Anribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) ;;!! ;;! ^^^ (jsx_opening_element - "<" @attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf - ">" @attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "<" @Anribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf + ">" @Anribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) ;;!!
text
diff --git a/queries/rust.scm b/queries/rust.scm index f8b9c4acf5..6d3fdf32bf 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -253,12 +253,12 @@ ;;!! #[derive(Debug)] ;;! ^^^^^^^^^^^^^^^^ -(attribute_item) @attribute +(attribute_item) @Anribute ;;!! &mut x; ;;! ^^^ (_ - (mutable_specifier) @attribute + (mutable_specifier) @Anribute . (_) @_.trailing.startOf ) @_.domain diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index 9e9246f51f..4ac50c74fa 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -55,7 +55,7 @@ ;;! ^ ^ (enum_assignment name: (_) @name @value.leading.endOf - value: (_) @value + value: (_) @value @name.trailing.startOf ) @_.domain ;;!! function foo(aaa: number = 0) {} @@ -492,7 +492,7 @@ ":" (_) @type @collectionKey.trailing.startOf ) - ) @_.domain.start + ) @_.domain.start @name.removal . ";"? @_.domain.end ) diff --git a/queries/xml.scm b/queries/xml.scm index 450008afd4..b0625ae7a0 100644 --- a/queries/xml.scm +++ b/queries/xml.scm @@ -16,7 +16,7 @@ ;;!! ;;! ^^^^^^^ -(Attribute) @attribute +(Attribute) @Anribute ;;!! ;;! ^^ ^^^^ @@ -27,7 +27,7 @@ ;;!! ;;! ^^^^^ -(STag) @attribute.iteration @collectionKey.iteration @value.iteration +(STag) @Anribute.iteration @collectionKey.iteration @value.iteration ;;!! ;;! ^^^^^^^^^^^^^^^^ From 58d35a0c3baf53bb76a53e6900622d659af957c2 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 18:56:37 +0100 Subject: [PATCH 22/25] Restore typo --- queries/cpp.scm | 2 +- queries/csharp.scm | 2 +- queries/html.scm | 4 ++-- queries/javascript.jsx.scm | 10 +++++----- queries/rust.scm | 4 ++-- queries/xml.scm | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/queries/cpp.scm b/queries/cpp.scm index c09b521cce..54e8168173 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -57,7 +57,7 @@ ;;!! [[attribute]] ;;! ^^^^^^^^^ -(attribute) @Anribute +(attribute) @Attribute ;; > curl https://raw.githubusercontent.com/tree-sitter/tree-sitter-cpp/master/src/node-types.json | jq '[.[] | select(.type == "_type_specifier") | .subtypes[].type]' [ diff --git a/queries/csharp.scm b/queries/csharp.scm index 2441e24734..a389ef1079 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -225,7 +225,7 @@ ;;!! [Obsolete("Deprecated")] ;;! ^^^^^^^^^^^^^^^^^^^^^^ -(attribute) @Anribute +(attribute) @Attribute [ (delegate_declaration diff --git a/queries/html.scm b/queries/html.scm index cd3195c2ba..55fd39b1db 100644 --- a/queries/html.scm +++ b/queries/html.scm @@ -16,7 +16,7 @@ ;;!! ;;! ^^^^^^^ -(attribute) @Anribute +(attribute) @Attribute ;;!! ;;! ^^ @@ -48,7 +48,7 @@ ;;!! ;;! ^^^^^ -(start_tag) @Anribute.iteration @collectionKey.iteration @value.iteration +(start_tag) @Attribute.iteration @collectionKey.iteration @value.iteration ;;!! ;;! ^^^^^^^^^^^^^^^^ diff --git a/queries/javascript.jsx.scm b/queries/javascript.jsx.scm index 57fa17bbb8..92b6be0869 100644 --- a/queries/javascript.jsx.scm +++ b/queries/javascript.jsx.scm @@ -55,7 +55,7 @@ ;;!! ;;! ^^^^^^^^^ -(jsx_attribute) @Anribute +(jsx_attribute) @Attribute ;;!! ;;! ^^^ @@ -76,15 +76,15 @@ ;;!! ;;! ^^^^ (jsx_self_closing_element - "<" @Anribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf - "/>" @Anribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "<" @Attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf + "/>" @Attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) ;;!! ;;! ^^^ (jsx_opening_element - "<" @Anribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf - ">" @Anribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "<" @Attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf + ">" @Attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) ;;!!
text
diff --git a/queries/rust.scm b/queries/rust.scm index 6d3fdf32bf..7ee08b95e1 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -253,12 +253,12 @@ ;;!! #[derive(Debug)] ;;! ^^^^^^^^^^^^^^^^ -(attribute_item) @Anribute +(attribute_item) @Attribute ;;!! &mut x; ;;! ^^^ (_ - (mutable_specifier) @Anribute + (mutable_specifier) @Attribute . (_) @_.trailing.startOf ) @_.domain diff --git a/queries/xml.scm b/queries/xml.scm index b0625ae7a0..763f850020 100644 --- a/queries/xml.scm +++ b/queries/xml.scm @@ -16,7 +16,7 @@ ;;!! ;;! ^^^^^^^ -(Attribute) @Anribute +(Attribute) @Attribute ;;!! ;;! ^^ ^^^^ @@ -27,7 +27,7 @@ ;;!! ;;! ^^^^^ -(STag) @Anribute.iteration @collectionKey.iteration @value.iteration +(STag) @Attribute.iteration @collectionKey.iteration @value.iteration ;;!! ;;! ^^^^^^^^^^^^^^^^ From 584ba41b6c769c9617ca23fa610104730aa4bbea Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 18:57:21 +0100 Subject: [PATCH 23/25] lower case --- queries/cpp.scm | 2 +- queries/csharp.scm | 2 +- queries/html.scm | 4 ++-- queries/javascript.jsx.scm | 10 +++++----- queries/rust.scm | 4 ++-- queries/xml.scm | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/queries/cpp.scm b/queries/cpp.scm index 54e8168173..61b74fd73f 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -57,7 +57,7 @@ ;;!! [[attribute]] ;;! ^^^^^^^^^ -(attribute) @Attribute +(attribute) @attribute ;; > curl https://raw.githubusercontent.com/tree-sitter/tree-sitter-cpp/master/src/node-types.json | jq '[.[] | select(.type == "_type_specifier") | .subtypes[].type]' [ diff --git a/queries/csharp.scm b/queries/csharp.scm index a389ef1079..9c6bd30834 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -225,7 +225,7 @@ ;;!! [Obsolete("Deprecated")] ;;! ^^^^^^^^^^^^^^^^^^^^^^ -(attribute) @Attribute +(attribute) @attribute [ (delegate_declaration diff --git a/queries/html.scm b/queries/html.scm index 55fd39b1db..d9bb38df44 100644 --- a/queries/html.scm +++ b/queries/html.scm @@ -16,7 +16,7 @@ ;;!! ;;! ^^^^^^^ -(attribute) @Attribute +(attribute) @attribute ;;!! ;;! ^^ @@ -48,7 +48,7 @@ ;;!! ;;! ^^^^^ -(start_tag) @Attribute.iteration @collectionKey.iteration @value.iteration +(start_tag) @attribute.iteration @collectionKey.iteration @value.iteration ;;!! ;;! ^^^^^^^^^^^^^^^^ diff --git a/queries/javascript.jsx.scm b/queries/javascript.jsx.scm index 92b6be0869..d673455c01 100644 --- a/queries/javascript.jsx.scm +++ b/queries/javascript.jsx.scm @@ -55,7 +55,7 @@ ;;!! ;;! ^^^^^^^^^ -(jsx_attribute) @Attribute +(jsx_attribute) @attribute ;;!! ;;! ^^^ @@ -76,15 +76,15 @@ ;;!! ;;! ^^^^ (jsx_self_closing_element - "<" @Attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf - "/>" @Attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "<" @attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf + "/>" @attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) ;;!! ;;! ^^^ (jsx_opening_element - "<" @Attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf - ">" @Attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf + "<" @attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf + ">" @attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf ) ;;!!
text
diff --git a/queries/rust.scm b/queries/rust.scm index 7ee08b95e1..f8b9c4acf5 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -253,12 +253,12 @@ ;;!! #[derive(Debug)] ;;! ^^^^^^^^^^^^^^^^ -(attribute_item) @Attribute +(attribute_item) @attribute ;;!! &mut x; ;;! ^^^ (_ - (mutable_specifier) @Attribute + (mutable_specifier) @attribute . (_) @_.trailing.startOf ) @_.domain diff --git a/queries/xml.scm b/queries/xml.scm index 763f850020..450008afd4 100644 --- a/queries/xml.scm +++ b/queries/xml.scm @@ -16,7 +16,7 @@ ;;!! ;;! ^^^^^^^ -(Attribute) @Attribute +(Attribute) @attribute ;;!! ;;! ^^ ^^^^ @@ -27,7 +27,7 @@ ;;!! ;;! ^^^^^ -(STag) @Attribute.iteration @collectionKey.iteration @value.iteration +(STag) @attribute.iteration @collectionKey.iteration @value.iteration ;;!! ;;! ^^^^^^^^^^^^^^^^ From b96f201c4075ccf2ac457aed09688909cfce2482 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 19:04:23 +0100 Subject: [PATCH 24/25] Update tests --- .../scopes/java/name/name.field.class.scope | 20 +++++++++---------- .../scopes/java/name/name.method2.scope | 2 +- .../scopes/java/namedFunction.method2.scope | 4 ++-- .../java/statement/statement.method2.scope | 4 ++-- .../argument.formal.method.iteration2.scope | 2 +- .../argument.formal.method.iteration4.scope | 2 +- .../argumentList.formal.method.empty2.scope | 2 +- .../argumentList.formal.method.empty4.scope | 2 +- .../name/name.field.class.scope | 16 +++++++-------- .../javascript.core/name/name.method2.scope | 2 +- .../javascript.core/name/name.method4.scope | 4 ++-- .../namedFunction/namedFunction.method2.scope | 4 ++-- .../namedFunction/namedFunction.method4.scope | 4 ++-- .../statement/statement.method2.scope | 4 ++-- .../statement/statement.method4.scope | 4 ++-- .../namedFunction/namedFunction.method2.scope | 4 ++-- .../kotlin/statement/statement.method2.scope | 4 ++-- .../name/name.field.class.scope | 16 +++++++-------- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/data/fixtures/scopes/java/name/name.field.class.scope b/data/fixtures/scopes/java/name/name.field.class.scope index e223ad4bbd..26e8cac0c7 100644 --- a/data/fixtures/scopes/java/name/name.field.class.scope +++ b/data/fixtures/scopes/java/name/name.field.class.scope @@ -75,24 +75,24 @@ public class Foo { [#3 Insertion delimiter] = " " -[#4 Content] = 3:13-3:18 - >-----< +[#4 Content] = 3:12-3:17 + >-----< 3| @An int bongo = 0; -[#4 Removal] = 3:4-3:21 - >-----------------< +[#4 Removal] = 3:4-3:20 + >----------------< 3| @An int bongo = 0; -[#4 Leading delimiter] = 3:12-3:13 - >-< +[#4 Leading delimiter] = 3:11-3:12 + >-< 3| @An int bongo = 0; -[#4 Trailing delimiter] = 3:18-3:19 - >-< +[#4 Trailing delimiter] = 3:17-3:18 + >-< 3| @An int bongo = 0; -[#4 Domain] = 3:4-3:23 - >-------------------< +[#4 Domain] = 3:4-3:22 + >------------------< 3| @An int bongo = 0; [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name/name.method2.scope b/data/fixtures/scopes/java/name/name.method2.scope index ffb7fa0456..3654aa3891 100644 --- a/data/fixtures/scopes/java/name/name.method2.scope +++ b/data/fixtures/scopes/java/name/name.method2.scope @@ -41,7 +41,7 @@ public class Foo { 2| public void bar() {} [#2 Domain] = 1:4-2:24 - >---- + >--- 1| @An 2| public void bar() {} ------------------------< diff --git a/data/fixtures/scopes/java/namedFunction.method2.scope b/data/fixtures/scopes/java/namedFunction.method2.scope index 670faac11c..be0ecc9835 100644 --- a/data/fixtures/scopes/java/namedFunction.method2.scope +++ b/data/fixtures/scopes/java/namedFunction.method2.scope @@ -6,13 +6,13 @@ public class Foo { [Content] = [Domain] = 1:4-2:24 - >---- + >--- 1| @An 2| public void bar() {} ------------------------< [Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| public void bar() {} 3| } diff --git a/data/fixtures/scopes/java/statement/statement.method2.scope b/data/fixtures/scopes/java/statement/statement.method2.scope index 4dd6b2518b..1256b884a5 100644 --- a/data/fixtures/scopes/java/statement/statement.method2.scope +++ b/data/fixtures/scopes/java/statement/statement.method2.scope @@ -19,13 +19,13 @@ public class Foo { [#2 Content] = [#2 Domain] = 1:4-2:24 - >---- + >--- 1| @An 2| public void bar() {} ------------------------< [#2 Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| public void bar() {} 3| } diff --git a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope index c88fdd0c9c..7da244ac2a 100644 --- a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope +++ b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration2.scope @@ -9,7 +9,7 @@ class Foo { 2| bar(aaa, bbb) {} [Domain] = 1:4-2:20 - >---- + >--- 1| @An 2| bar(aaa, bbb) {} --------------------< diff --git a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope index 48296da910..f8fb956214 100644 --- a/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope +++ b/data/fixtures/scopes/javascript.core/argument/argument.formal.method.iteration4.scope @@ -9,7 +9,7 @@ class Foo { 2| bar = (aaa, bbb) => {} [Domain] = 1:4-2:26 - >---- + >--- 1| @An 2| bar = (aaa, bbb) => {} --------------------------< diff --git a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope index 7948d353aa..d01eb9037a 100644 --- a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope +++ b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty2.scope @@ -10,7 +10,7 @@ class Foo { 2| bar() {} [Domain] = 1:4-2:12 - >---- + >--- 1| @An 2| bar() {} ------------< diff --git a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope index e520972461..dbbff867e1 100644 --- a/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope +++ b/data/fixtures/scopes/javascript.core/argumentList/argumentList.formal.method.empty4.scope @@ -10,7 +10,7 @@ class Foo { 2| bar = () => {} [Domain] = 1:4-2:18 - >---- + >--- 1| @An 2| bar = () => {} ------------------< diff --git a/data/fixtures/scopes/javascript.core/name/name.field.class.scope b/data/fixtures/scopes/javascript.core/name/name.field.class.scope index ec5e470d5b..32eb973d53 100644 --- a/data/fixtures/scopes/javascript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/javascript.core/name/name.field.class.scope @@ -68,20 +68,20 @@ class Foo { [#3 Insertion delimiter] = " " -[#4 Content] = 3:9-3:14 - >-----< +[#4 Content] = 3:8-3:13 + >-----< 3| @An bongo = 0; -[#4 Removal] = 3:4-3:17 - >-------------< +[#4 Removal] = 3:4-3:16 + >------------< 3| @An bongo = 0; -[#4 Trailing delimiter] = 3:14-3:17 - >---< +[#4 Trailing delimiter] = 3:13-3:16 + >---< 3| @An bongo = 0; -[#4 Domain] = 3:4-3:19 - >---------------< +[#4 Domain] = 3:4-3:18 + >--------------< 3| @An bongo = 0; [#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name/name.method2.scope b/data/fixtures/scopes/javascript.core/name/name.method2.scope index c6049d8df9..5446ad1f12 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method2.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method2.scope @@ -41,7 +41,7 @@ class Foo { 2| bar() {} [#2 Domain] = 1:4-2:12 - >---- + >--- 1| @An 2| bar() {} ------------< diff --git a/data/fixtures/scopes/javascript.core/name/name.method4.scope b/data/fixtures/scopes/javascript.core/name/name.method4.scope index 9ab748b227..5cad9c554b 100644 --- a/data/fixtures/scopes/javascript.core/name/name.method4.scope +++ b/data/fixtures/scopes/javascript.core/name/name.method4.scope @@ -36,7 +36,7 @@ class Foo { 2| bar = () => {} [#2 Removal] = 1:4-2:10 - >---- + >--- 1| @An 2| bar = () => {} ----------< @@ -46,7 +46,7 @@ class Foo { 2| bar = () => {} [#2 Domain] = 1:4-2:18 - >---- + >--- 1| @An 2| bar = () => {} ------------------< diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope index 88e8b82287..b62fd4e2ab 100644 --- a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method2.scope @@ -6,13 +6,13 @@ class Foo { [Content] = [Domain] = 1:4-2:12 - >---- + >--- 1| @An 2| bar() {} ------------< [Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| bar() {} 3| } diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope index b457e8101a..3a2efae861 100644 --- a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope +++ b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method4.scope @@ -6,13 +6,13 @@ class Foo { [Content] = [Domain] = 1:4-2:18 - >---- + >--- 1| @An 2| bar = () => {} ------------------< [Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| bar = () => {} 3| } diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method2.scope b/data/fixtures/scopes/javascript.core/statement/statement.method2.scope index 97655d4369..1296b5fa31 100644 --- a/data/fixtures/scopes/javascript.core/statement/statement.method2.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.method2.scope @@ -19,13 +19,13 @@ class Foo { [#2 Content] = [#2 Domain] = 1:4-2:12 - >---- + >--- 1| @An 2| bar() {} ------------< [#2 Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| bar() {} 3| } diff --git a/data/fixtures/scopes/javascript.core/statement/statement.method4.scope b/data/fixtures/scopes/javascript.core/statement/statement.method4.scope index 2f88c02be8..f2ac411d2e 100644 --- a/data/fixtures/scopes/javascript.core/statement/statement.method4.scope +++ b/data/fixtures/scopes/javascript.core/statement/statement.method4.scope @@ -19,13 +19,13 @@ class Foo { [#2 Content] = [#2 Domain] = 1:4-2:18 - >---- + >--- 1| @An 2| bar = () => {} ------------------< [#2 Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| bar = () => {} 3| } diff --git a/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope b/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope index 879332082b..1a20b8425c 100644 --- a/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope +++ b/data/fixtures/scopes/kotlin/namedFunction/namedFunction.method2.scope @@ -6,13 +6,13 @@ class Foo { [Content] = [Domain] = 1:4-2:16 - >---- + >--- 1| @An 2| fun bar() {} ----------------< [Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| fun bar() {} 3| } diff --git a/data/fixtures/scopes/kotlin/statement/statement.method2.scope b/data/fixtures/scopes/kotlin/statement/statement.method2.scope index a3ac4b369b..257e7d8f4f 100644 --- a/data/fixtures/scopes/kotlin/statement/statement.method2.scope +++ b/data/fixtures/scopes/kotlin/statement/statement.method2.scope @@ -19,13 +19,13 @@ class Foo { [#2 Content] = [#2 Domain] = 1:4-2:16 - >---- + >--- 1| @An 2| fun bar() {} ----------------< [#2 Removal] = 1:0-3:0 - >-------- + >------- 1| @An 2| fun bar() {} 3| } diff --git a/data/fixtures/scopes/typescript.core/name/name.field.class.scope b/data/fixtures/scopes/typescript.core/name/name.field.class.scope index 774ce0e9cd..349d5b9b3c 100644 --- a/data/fixtures/scopes/typescript.core/name/name.field.class.scope +++ b/data/fixtures/scopes/typescript.core/name/name.field.class.scope @@ -71,20 +71,20 @@ class Foo { [#3 Insertion delimiter] = " " -[#4 Content] = 3:9-3:14 - >-----< +[#4 Content] = 3:8-3:13 + >-----< 3| @An bongo: number = 0; -[#4 Removal] = 3:4-3:25 - >---------------------< +[#4 Removal] = 3:4-3:24 + >--------------------< 3| @An bongo: number = 0; -[#4 Leading delimiter] = 3:8-3:9 - >-< +[#4 Leading delimiter] = 3:7-3:8 + >-< 3| @An bongo: number = 0; -[#4 Domain] = 3:4-3:27 - >-----------------------< +[#4 Domain] = 3:4-3:26 + >----------------------< 3| @An bongo: number = 0; [#4 Insertion delimiter] = " " From 978a70f7dfffba6abb4d219f67d6026d2221479b Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 7 Feb 2026 19:09:09 +0100 Subject: [PATCH 25/25] Update name --- .../name/name.variable.initialized2.scope | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope b/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope index 9b0173fd0a..7c723a1bfc 100644 --- a/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope +++ b/data/fixtures/scopes/typescript.core/name/name.variable.initialized2.scope @@ -1,24 +1,24 @@ -export type Foo = Bar; +export type Foo = Bar --- [Content] = 0:12-0:15 >---< -0| export type Foo = Bar; +0| export type Foo = Bar [Removal] = 0:0-0:18 >------------------< -0| export type Foo = Bar; +0| export type Foo = Bar [Leading delimiter] = 0:11-0:12 >-< -0| export type Foo = Bar; +0| export type Foo = Bar [Trailing delimiter] = 0:15-0:16 >-< -0| export type Foo = Bar; +0| export type Foo = Bar -[Domain] = 0:0-0:27 - >---------------------------< -0| export type Foo = Bar; +[Domain] = 0:0-0:21 + >---------------------< +0| export type Foo = Bar [Insertion delimiter] = " "