From 34d5f71e343cdac9038f79c9f677a92b68cf48fb Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 13:58:24 +0100 Subject: [PATCH 01/12] rename argument.catch.scope to argument.formal.catch.scope --- ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 .../argument.formal.catch.scope} | 0 ...t.catch.scope => argument.formal.catch.scope} | 0 data/scopeSupportFacetInfos.md | 5 ++++- packages/common/src/scopeSupportFacets/c.ts | 5 ++++- .../common/src/scopeSupportFacets/clojure.ts | 5 ++++- packages/common/src/scopeSupportFacets/cpp.ts | 2 +- packages/common/src/scopeSupportFacets/csharp.ts | 5 ++++- packages/common/src/scopeSupportFacets/css.ts | 5 ++++- packages/common/src/scopeSupportFacets/dart.ts | 5 ++++- packages/common/src/scopeSupportFacets/go.ts | 5 ++++- packages/common/src/scopeSupportFacets/html.ts | 5 ++++- packages/common/src/scopeSupportFacets/java.ts | 8 +++++++- .../common/src/scopeSupportFacets/javascript.ts | 7 ++++++- packages/common/src/scopeSupportFacets/json.ts | 5 ++++- packages/common/src/scopeSupportFacets/kotlin.ts | 8 +++++++- packages/common/src/scopeSupportFacets/latex.ts | 5 ++++- packages/common/src/scopeSupportFacets/lua.ts | 5 ++++- .../common/src/scopeSupportFacets/markdown.ts | 5 ++++- packages/common/src/scopeSupportFacets/php.ts | 5 ++++- .../common/src/scopeSupportFacets/properties.ts | 5 ++++- packages/common/src/scopeSupportFacets/python.ts | 5 ++++- packages/common/src/scopeSupportFacets/r.ts | 5 ++++- packages/common/src/scopeSupportFacets/ruby.ts | 5 ++++- packages/common/src/scopeSupportFacets/rust.ts | 8 +++++++- packages/common/src/scopeSupportFacets/scala.ts | 7 ++++++- packages/common/src/scopeSupportFacets/scm.ts | 5 ++++- .../scopeSupportFacets/scopeSupportFacetInfos.ts | 16 +++++++++++++++- .../scopeSupportFacets.types.ts | 5 ++++- packages/common/src/scopeSupportFacets/talon.ts | 5 ++++- .../common/src/scopeSupportFacets/talonList.ts | 5 ++++- .../common/src/scopeSupportFacets/typescript.ts | 3 +++ packages/common/src/scopeSupportFacets/xml.ts | 5 ++++- packages/common/src/scopeSupportFacets/yaml.ts | 5 ++++- 41 files changed, 144 insertions(+), 30 deletions(-) rename data/fixtures/scopes/cpp/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/csharp/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/dart/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/java/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/javascript.core/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/kotlin/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/php/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/python/argument/{argument.catch.scope => argument.formal.catch.scope} (100%) rename data/fixtures/scopes/scala/{name/argument.catch.scope => argument/argument.formal.catch.scope} (100%) rename data/fixtures/scopes/typescript.core/{argument.catch.scope => argument.formal.catch.scope} (100%) diff --git a/data/fixtures/scopes/cpp/argument/argument.catch.scope b/data/fixtures/scopes/cpp/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/cpp/argument/argument.catch.scope rename to data/fixtures/scopes/cpp/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/csharp/argument/argument.catch.scope b/data/fixtures/scopes/csharp/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/csharp/argument/argument.catch.scope rename to data/fixtures/scopes/csharp/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/dart/argument/argument.catch.scope b/data/fixtures/scopes/dart/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/dart/argument/argument.catch.scope rename to data/fixtures/scopes/dart/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/java/argument/argument.catch.scope b/data/fixtures/scopes/java/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/java/argument/argument.catch.scope rename to data/fixtures/scopes/java/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/javascript.core/argument/argument.catch.scope b/data/fixtures/scopes/javascript.core/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/argument/argument.catch.scope rename to data/fixtures/scopes/javascript.core/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/kotlin/argument/argument.catch.scope b/data/fixtures/scopes/kotlin/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/kotlin/argument/argument.catch.scope rename to data/fixtures/scopes/kotlin/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/php/argument/argument.catch.scope b/data/fixtures/scopes/php/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/php/argument/argument.catch.scope rename to data/fixtures/scopes/php/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/python/argument/argument.catch.scope b/data/fixtures/scopes/python/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/python/argument/argument.catch.scope rename to data/fixtures/scopes/python/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/scala/name/argument.catch.scope b/data/fixtures/scopes/scala/argument/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/scala/name/argument.catch.scope rename to data/fixtures/scopes/scala/argument/argument.formal.catch.scope diff --git a/data/fixtures/scopes/typescript.core/argument.catch.scope b/data/fixtures/scopes/typescript.core/argument.formal.catch.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/argument.catch.scope rename to data/fixtures/scopes/typescript.core/argument.formal.catch.scope diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index a89136bc22..7bc6ca5ace 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -7,13 +7,15 @@ - `argument.actual.constructor.iteration` Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. - `argument.actual.constructor.multiLine` A multi line argument in a constructor call. Insertion delimiter should include new line. - `argument.actual.constructor.singleLine` A single line argument in a constructor call +- `argument.actual.enum` An argument in an enum constructor call +- `argument.actual.enum.iteration` Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. - `argument.actual.iteration` Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. - `argument.actual.method.iteration` Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call.. - `argument.actual.method.multiLine` A multi line argument in a method call. Insertion delimiter should include new line. - `argument.actual.method.singleLine` A single line argument in a method call - `argument.actual.multiLine` A multiline argument in a function call. Insertion delimiter should include new line. - `argument.actual.singleLine` A single line argument in a function call -- `argument.catch` A parameter in a catch clause +- `argument.formal.catch` A parameter in a catch clause - `argument.formal.constructor.iteration` Iteration scope for formal parameters in a constructor declaration: the parameter list. The domain should be the entire constructor. - `argument.formal.constructor.multiLine` A multi line parameter in a constructor declaration. Insertion delimiter should include new line. - `argument.formal.constructor.singleLine` A single line parameter in a constructor declaration @@ -33,6 +35,7 @@ - `argumentList.actual.constructor.multiLine` A multi line list of arguments in a constructor call. Insertion delimiter should include new line. - `argumentList.actual.constructor.singleLine` A single line list of arguments in a constructor call - `argumentList.actual.empty` An empty list of arguments in a function call. Insertion delimiter should be empty. +- `argumentList.actual.enum` A list of arguments in an enum constructor call - `argumentList.actual.method.empty` An empty list of arguments in a method call. Insertion delimiter should be empty. - `argumentList.actual.method.multiLine` A multi line list of arguments in a method call. Insertion delimiter should include new line. - `argumentList.actual.method.singleLine` A single line list of arguments in a method call diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 35fe197ba7..cd6afd2dcf 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -247,6 +247,9 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Enum calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Miscellaneous "key.attribute": notApplicable, @@ -339,7 +342,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/clojure.ts b/packages/common/src/scopeSupportFacets/clojure.ts index c557d6ed59..6cf9226020 100644 --- a/packages/common/src/scopeSupportFacets/clojure.ts +++ b/packages/common/src/scopeSupportFacets/clojure.ts @@ -202,6 +202,9 @@ export const clojureScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -222,7 +225,7 @@ export const clojureScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 6d124663dc..d486862f82 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -35,7 +35,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": supported, "type.argument.formal.lambda": supported, "type.argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index de94867c4b..c5f5e27bcf 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -187,7 +187,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.method.singleLine": supported, "argument.formal.method.multiLine": supported, "argument.formal.method.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, ifStatement: supported, @@ -300,6 +300,9 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { // Enum calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Section section: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 70d27e5a7b..4284d83ad3 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -228,6 +228,9 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -248,7 +251,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/dart.ts b/packages/common/src/scopeSupportFacets/dart.ts index 4d7179e1f3..d5cf313ff5 100644 --- a/packages/common/src/scopeSupportFacets/dart.ts +++ b/packages/common/src/scopeSupportFacets/dart.ts @@ -25,6 +25,9 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.chain": supported, "functionCall.generic": supported, "functionCall.enum": supported, + "argument.actual.enum": supported, + "argumentList.actual.enum": supported, + "argument.actual.enum.iteration": supported, functionCallee: supported, "functionCallee.constructor": supported, "functionCallee.method": supported, @@ -53,7 +56,7 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index 29971d7532..1dd73469d4 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -238,6 +238,9 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Constructors "statement.constructor": notApplicable, @@ -275,7 +278,7 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index d2f10fcf8a..aff44c878b 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -206,6 +206,9 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -226,7 +229,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index ad0a41da3b..afb0166aa5 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -17,6 +17,9 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, + "argument.actual.enum": supported, + "argument.actual.enum.iteration": supported, + "argument.formal.constructor.singleLine": supported, "argument.formal.constructor.multiLine": supported, "argument.formal.constructor.iteration": supported, @@ -26,7 +29,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, @@ -37,6 +40,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, + "argumentList.actual.enum": supported, + "argumentList.formal.lambda.empty": supported, "argumentList.formal.lambda.singleLine": supported, "argumentList.formal.lambda.multiLine": supported, @@ -83,6 +88,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.chain": supported, "functionCall.generic": supported, "functionCall.enum": supported, + functionCallee: supported, "functionCallee.constructor": supported, "functionCallee.method": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 8f5a6f25d0..ef82f5e909 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -83,6 +83,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.constructor.singleLine": supported, "argument.actual.constructor.multiLine": supported, "argument.actual.constructor.iteration": supported, + "argument.formal.singleLine": supported, "argument.formal.multiLine": supported, "argument.formal.iteration": supported, @@ -95,7 +96,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, @@ -106,6 +107,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, + "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, "argumentList.formal.multiLine": supported, @@ -339,6 +341,9 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Miscellaneous "statement.package": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index f469cc093a..d9bb9756c9 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -209,6 +209,9 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -229,7 +232,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index 44c4b0bba4..fb36821d3f 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -16,6 +16,9 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, + "argument.actual.enum": supported, + "argument.actual.enum.iteration": supported, + "argument.formal.singleLine": supported, "argument.formal.multiLine": supported, "argument.formal.iteration": supported, @@ -28,7 +31,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, @@ -39,6 +42,8 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, + "argumentList.actual.enum": supported, + "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, "argumentList.formal.multiLine": supported, @@ -83,6 +88,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.chain": supported, "functionCall.generic": supported, "functionCall.enum": supported, + functionCallee: supported, "functionCallee.constructor": supported, "functionCallee.method": supported, diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index a30d0fd9ce..cc1de8339c 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -211,6 +211,9 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -231,7 +234,7 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index ab54483ed3..de5d06dd1a 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -295,7 +295,7 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, // Switch @@ -331,6 +331,9 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "functionCallee.generic": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Static "statement.static": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 15afa286e7..6182d68bb4 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -209,6 +209,9 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -229,7 +232,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index dd2e3220eb..3bc586d462 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -49,7 +49,7 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, @@ -313,6 +313,9 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "functionCallee.generic": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Uninitialized variables "statement.variable.uninitialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 138afca818..5665b5a207 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -181,6 +181,9 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -194,7 +197,7 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index be6a57fe82..b24fbea16a 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -108,7 +108,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.method.iteration": supported, "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, @@ -295,6 +295,9 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Generic/enum calls "functionCall.generic": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index 58428eac8f..7c2644fd73 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -213,7 +213,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.class": notApplicable, // Catch parameter - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, @@ -248,6 +248,9 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/ruby.ts b/packages/common/src/scopeSupportFacets/ruby.ts index e2aec59995..23dca66a0e 100644 --- a/packages/common/src/scopeSupportFacets/ruby.ts +++ b/packages/common/src/scopeSupportFacets/ruby.ts @@ -224,6 +224,9 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Type system "type.argument.formal": notApplicable, @@ -273,7 +276,7 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { "type.constant": notApplicable, // Catch parameter - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 2d860a9431..f105806b08 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -15,6 +15,9 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, + "argument.actual.enum": supported, + "argument.actual.enum.iteration": supported, + "argument.formal.singleLine": supported, "argument.formal.multiLine": supported, "argument.formal.iteration": supported, @@ -31,6 +34,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.method.empty": supported, "argumentList.actual.method.singleLine": supported, "argumentList.actual.method.multiLine": supported, + "argumentList.actual.enum": supported, + "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, "argumentList.formal.multiLine": supported, @@ -69,6 +74,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.chain": supported, "functionCall.generic": supported, "functionCall.enum": supported, + functionCallee: supported, "functionCallee.method": supported, "functionCallee.chain": supported, @@ -303,7 +309,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 1ab4b83e9b..2bd64c6ef7 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -16,6 +16,9 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, + "argument.actual.enum": supported, + "argument.actual.enum.iteration": supported, + "argument.formal.singleLine": supported, "argument.formal.multiLine": supported, "argument.formal.iteration": supported, @@ -28,7 +31,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "argument.formal.lambda.singleLine": supported, "argument.formal.lambda.multiLine": supported, "argument.formal.lambda.iteration": supported, - "argument.catch": supported, + "argument.formal.catch": supported, "argumentList.actual.empty": supported, "argumentList.actual.singleLine": supported, @@ -39,6 +42,8 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, + "argumentList.actual.enum": supported, + "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, "argumentList.formal.multiLine": supported, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 16f4721ba5..4f198aa9a0 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -206,6 +206,9 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -226,7 +229,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index c2967faf4e..13afee2ea2 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -281,6 +281,7 @@ export const scopeSupportFacetInfos: Record< description: "An enum constructor call", scopeType: "functionCall", }, + functionCallee: { description: "The function being called in a function call", scopeType: "functionCallee", @@ -352,6 +353,15 @@ export const scopeSupportFacetInfos: Record< "arguments in a constructor call", "the argument list. The domain should be the entire constructor call.", ), + "argument.actual.enum": { + description: "An argument in an enum constructor call", + scopeType: "argumentOrParameter", + }, + "argument.actual.enum.iteration": iteration( + "argumentOrParameter", + "arguments in an enum constructor call", + "the argument list. The domain should be the entire enum constructor call.", + ), "argument.formal.singleLine": { description: "A single line parameter in a function declaration", @@ -410,7 +420,7 @@ export const scopeSupportFacetInfos: Record< "formal parameters in a lambda declaration", "the parameter list. The domain should be the entire lambda", ), - "argument.catch": { + "argument.formal.catch": { description: "A parameter in a catch clause", scopeType: "argumentOrParameter", }, @@ -457,6 +467,10 @@ export const scopeSupportFacetInfos: Record< "A multi line list of arguments in a constructor call. Insertion delimiter should include new line.", scopeType: "argumentList", }, + "argumentList.actual.enum": { + description: "A list of arguments in an enum constructor call", + scopeType: "argumentList", + }, "argumentList.formal.empty": { description: diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 8dc1102fec..2eb30a5101 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -104,6 +104,8 @@ export const scopeSupportFacets = [ "argument.actual.constructor.singleLine", "argument.actual.constructor.multiLine", "argument.actual.constructor.iteration", + "argument.actual.enum", + "argument.actual.enum.iteration", "argument.formal.singleLine", "argument.formal.multiLine", @@ -117,7 +119,7 @@ export const scopeSupportFacets = [ "argument.formal.lambda.singleLine", "argument.formal.lambda.multiLine", "argument.formal.lambda.iteration", - "argument.catch", + "argument.formal.catch", "argumentList.actual.empty", "argumentList.actual.singleLine", @@ -128,6 +130,7 @@ export const scopeSupportFacets = [ "argumentList.actual.constructor.empty", "argumentList.actual.constructor.singleLine", "argumentList.actual.constructor.multiLine", + "argumentList.actual.enum", "argumentList.formal.empty", "argumentList.formal.singleLine", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index d748a39c09..acdcc0ba03 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -212,13 +212,16 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Try catch "statement.try": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index 31a4b2d0fd..f1afdda6f1 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -184,6 +184,9 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -197,7 +200,7 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index ae08f0d7e2..c91f1f4e2d 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -75,6 +75,9 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { // Enum calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, // Miscellaneous "type.foreach": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index a8f66f671c..c5a81b9322 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -206,6 +206,9 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -226,7 +229,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 263c52c46a..15801661f1 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -214,6 +214,9 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argumentList.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, "name.iteration.enum": notApplicable, @@ -234,7 +237,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "interior.try": notApplicable, - "argument.catch": notApplicable, + "argument.formal.catch": notApplicable, "name.argument.catch": notApplicable, "type.argument.catch": notApplicable, From d797bd6c634a8da4389cd21852578b7120b49f89 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 14:32:25 +0100 Subject: [PATCH 02/12] new scopes --- .../argument.actual.enum.iteration.scope | 12 +++++++ .../dart/argument/argument.actual.enum.scope | 35 +++++++++++++++++++ .../argumentList.actual.enum.scope | 15 ++++++++ .../argument.actual.enum.iteration.scope | 12 +++++++ .../java/argument/argument.actual.enum.scope | 35 +++++++++++++++++++ .../argumentList.actual.enum.scope | 15 ++++++++ .../argument.actual.enum.iteration.scope | 12 +++++++ .../argument/argument.actual.enum.scope | 35 +++++++++++++++++++ .../argumentList.actual.enum.scope | 15 ++++++++ .../argument.actual.enum.iteration.scope | 12 +++++++ .../rust/argument/argument.actual.enum.scope | 35 +++++++++++++++++++ .../argumentList.actual.enum.scope | 15 ++++++++ .../scopes/scala/functionCall.enum.scope | 19 ---------- .../scopes/scala/functionCallee.enum.scope | 19 ---------- .../common/src/scopeSupportFacets/scala.ts | 12 ++++--- queries/dart.scm | 13 +++++++ queries/kotlin.scm | 14 +++++++- queries/scala.scm | 5 ++- 18 files changed, 283 insertions(+), 47 deletions(-) create mode 100644 data/fixtures/scopes/dart/argument/argument.actual.enum.iteration.scope create mode 100644 data/fixtures/scopes/dart/argument/argument.actual.enum.scope create mode 100644 data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.scope create mode 100644 data/fixtures/scopes/java/argument/argument.actual.enum.iteration.scope create mode 100644 data/fixtures/scopes/java/argument/argument.actual.enum.scope create mode 100644 data/fixtures/scopes/java/argumentList/argumentList.actual.enum.scope create mode 100644 data/fixtures/scopes/kotlin/argument/argument.actual.enum.iteration.scope create mode 100644 data/fixtures/scopes/kotlin/argument/argument.actual.enum.scope create mode 100644 data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.enum.iteration.scope create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.enum.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.scope delete mode 100644 data/fixtures/scopes/scala/functionCall.enum.scope delete mode 100644 data/fixtures/scopes/scala/functionCallee.enum.scope diff --git a/data/fixtures/scopes/dart/argument/argument.actual.enum.iteration.scope b/data/fixtures/scopes/dart/argument/argument.actual.enum.iteration.scope new file mode 100644 index 0000000000..b088265aff --- /dev/null +++ b/data/fixtures/scopes/dart/argument/argument.actual.enum.iteration.scope @@ -0,0 +1,12 @@ +enum Foo { + bar(aaa, bbb); +} +--- + +[Content] = 1:8-1:16 + >--------< +1| bar(aaa, bbb); + +[Domain] = 1:4-1:17 + >-------------< +1| bar(aaa, bbb); diff --git a/data/fixtures/scopes/dart/argument/argument.actual.enum.scope b/data/fixtures/scopes/dart/argument/argument.actual.enum.scope new file mode 100644 index 0000000000..efd8af3dc2 --- /dev/null +++ b/data/fixtures/scopes/dart/argument/argument.actual.enum.scope @@ -0,0 +1,35 @@ +enum Foo { + bar(aaa, bbb); +} +--- + +[#1 Content] = +[#1 Domain] = 1:8-1:11 + >---< +1| bar(aaa, bbb); + +[#1 Removal] = 1:8-1:13 + >-----< +1| bar(aaa, bbb); + +[#1 Trailing delimiter] = 1:11-1:13 + >--< +1| bar(aaa, bbb); + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:13-1:16 + >---< +1| bar(aaa, bbb); + +[#2 Removal] = 1:11-1:16 + >-----< +1| bar(aaa, bbb); + +[#2 Leading delimiter] = 1:11-1:13 + >--< +1| bar(aaa, bbb); + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.scope new file mode 100644 index 0000000000..0044fbb6df --- /dev/null +++ b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.scope @@ -0,0 +1,15 @@ +enum Foo { + bar(aaa, bbb); +} +--- + +[Content] = +[Removal] = 1:8-1:16 + >--------< +1| bar(aaa, bbb); + +[Domain] = 1:4-1:17 + >-------------< +1| bar(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/argument/argument.actual.enum.iteration.scope b/data/fixtures/scopes/java/argument/argument.actual.enum.iteration.scope new file mode 100644 index 0000000000..b088265aff --- /dev/null +++ b/data/fixtures/scopes/java/argument/argument.actual.enum.iteration.scope @@ -0,0 +1,12 @@ +enum Foo { + bar(aaa, bbb); +} +--- + +[Content] = 1:8-1:16 + >--------< +1| bar(aaa, bbb); + +[Domain] = 1:4-1:17 + >-------------< +1| bar(aaa, bbb); diff --git a/data/fixtures/scopes/java/argument/argument.actual.enum.scope b/data/fixtures/scopes/java/argument/argument.actual.enum.scope new file mode 100644 index 0000000000..efd8af3dc2 --- /dev/null +++ b/data/fixtures/scopes/java/argument/argument.actual.enum.scope @@ -0,0 +1,35 @@ +enum Foo { + bar(aaa, bbb); +} +--- + +[#1 Content] = +[#1 Domain] = 1:8-1:11 + >---< +1| bar(aaa, bbb); + +[#1 Removal] = 1:8-1:13 + >-----< +1| bar(aaa, bbb); + +[#1 Trailing delimiter] = 1:11-1:13 + >--< +1| bar(aaa, bbb); + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:13-1:16 + >---< +1| bar(aaa, bbb); + +[#2 Removal] = 1:11-1:16 + >-----< +1| bar(aaa, bbb); + +[#2 Leading delimiter] = 1:11-1:13 + >--< +1| bar(aaa, bbb); + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.scope new file mode 100644 index 0000000000..0044fbb6df --- /dev/null +++ b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.scope @@ -0,0 +1,15 @@ +enum Foo { + bar(aaa, bbb); +} +--- + +[Content] = +[Removal] = 1:8-1:16 + >--------< +1| bar(aaa, bbb); + +[Domain] = 1:4-1:17 + >-------------< +1| bar(aaa, bbb); + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/kotlin/argument/argument.actual.enum.iteration.scope b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.iteration.scope new file mode 100644 index 0000000000..5984e5d6b8 --- /dev/null +++ b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.iteration.scope @@ -0,0 +1,12 @@ +enum class Foo { + bar(aaa, bbb) +} +--- + +[Content] = 1:8-1:16 + >--------< +1| bar(aaa, bbb) + +[Domain] = 1:4-1:17 + >-------------< +1| bar(aaa, bbb) diff --git a/data/fixtures/scopes/kotlin/argument/argument.actual.enum.scope b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.scope new file mode 100644 index 0000000000..d2849cbf4a --- /dev/null +++ b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.scope @@ -0,0 +1,35 @@ +enum class Foo { + bar(aaa, bbb) +} +--- + +[#1 Content] = +[#1 Domain] = 1:8-1:11 + >---< +1| bar(aaa, bbb) + +[#1 Removal] = 1:8-1:13 + >-----< +1| bar(aaa, bbb) + +[#1 Trailing delimiter] = 1:11-1:13 + >--< +1| bar(aaa, bbb) + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:13-1:16 + >---< +1| bar(aaa, bbb) + +[#2 Removal] = 1:11-1:16 + >-----< +1| bar(aaa, bbb) + +[#2 Leading delimiter] = 1:11-1:13 + >--< +1| bar(aaa, bbb) + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.scope new file mode 100644 index 0000000000..96bc6089e0 --- /dev/null +++ b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.scope @@ -0,0 +1,15 @@ +enum class Foo { + bar(aaa, bbb) +} +--- + +[Content] = +[Removal] = 1:8-1:16 + >--------< +1| bar(aaa, bbb) + +[Domain] = 1:4-1:17 + >-------------< +1| bar(aaa, bbb) + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argument/argument.actual.enum.iteration.scope b/data/fixtures/scopes/rust/argument/argument.actual.enum.iteration.scope new file mode 100644 index 0000000000..50e714b199 --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.enum.iteration.scope @@ -0,0 +1,12 @@ +enum Foo { + Bar(aaa, bbb) +} +--- + +[Content] = 1:8-1:16 + >--------< +1| Bar(aaa, bbb) + +[Domain] = 1:4-1:17 + >-------------< +1| Bar(aaa, bbb) diff --git a/data/fixtures/scopes/rust/argument/argument.actual.enum.scope b/data/fixtures/scopes/rust/argument/argument.actual.enum.scope new file mode 100644 index 0000000000..502a71ad7c --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.enum.scope @@ -0,0 +1,35 @@ +enum Foo { + Bar(aaa, bbb) +} +--- + +[#1 Content] = +[#1 Domain] = 1:8-1:11 + >---< +1| Bar(aaa, bbb) + +[#1 Removal] = 1:8-1:13 + >-----< +1| Bar(aaa, bbb) + +[#1 Trailing delimiter] = 1:11-1:13 + >--< +1| Bar(aaa, bbb) + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:13-1:16 + >---< +1| Bar(aaa, bbb) + +[#2 Removal] = 1:11-1:16 + >-----< +1| Bar(aaa, bbb) + +[#2 Leading delimiter] = 1:11-1:13 + >--< +1| Bar(aaa, bbb) + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.scope new file mode 100644 index 0000000000..61eb3961d8 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.scope @@ -0,0 +1,15 @@ +enum Foo { + Bar(aaa, bbb) +} +--- + +[Content] = +[Removal] = 1:8-1:16 + >--------< +1| Bar(aaa, bbb) + +[Domain] = 1:4-1:17 + >-------------< +1| Bar(aaa, bbb) + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/scala/functionCall.enum.scope b/data/fixtures/scopes/scala/functionCall.enum.scope deleted file mode 100644 index 27bea82ee9..0000000000 --- a/data/fixtures/scopes/scala/functionCall.enum.scope +++ /dev/null @@ -1,19 +0,0 @@ -enum Foo { - case Bar() -} ---- - -[Content] = -[Domain] = 1:9-1:14 - >-----< -1| case Bar() - -[Removal] = 1:8-1:14 - >------< -1| case Bar() - -[Leading delimiter] = 1:8-1:9 - >-< -1| case Bar() - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/functionCallee.enum.scope b/data/fixtures/scopes/scala/functionCallee.enum.scope deleted file mode 100644 index 2d6265361f..0000000000 --- a/data/fixtures/scopes/scala/functionCallee.enum.scope +++ /dev/null @@ -1,19 +0,0 @@ -enum Foo { - case Bar() -} ---- - -[Content] = -[Removal] = 1:9-1:12 - >---< -1| case Bar() - -[Leading delimiter] = 1:8-1:9 - >-< -1| case Bar() - -[Domain] = 1:9-1:14 - >-----< -1| case Bar() - -[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 2bd64c6ef7..d8bf47a99a 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -16,8 +16,6 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, - "argument.actual.enum": supported, - "argument.actual.enum.iteration": supported, "argument.formal.singleLine": supported, "argument.formal.multiLine": supported, @@ -42,7 +40,6 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, - "argumentList.actual.enum": supported, "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, @@ -88,14 +85,12 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.method": supported, "functionCall.chain": supported, "functionCall.generic": supported, - "functionCall.enum": supported, functionCallee: supported, "functionCallee.constructor": supported, "functionCallee.method": supported, "functionCallee.chain": supported, "functionCallee.generic": supported, - "functionCallee.enum": supported, namedFunction: supported, "namedFunction.method": supported, @@ -337,6 +332,13 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, + // Constructor calls in enum + "functionCall.enum": notApplicable, + "functionCallee.enum": notApplicable, + "argument.actual.enum": notApplicable, + "argument.actual.enum.iteration": notApplicable, + "argumentList.actual.enum": notApplicable, + // Miscellaneous pairDelimiter: notApplicable, regularExpression: notApplicable, diff --git a/queries/dart.scm b/queries/dart.scm index be4cf0a597..edb48aa4e8 100644 --- a/queries/dart.scm +++ b/queries/dart.scm @@ -341,6 +341,19 @@ (argument_part) ) @functionCall @functionCallee.domain +;;!! bar(aaa, bbb), +;;! ^^^^^^^^ +(enum_constant + (argument_part + (arguments + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + ) + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) +) @argumentList.domain @argumentOrParameter.iteration.domain + ;;!! foo as int ;;! ^^^ (type_cast_expression diff --git a/queries/kotlin.scm b/queries/kotlin.scm index 028de07cb8..a979d2e59f 100644 --- a/queries/kotlin.scm +++ b/queries/kotlin.scm @@ -625,7 +625,19 @@ ) @argumentList (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") (#child-range! @argumentList 1 -2) - ) + ) @_dummy + (#not-type? @_dummy enum_entry) +) @argumentList.domain @argumentOrParameter.iteration.domain + +;;!! foo(aaa, bbb) +;;! ^^^^^^^^ +(enum_entry + (value_arguments + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) ) @argumentList.domain @argumentOrParameter.iteration.domain (value_arguments diff --git a/queries/scala.scm b/queries/scala.scm index bf3562322b..f271f66cef 100644 --- a/queries/scala.scm +++ b/queries/scala.scm @@ -238,9 +238,8 @@ ) ;;!! case Baz(x: Int) (full_enum_case - name: (_) @name @functionCallee - class_parameters: (_) - ) @functionCall @functionCallee.domain + name: (_) @name + ) ] ) @name.domain From 962205a7da0e6785bb140d7332a2082db463b78e Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 14:49:11 +0100 Subject: [PATCH 03/12] enum multi --- .../argument.actual.enum.multiLine.scope | 46 ++++++++++++++ ... => argument.actual.enum.singleLine.scope} | 0 .../argumentList.actual.enum.empty.scope | 15 +++++ .../argumentList.actual.enum.multiLine.scope | 35 +++++++++++ ...argumentList.actual.enum.singleLine.scope} | 0 .../argument.actual.enum.multiLine.scope | 46 ++++++++++++++ ... => argument.actual.enum.singleLine.scope} | 0 .../argumentList.actual.enum.empty.scope | 15 +++++ .../argumentList.actual.enum.multiLine.scope | 35 +++++++++++ ...argumentList.actual.enum.singleLine.scope} | 0 .../argument.actual.enum.multiLine.scope | 46 ++++++++++++++ ... => argument.actual.enum.singleLine.scope} | 0 .../argumentList.actual.enum.empty.scope | 15 +++++ .../argumentList.actual.enum.multiLine.scope | 35 +++++++++++ ...argumentList.actual.enum.singleLine.scope} | 0 .../argument.actual.enum.multiLine.scope | 46 ++++++++++++++ ... => argument.actual.enum.singleLine.scope} | 0 .../argumentList.actual.enum.empty.scope | 15 +++++ .../argumentList.actual.enum.multiLine.scope | 26 ++++++++ ...argumentList.actual.enum.singleLine.scope} | 0 data/scopeSupportFacetInfos.md | 9 ++- packages/common/src/scopeSupportFacets/c.ts | 7 ++- .../common/src/scopeSupportFacets/clojure.ts | 7 ++- .../common/src/scopeSupportFacets/csharp.ts | 7 ++- packages/common/src/scopeSupportFacets/css.ts | 7 ++- .../common/src/scopeSupportFacets/dart.ts | 7 ++- packages/common/src/scopeSupportFacets/go.ts | 7 ++- .../common/src/scopeSupportFacets/html.ts | 7 ++- .../common/src/scopeSupportFacets/java.ts | 7 ++- .../src/scopeSupportFacets/javascript.ts | 7 ++- .../common/src/scopeSupportFacets/json.ts | 7 ++- .../common/src/scopeSupportFacets/kotlin.ts | 7 ++- .../common/src/scopeSupportFacets/latex.ts | 7 ++- packages/common/src/scopeSupportFacets/lua.ts | 11 +++- .../common/src/scopeSupportFacets/markdown.ts | 7 ++- packages/common/src/scopeSupportFacets/php.ts | 63 +++++++++++-------- .../src/scopeSupportFacets/properties.ts | 7 ++- .../common/src/scopeSupportFacets/python.ts | 7 ++- packages/common/src/scopeSupportFacets/r.ts | 7 ++- .../common/src/scopeSupportFacets/ruby.ts | 7 ++- .../common/src/scopeSupportFacets/rust.ts | 7 ++- .../common/src/scopeSupportFacets/scala.ts | 9 ++- packages/common/src/scopeSupportFacets/scm.ts | 7 ++- .../scopeSupportFacetInfos.ts | 25 ++++++-- .../scopeSupportFacets.types.ts | 7 ++- .../common/src/scopeSupportFacets/talon.ts | 7 ++- .../src/scopeSupportFacets/talonList.ts | 7 ++- .../src/scopeSupportFacets/typescript.ts | 9 ++- packages/common/src/scopeSupportFacets/xml.ts | 7 ++- .../common/src/scopeSupportFacets/yaml.ts | 7 ++- 50 files changed, 577 insertions(+), 92 deletions(-) create mode 100644 data/fixtures/scopes/dart/argument/argument.actual.enum.multiLine.scope rename data/fixtures/scopes/dart/argument/{argument.actual.enum.scope => argument.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.empty.scope create mode 100644 data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.multiLine.scope rename data/fixtures/scopes/dart/argumentList/{argumentList.actual.enum.scope => argumentList.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/java/argument/argument.actual.enum.multiLine.scope rename data/fixtures/scopes/java/argument/{argument.actual.enum.scope => argument.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/java/argumentList/argumentList.actual.enum.empty.scope create mode 100644 data/fixtures/scopes/java/argumentList/argumentList.actual.enum.multiLine.scope rename data/fixtures/scopes/java/argumentList/{argumentList.actual.enum.scope => argumentList.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/kotlin/argument/argument.actual.enum.multiLine.scope rename data/fixtures/scopes/kotlin/argument/{argument.actual.enum.scope => argument.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.empty.scope create mode 100644 data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.multiLine.scope rename data/fixtures/scopes/kotlin/argumentList/{argumentList.actual.enum.scope => argumentList.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/rust/argument/argument.actual.enum.multiLine.scope rename data/fixtures/scopes/rust/argument/{argument.actual.enum.scope => argument.actual.enum.singleLine.scope} (100%) create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.empty.scope create mode 100644 data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.multiLine.scope rename data/fixtures/scopes/rust/argumentList/{argumentList.actual.enum.scope => argumentList.actual.enum.singleLine.scope} (100%) diff --git a/data/fixtures/scopes/dart/argument/argument.actual.enum.multiLine.scope b/data/fixtures/scopes/dart/argument/argument.actual.enum.multiLine.scope new file mode 100644 index 0000000000..70187beae6 --- /dev/null +++ b/data/fixtures/scopes/dart/argument/argument.actual.enum.multiLine.scope @@ -0,0 +1,46 @@ +enum Foo { + bar( + aaa, + bbb + ); +} +--- + +[#1 Content] = +[#1 Domain] = 2:8-2:11 + >---< +2| aaa, + +[#1 Removal] = 2:8-3:8 + >---- +2| aaa, +3| bbb + --------< + +[#1 Trailing delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:8-3:11 + >---< +3| bbb + +[#2 Removal] = 2:11-3:11 + >- +2| aaa, +3| bbb + -----------< + +[#2 Leading delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/dart/argument/argument.actual.enum.scope b/data/fixtures/scopes/dart/argument/argument.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/dart/argument/argument.actual.enum.scope rename to data/fixtures/scopes/dart/argument/argument.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.empty.scope b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.empty.scope new file mode 100644 index 0000000000..07d933a3fd --- /dev/null +++ b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.empty.scope @@ -0,0 +1,15 @@ +enum Foo { + bar(); +} +--- + +[Content] = +[Removal] = 1:8-1:8 + >< +1| bar(); + +[Domain] = 1:4-1:9 + >-----< +1| bar(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.multiLine.scope b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.multiLine.scope new file mode 100644 index 0000000000..cf04266ba6 --- /dev/null +++ b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.multiLine.scope @@ -0,0 +1,35 @@ +enum Foo { + bar( + aaa, + bbb + ); +} +--- + +[Content] = 2:8-3:11 + >---- +2| aaa, +3| bbb + -----------< + +[Removal] = 1:8-4:4 + > +1| bar( +2| aaa, +3| bbb +4| ); + ----< + +[Leading delimiter] = 2:0-2:8 + >--------< +2| aaa, + +[Domain] = 1:4-4:5 + >---- +1| bar( +2| aaa, +3| bbb +4| ); + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.scope rename to data/fixtures/scopes/dart/argumentList/argumentList.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/java/argument/argument.actual.enum.multiLine.scope b/data/fixtures/scopes/java/argument/argument.actual.enum.multiLine.scope new file mode 100644 index 0000000000..70187beae6 --- /dev/null +++ b/data/fixtures/scopes/java/argument/argument.actual.enum.multiLine.scope @@ -0,0 +1,46 @@ +enum Foo { + bar( + aaa, + bbb + ); +} +--- + +[#1 Content] = +[#1 Domain] = 2:8-2:11 + >---< +2| aaa, + +[#1 Removal] = 2:8-3:8 + >---- +2| aaa, +3| bbb + --------< + +[#1 Trailing delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:8-3:11 + >---< +3| bbb + +[#2 Removal] = 2:11-3:11 + >- +2| aaa, +3| bbb + -----------< + +[#2 Leading delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/java/argument/argument.actual.enum.scope b/data/fixtures/scopes/java/argument/argument.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/java/argument/argument.actual.enum.scope rename to data/fixtures/scopes/java/argument/argument.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.empty.scope b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.empty.scope new file mode 100644 index 0000000000..07d933a3fd --- /dev/null +++ b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.empty.scope @@ -0,0 +1,15 @@ +enum Foo { + bar(); +} +--- + +[Content] = +[Removal] = 1:8-1:8 + >< +1| bar(); + +[Domain] = 1:4-1:9 + >-----< +1| bar(); + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.multiLine.scope b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.multiLine.scope new file mode 100644 index 0000000000..cf04266ba6 --- /dev/null +++ b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.multiLine.scope @@ -0,0 +1,35 @@ +enum Foo { + bar( + aaa, + bbb + ); +} +--- + +[Content] = 2:8-3:11 + >---- +2| aaa, +3| bbb + -----------< + +[Removal] = 1:8-4:4 + > +1| bar( +2| aaa, +3| bbb +4| ); + ----< + +[Leading delimiter] = 2:0-2:8 + >--------< +2| aaa, + +[Domain] = 1:4-4:5 + >---- +1| bar( +2| aaa, +3| bbb +4| ); + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/java/argumentList/argumentList.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/java/argumentList/argumentList.actual.enum.scope rename to data/fixtures/scopes/java/argumentList/argumentList.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/kotlin/argument/argument.actual.enum.multiLine.scope b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.multiLine.scope new file mode 100644 index 0000000000..d891c93189 --- /dev/null +++ b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.multiLine.scope @@ -0,0 +1,46 @@ +enum class Foo { + bar( + aaa, + bbb + ) +} +--- + +[#1 Content] = +[#1 Domain] = 2:8-2:11 + >---< +2| aaa, + +[#1 Removal] = 2:8-3:8 + >---- +2| aaa, +3| bbb + --------< + +[#1 Trailing delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:8-3:11 + >---< +3| bbb + +[#2 Removal] = 2:11-3:11 + >- +2| aaa, +3| bbb + -----------< + +[#2 Leading delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/kotlin/argument/argument.actual.enum.scope b/data/fixtures/scopes/kotlin/argument/argument.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/kotlin/argument/argument.actual.enum.scope rename to data/fixtures/scopes/kotlin/argument/argument.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.empty.scope b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.empty.scope new file mode 100644 index 0000000000..6784e5504c --- /dev/null +++ b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.empty.scope @@ -0,0 +1,15 @@ +enum class Foo { + bar() +} +--- + +[Content] = +[Removal] = 1:8-1:8 + >< +1| bar() + +[Domain] = 1:4-1:9 + >-----< +1| bar() + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.multiLine.scope b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.multiLine.scope new file mode 100644 index 0000000000..fb5d3d0244 --- /dev/null +++ b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.multiLine.scope @@ -0,0 +1,35 @@ +enum class Foo { + bar( + aaa, + bbb + ) +} +--- + +[Content] = 2:8-3:11 + >---- +2| aaa, +3| bbb + -----------< + +[Removal] = 1:8-4:4 + > +1| bar( +2| aaa, +3| bbb +4| ) + ----< + +[Leading delimiter] = 2:0-2:8 + >--------< +2| aaa, + +[Domain] = 1:4-4:5 + >---- +1| bar( +2| aaa, +3| bbb +4| ) + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.scope rename to data/fixtures/scopes/kotlin/argumentList/argumentList.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/rust/argument/argument.actual.enum.multiLine.scope b/data/fixtures/scopes/rust/argument/argument.actual.enum.multiLine.scope new file mode 100644 index 0000000000..d93cc6dddc --- /dev/null +++ b/data/fixtures/scopes/rust/argument/argument.actual.enum.multiLine.scope @@ -0,0 +1,46 @@ +enum Foo { + Bar( + aaa, + bbb + ) +} +--- + +[#1 Content] = +[#1 Domain] = 2:8-2:11 + >---< +2| aaa, + +[#1 Removal] = 2:8-3:8 + >---- +2| aaa, +3| bbb + --------< + +[#1 Trailing delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 3:8-3:11 + >---< +3| bbb + +[#2 Removal] = 2:11-3:11 + >- +2| aaa, +3| bbb + -----------< + +[#2 Leading delimiter] = 2:11-3:8 + >- +2| aaa, +3| bbb + --------< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argument/argument.actual.enum.scope b/data/fixtures/scopes/rust/argument/argument.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/rust/argument/argument.actual.enum.scope rename to data/fixtures/scopes/rust/argument/argument.actual.enum.singleLine.scope diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.empty.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.empty.scope new file mode 100644 index 0000000000..f95fff4273 --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.empty.scope @@ -0,0 +1,15 @@ +enum Foo { + Bar() +} +--- + +[Content] = +[Removal] = 1:8-1:8 + >< +1| Bar() + +[Domain] = 1:4-1:9 + >-----< +1| Bar() + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.multiLine.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.multiLine.scope new file mode 100644 index 0000000000..3a9f007a7c --- /dev/null +++ b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.multiLine.scope @@ -0,0 +1,26 @@ +enum Foo { + Bar( + aaa, + bbb + ) +} +--- + +[Content] = +[Removal] = 1:8-4:4 + > +1| Bar( +2| aaa, +3| bbb +4| ) + ----< + +[Domain] = 1:4-4:5 + >---- +1| Bar( +2| aaa, +3| bbb +4| ) + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.scope b/data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.singleLine.scope similarity index 100% rename from data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.scope rename to data/fixtures/scopes/rust/argumentList/argumentList.actual.enum.singleLine.scope diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 7bc6ca5ace..1fe4006c41 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -7,10 +7,11 @@ - `argument.actual.constructor.iteration` Iteration scope for arguments in a constructor call: the argument list. The domain should be the entire constructor call.. - `argument.actual.constructor.multiLine` A multi line argument in a constructor call. Insertion delimiter should include new line. - `argument.actual.constructor.singleLine` A single line argument in a constructor call -- `argument.actual.enum` An argument in an enum constructor call - `argument.actual.enum.iteration` Iteration scope for arguments in an enum constructor call: the argument list. The domain should be the entire enum constructor call.. +- `argument.actual.enum.multiLine` A multi line argument in an enum constructor call. Insertion delimiter should include new line. +- `argument.actual.enum.singleLine` A single line argument in an enum constructor call - `argument.actual.iteration` Iteration scope for arguments in a function call: the argument list. The domain should be the entire function call. -- `argument.actual.method.iteration` Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call.. +- `argument.actual.method.iteration` Iteration scope for arguments in a method call: the argument list. The domain should be the entire method call. - `argument.actual.method.multiLine` A multi line argument in a method call. Insertion delimiter should include new line. - `argument.actual.method.singleLine` A single line argument in a method call - `argument.actual.multiLine` A multiline argument in a function call. Insertion delimiter should include new line. @@ -35,7 +36,9 @@ - `argumentList.actual.constructor.multiLine` A multi line list of arguments in a constructor call. Insertion delimiter should include new line. - `argumentList.actual.constructor.singleLine` A single line list of arguments in a constructor call - `argumentList.actual.empty` An empty list of arguments in a function call. Insertion delimiter should be empty. -- `argumentList.actual.enum` A list of arguments in an enum constructor call +- `argumentList.actual.enum.empty` An empty list of arguments in an enum constructor call. Insertion delimiter should be empty. +- `argumentList.actual.enum.multiLine` A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line. +- `argumentList.actual.enum.singleLine` A single line list of arguments in an enum constructor call - `argumentList.actual.method.empty` An empty list of arguments in a method call. Insertion delimiter should be empty. - `argumentList.actual.method.multiLine` A multi line list of arguments in a method call. Insertion delimiter should include new line. - `argumentList.actual.method.singleLine` A single line list of arguments in a method call diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index cd6afd2dcf..b40773d96d 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -247,8 +247,11 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Enum calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Miscellaneous diff --git a/packages/common/src/scopeSupportFacets/clojure.ts b/packages/common/src/scopeSupportFacets/clojure.ts index 6cf9226020..c27d44acd0 100644 --- a/packages/common/src/scopeSupportFacets/clojure.ts +++ b/packages/common/src/scopeSupportFacets/clojure.ts @@ -202,8 +202,11 @@ export const clojureScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index c5f5e27bcf..913808c438 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -300,8 +300,11 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { // Enum calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Section diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 4284d83ad3..ab842f4526 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -228,8 +228,11 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/dart.ts b/packages/common/src/scopeSupportFacets/dart.ts index d5cf313ff5..d3f0421326 100644 --- a/packages/common/src/scopeSupportFacets/dart.ts +++ b/packages/common/src/scopeSupportFacets/dart.ts @@ -25,8 +25,11 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = { "functionCall.chain": supported, "functionCall.generic": supported, "functionCall.enum": supported, - "argument.actual.enum": supported, - "argumentList.actual.enum": supported, + "argument.actual.enum.singleLine": supported, + "argument.actual.enum.multiLine": supported, + "argumentList.actual.enum.empty": supported, + "argumentList.actual.enum.singleLine": supported, + "argumentList.actual.enum.multiLine": supported, "argument.actual.enum.iteration": supported, functionCallee: supported, "functionCallee.constructor": supported, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index 1dd73469d4..54725dbf14 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -238,8 +238,11 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Constructors diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index aff44c878b..82c850f30e 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -206,8 +206,11 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index afb0166aa5..badd4fc72a 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -17,7 +17,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, - "argument.actual.enum": supported, + "argument.actual.enum.singleLine": supported, + "argument.actual.enum.multiLine": supported, "argument.actual.enum.iteration": supported, "argument.formal.constructor.singleLine": supported, @@ -40,7 +41,9 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, - "argumentList.actual.enum": supported, + "argumentList.actual.enum.empty": supported, + "argumentList.actual.enum.singleLine": supported, + "argumentList.actual.enum.multiLine": supported, "argumentList.formal.lambda.empty": supported, "argumentList.formal.lambda.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index ef82f5e909..35be1cd9a9 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -341,8 +341,11 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Miscellaneous diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index d9bb9756c9..1c43e742da 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -209,8 +209,11 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index fb36821d3f..e14b3c9296 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -16,7 +16,8 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, - "argument.actual.enum": supported, + "argument.actual.enum.singleLine": supported, + "argument.actual.enum.multiLine": supported, "argument.actual.enum.iteration": supported, "argument.formal.singleLine": supported, @@ -42,7 +43,9 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.constructor.empty": supported, "argumentList.actual.constructor.singleLine": supported, "argumentList.actual.constructor.multiLine": supported, - "argumentList.actual.enum": supported, + "argumentList.actual.enum.empty": supported, + "argumentList.actual.enum.singleLine": supported, + "argumentList.actual.enum.multiLine": supported, "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index cc1de8339c..1fbc5a0a1e 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -211,8 +211,11 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index de5d06dd1a..ce66528a01 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -326,13 +326,18 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "name.namespace": notApplicable, "interior.namespace": notApplicable, - // Generic/enum calls + // Generic types "functionCall.generic": notApplicable, "functionCallee.generic": notApplicable, + + // Enum constructor calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Static diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 6182d68bb4..4c874cfee8 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -209,8 +209,11 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index 3bc586d462..76d79a3861 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -242,30 +242,6 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLunICABLE */ - // Not a language construct in PHP - "type.typeArgument": notApplicable, - "type.typeArgument.iteration": notApplicable, - "type.alias": notApplicable, - "statement.typeAlias": notApplicable, - "name.typeAlias": notApplicable, - "value.typeAlias": notApplicable, - - // Not used by PHP syntax - section: notApplicable, - "section.iteration.document": notApplicable, - "section.iteration.parent": notApplicable, - command: notApplicable, - "statement.command": notApplicable, - "name.command": notApplicable, - "value.command": notApplicable, - "interior.command": notApplicable, - notebookCell: notApplicable, - "interior.cell": notApplicable, - environment: notApplicable, - selector: notApplicable, - unit: notApplicable, - pairDelimiter: notApplicable, - // XML/HTML facets element: notApplicable, tags: notApplicable, @@ -308,13 +284,20 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed.multiLine": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, - // Generic / enum call variants + // Generic types "functionCall.generic": notApplicable, "functionCallee.generic": notApplicable, + "type.typeArgument": notApplicable, + "type.typeArgument.iteration": notApplicable, + + // Enum constructor call. "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Uninitialized variables @@ -326,6 +309,28 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "statement.static": notApplicable, "interior.static": notApplicable, + // Command + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Section + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + + // Type alias + "type.alias": notApplicable, + "statement.typeAlias": notApplicable, + "name.typeAlias": notApplicable, + "value.typeAlias": notApplicable, + // Miscellaneous "statement.misc": notApplicable, "type.variable.initialized": notApplicable, @@ -333,4 +338,8 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.block": notApplicable, "class.iteration.class": notApplicable, regularExpression: notApplicable, + environment: notApplicable, + selector: notApplicable, + unit: notApplicable, + pairDelimiter: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 5665b5a207..68c3600ad9 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -181,8 +181,11 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index b24fbea16a..24e9bae33f 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -295,8 +295,11 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Generic/enum calls diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index 7c2644fd73..1456f9663b 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -248,8 +248,11 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/ruby.ts b/packages/common/src/scopeSupportFacets/ruby.ts index 23dca66a0e..09462930b2 100644 --- a/packages/common/src/scopeSupportFacets/ruby.ts +++ b/packages/common/src/scopeSupportFacets/ruby.ts @@ -224,8 +224,11 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Type system diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index f105806b08..0085172f05 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -15,7 +15,8 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "argument.actual.method.singleLine": supported, "argument.actual.method.multiLine": supported, "argument.actual.method.iteration": supported, - "argument.actual.enum": supported, + "argument.actual.enum.singleLine": supported, + "argument.actual.enum.multiLine": supported, "argument.actual.enum.iteration": supported, "argument.formal.singleLine": supported, @@ -34,7 +35,9 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "argumentList.actual.method.empty": supported, "argumentList.actual.method.singleLine": supported, "argumentList.actual.method.multiLine": supported, - "argumentList.actual.enum": supported, + "argumentList.actual.enum.empty": supported, + "argumentList.actual.enum.singleLine": supported, + "argumentList.actual.enum.multiLine": supported, "argumentList.formal.empty": supported, "argumentList.formal.singleLine": supported, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index d8bf47a99a..8ba4b29d14 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -332,12 +332,15 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, - // Constructor calls in enum + // Enum constructor calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, - "argumentList.actual.enum": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, // Miscellaneous pairDelimiter: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 4f198aa9a0..d65d36c528 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -206,8 +206,11 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 13afee2ea2..19027a6e0e 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -337,7 +337,7 @@ export const scopeSupportFacetInfos: Record< "argument.actual.method.iteration": iteration( "argumentOrParameter", "arguments in a method call", - "the argument list. The domain should be the entire method call.", + "the argument list. The domain should be the entire method call", ), "argument.actual.constructor.singleLine": { description: "A single line argument in a constructor call", @@ -353,8 +353,13 @@ export const scopeSupportFacetInfos: Record< "arguments in a constructor call", "the argument list. The domain should be the entire constructor call.", ), - "argument.actual.enum": { - description: "An argument in an enum constructor call", + "argument.actual.enum.singleLine": { + description: "A single line argument in an enum constructor call", + scopeType: "argumentOrParameter", + }, + "argument.actual.enum.multiLine": { + description: + "A multi line argument in an enum constructor call. Insertion delimiter should include new line.", scopeType: "argumentOrParameter", }, "argument.actual.enum.iteration": iteration( @@ -467,8 +472,18 @@ export const scopeSupportFacetInfos: Record< "A multi line list of arguments in a constructor call. Insertion delimiter should include new line.", scopeType: "argumentList", }, - "argumentList.actual.enum": { - description: "A list of arguments in an enum constructor call", + "argumentList.actual.enum.empty": { + description: + "An empty list of arguments in an enum constructor call. Insertion delimiter should be empty.", + scopeType: "argumentList", + }, + "argumentList.actual.enum.singleLine": { + description: "A single line list of arguments in an enum constructor call", + scopeType: "argumentList", + }, + "argumentList.actual.enum.multiLine": { + description: + "A multi line list of arguments in an enum constructor call. Insertion delimiter should include new line.", scopeType: "argumentList", }, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 2eb30a5101..31a3ff11b0 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -104,7 +104,8 @@ export const scopeSupportFacets = [ "argument.actual.constructor.singleLine", "argument.actual.constructor.multiLine", "argument.actual.constructor.iteration", - "argument.actual.enum", + "argument.actual.enum.singleLine", + "argument.actual.enum.multiLine", "argument.actual.enum.iteration", "argument.formal.singleLine", @@ -130,7 +131,9 @@ export const scopeSupportFacets = [ "argumentList.actual.constructor.empty", "argumentList.actual.constructor.singleLine", "argumentList.actual.constructor.multiLine", - "argumentList.actual.enum", + "argumentList.actual.enum.empty", + "argumentList.actual.enum.singleLine", + "argumentList.actual.enum.multiLine", "argumentList.formal.empty", "argumentList.formal.singleLine", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index acdcc0ba03..eadd80bd02 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -212,8 +212,11 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.enum": notApplicable, "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Try catch diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index f1afdda6f1..3d17eca5b2 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -184,8 +184,11 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index c91f1f4e2d..4083405891 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -72,11 +72,14 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "interior.element": notApplicable, "textFragment.element": notApplicable, - // Enum calls + // Enum constructor calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, // Miscellaneous diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index c5a81b9322..8dedae9f40 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -206,8 +206,11 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 15801661f1..94bfec8135 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -214,8 +214,11 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "statement.enum": notApplicable, "functionCallee.enum": notApplicable, "functionCall.enum": notApplicable, - "argument.actual.enum": notApplicable, - "argumentList.actual.enum": notApplicable, + "argument.actual.enum.singleLine": notApplicable, + "argument.actual.enum.multiLine": notApplicable, + "argumentList.actual.enum.empty": notApplicable, + "argumentList.actual.enum.singleLine": notApplicable, + "argumentList.actual.enum.multiLine": notApplicable, "argument.actual.enum.iteration": notApplicable, "name.enum": notApplicable, "name.field.enum": notApplicable, From 580dc8cb0c2a679f69a8a73db9a3dac193414fd4 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 15:31:56 +0100 Subject: [PATCH 04/12] lambda return type --- .../scopes/cpp/type/type.return.lambda.scope | 20 ++++++++++++++++ .../scopes/go/type/type.return.lambda.scope | 24 +++++++++++++++++++ .../scopes/php/type/type.return.lambda.scope | 21 ++++++++++++++++ .../scopes/php/type/type.return.lambda2.scope | 21 ++++++++++++++++ .../scopes/rust/type/type.return.lambda.scope | 20 ++++++++++++++++ .../type/type.return.lambda.scope | 20 ++++++++++++++++ data/scopeSupportFacetInfos.md | 1 + packages/common/src/scopeSupportFacets/c.ts | 3 ++- .../common/src/scopeSupportFacets/clojure.ts | 1 + packages/common/src/scopeSupportFacets/cpp.ts | 1 + .../common/src/scopeSupportFacets/csharp.ts | 1 + packages/common/src/scopeSupportFacets/css.ts | 1 + .../common/src/scopeSupportFacets/dart.ts | 1 + packages/common/src/scopeSupportFacets/go.ts | 1 + .../common/src/scopeSupportFacets/html.ts | 1 + .../common/src/scopeSupportFacets/java.ts | 1 + .../src/scopeSupportFacets/javascript.ts | 1 + .../common/src/scopeSupportFacets/json.ts | 1 + .../common/src/scopeSupportFacets/kotlin.ts | 1 + .../common/src/scopeSupportFacets/latex.ts | 1 + packages/common/src/scopeSupportFacets/lua.ts | 1 + .../common/src/scopeSupportFacets/markdown.ts | 1 + packages/common/src/scopeSupportFacets/php.ts | 1 + .../src/scopeSupportFacets/properties.ts | 1 + .../common/src/scopeSupportFacets/python.ts | 1 + packages/common/src/scopeSupportFacets/r.ts | 1 + .../common/src/scopeSupportFacets/ruby.ts | 1 + .../common/src/scopeSupportFacets/rust.ts | 1 + .../common/src/scopeSupportFacets/scala.ts | 1 + packages/common/src/scopeSupportFacets/scm.ts | 1 + .../scopeSupportFacetInfos.ts | 4 ++++ .../scopeSupportFacets.types.ts | 1 + .../common/src/scopeSupportFacets/talon.ts | 1 + .../src/scopeSupportFacets/talonList.ts | 1 + .../src/scopeSupportFacets/typescript.ts | 1 + packages/common/src/scopeSupportFacets/xml.ts | 1 + .../common/src/scopeSupportFacets/yaml.ts | 1 + queries/cpp.scm | 14 ++++++++--- queries/go.scm | 8 +++++-- queries/php.scm | 19 +++++++++++---- queries/rust.scm | 8 ++++++- 41 files changed, 199 insertions(+), 12 deletions(-) create mode 100644 data/fixtures/scopes/cpp/type/type.return.lambda.scope create mode 100644 data/fixtures/scopes/go/type/type.return.lambda.scope create mode 100644 data/fixtures/scopes/php/type/type.return.lambda.scope create mode 100644 data/fixtures/scopes/php/type/type.return.lambda2.scope create mode 100644 data/fixtures/scopes/rust/type/type.return.lambda.scope create mode 100644 data/fixtures/scopes/typescript.core/type/type.return.lambda.scope diff --git a/data/fixtures/scopes/cpp/type/type.return.lambda.scope b/data/fixtures/scopes/cpp/type/type.return.lambda.scope new file mode 100644 index 0000000000..3f71a7e04e --- /dev/null +++ b/data/fixtures/scopes/cpp/type/type.return.lambda.scope @@ -0,0 +1,20 @@ +[]() -> int {} +--- + +[Content] = 0:8-0:11 + >---< +0| []() -> int {} + +[Removal] = 0:4-0:11 + >-------< +0| []() -> int {} + +[Leading delimiter] = 0:4-0:8 + >----< +0| []() -> int {} + +[Domain] = 0:0-0:14 + >--------------< +0| []() -> int {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.return.lambda.scope b/data/fixtures/scopes/go/type/type.return.lambda.scope new file mode 100644 index 0000000000..1836c0e180 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.return.lambda.scope @@ -0,0 +1,24 @@ +foo := func() int {} +--- + +[Content] = 0:14-0:17 + >---< +0| foo := func() int {} + +[Removal] = 0:14-0:18 + >----< +0| foo := func() int {} + +[Leading delimiter] = 0:13-0:14 + >-< +0| foo := func() int {} + +[Trailing delimiter] = 0:17-0:18 + >-< +0| foo := func() int {} + +[Domain] = 0:7-0:20 + >-------------< +0| foo := func() int {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.return.lambda.scope b/data/fixtures/scopes/php/type/type.return.lambda.scope new file mode 100644 index 0000000000..e7d088ab87 --- /dev/null +++ b/data/fixtures/scopes/php/type/type.return.lambda.scope @@ -0,0 +1,21 @@ +---< +1| function(): int {}; + +[Removal] = 1:10-1:15 + >-----< +1| function(): int {}; + +[Leading delimiter] = 1:10-1:12 + >--< +1| function(): int {}; + +[Domain] = 1:0-1:18 + >------------------< +1| function(): int {}; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type/type.return.lambda2.scope b/data/fixtures/scopes/php/type/type.return.lambda2.scope new file mode 100644 index 0000000000..52c4bb1724 --- /dev/null +++ b/data/fixtures/scopes/php/type/type.return.lambda2.scope @@ -0,0 +1,21 @@ + 0; +--- + +[Content] = 1:6-1:9 + >---< +1| fn(): int => 0; + +[Removal] = 1:4-1:9 + >-----< +1| fn(): int => 0; + +[Leading delimiter] = 1:4-1:6 + >--< +1| fn(): int => 0; + +[Domain] = 1:0-1:14 + >--------------< +1| fn(): int => 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/rust/type/type.return.lambda.scope b/data/fixtures/scopes/rust/type/type.return.lambda.scope new file mode 100644 index 0000000000..1353f41f2a --- /dev/null +++ b/data/fixtures/scopes/rust/type/type.return.lambda.scope @@ -0,0 +1,20 @@ +|| -> i32 {} +--- + +[Content] = 0:6-0:9 + >---< +0| || -> i32 {} + +[Removal] = 0:2-0:9 + >-------< +0| || -> i32 {} + +[Leading delimiter] = 0:2-0:6 + >----< +0| || -> i32 {} + +[Domain] = 0:0-0:12 + >------------< +0| || -> i32 {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type/type.return.lambda.scope b/data/fixtures/scopes/typescript.core/type/type.return.lambda.scope new file mode 100644 index 0000000000..18cd3c25e4 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type/type.return.lambda.scope @@ -0,0 +1,20 @@ +(): number => {} +--- + +[Content] = 0:4-0:10 + >------< +0| (): number => {} + +[Removal] = 0:2-0:10 + >--------< +0| (): number => {} + +[Leading delimiter] = 0:2-0:4 + >--< +0| (): number => {} + +[Domain] = 0:0-0:16 + >----------------< +0| (): number => {} + +[Insertion delimiter] = " " diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 1fe4006c41..18912301ba 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -408,6 +408,7 @@ - `type.iteration.interface` Iteration scope for types: interface bodies. - `type.resource` Type in a 'with' / 'use' / 'using' statement - `type.return` Type of a return value in a function declaration +- `type.return.lambda` Type of a return value in a lambda declaration - `type.return.method` Type of a return value in a method 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. diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index b40773d96d..641e981e92 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -277,7 +277,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { attribute: notApplicable, - // Lambda + // Anonymous function / lambda "argument.formal.lambda.iteration": notApplicable, "argument.formal.lambda.singleLine": notApplicable, "argument.formal.lambda.multiLine": notApplicable, @@ -292,6 +292,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.lambda.iteration": notApplicable, "interior.lambda": notApplicable, "value.return.lambda": notApplicable, + "type.return.lambda": notApplicable, anonymousFunction: notApplicable, // Constructor diff --git a/packages/common/src/scopeSupportFacets/clojure.ts b/packages/common/src/scopeSupportFacets/clojure.ts index c27d44acd0..6f7bd84aca 100644 --- a/packages/common/src/scopeSupportFacets/clojure.ts +++ b/packages/common/src/scopeSupportFacets/clojure.ts @@ -360,6 +360,7 @@ export const clojureScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "type.cast": notApplicable, "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index d486862f82..abb3564458 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -91,6 +91,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": supported, "type.typeArgument.iteration": supported, "type.return.method": supported, + "type.return.lambda": supported, "interior.lambda": supported, "interior.try": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 913808c438..f5bb928bcf 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -334,6 +334,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { // Miscellaneous "statement.misc": notApplicable, "statement.package": notApplicable, + "type.return.lambda": notApplicable, environment: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index ab842f4526..98f7ba5002 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -178,6 +178,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/dart.ts b/packages/common/src/scopeSupportFacets/dart.ts index d3f0421326..8ae0e1ab18 100644 --- a/packages/common/src/scopeSupportFacets/dart.ts +++ b/packages/common/src/scopeSupportFacets/dart.ts @@ -324,6 +324,7 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = { // Miscellaneous "statement.misc": notApplicable, "class.iteration.class": notApplicable, + "type.return.lambda": notApplicable, regularExpression: notApplicable, environment: notApplicable, selector: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index 54725dbf14..f822bb3153 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -167,6 +167,7 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.lambda.iteration": supported, "type.return": supported, "type.return.method": supported, + "type.return.lambda": supported, "type.class": supported, "type.interface": supported, "type.field.class": supported, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 82c850f30e..479815ac4c 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -152,6 +152,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index badd4fc72a..53206d66c5 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -339,6 +339,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.enum": notApplicable, // Miscellaneous + "type.return.lambda": notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, environment: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 35be1cd9a9..f5ce5d8794 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -302,6 +302,7 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.foreach": notApplicable, "type.return": notApplicable, "type.return.method": notApplicable, + "type.return.lambda": notApplicable, "type.constant": notApplicable, "type.variable.uninitialized": notApplicable, "type.variable.initialized": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 1c43e742da..47518b680c 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -155,6 +155,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index e14b3c9296..9969aa1a41 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -344,4 +344,5 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": notApplicable, "statement.misc": notApplicable, "value.field.interface": notApplicable, + "type.return.lambda": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index 1fbc5a0a1e..9ab8231c82 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -167,6 +167,7 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index ce66528a01..936bc7b5a7 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -219,6 +219,7 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.catch": notApplicable, "type.return": notApplicable, "type.return.method": notApplicable, + "type.return.lambda": notApplicable, "type.variable.uninitialized": notApplicable, "type.variable.initialized": notApplicable, "type.typeArgument": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 4c874cfee8..8c7345e875 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -156,6 +156,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index 76d79a3861..fabfe86d32 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -209,6 +209,7 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.catch": supported, "type.return": supported, "type.return.method": supported, + "type.return.lambda": supported, "type.field.class": supported, "type.field.interface": supported, "type.class": supported, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 68c3600ad9..6039e4c6ee 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -140,6 +140,7 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 24e9bae33f..f6f9d6f630 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -277,6 +277,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, "type.resource": notApplicable, + "type.return.lambda": notApplicable, // Type alias "type.alias": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index 1456f9663b..55042f3892 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -223,6 +223,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, "type.return": notApplicable, + "type.return.lambda": notApplicable, "type.foreach": notApplicable, "type.resource": notApplicable, "type.typeArgument": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/ruby.ts b/packages/common/src/scopeSupportFacets/ruby.ts index 09462930b2..122ead680f 100644 --- a/packages/common/src/scopeSupportFacets/ruby.ts +++ b/packages/common/src/scopeSupportFacets/ruby.ts @@ -240,6 +240,7 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.lambda.iteration": notApplicable, "type.return": notApplicable, "type.return.method": notApplicable, + "type.return.lambda": notApplicable, "type.variable.uninitialized": notApplicable, "type.variable.initialized": notApplicable, "type.typeArgument": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index 0085172f05..cd9190098b 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -181,6 +181,7 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { "type.field.class": supported, "type.return": supported, "type.return.method": supported, + "type.return.lambda": supported, "type.constant": supported, "type.variable.uninitialized": supported, "type.variable.initialized": supported, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 8ba4b29d14..182e168dc7 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -351,4 +351,5 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { attribute: notApplicable, "type.cast": notApplicable, "statement.misc": notApplicable, + "type.return.lambda": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index d65d36c528..a47dcb9014 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -157,6 +157,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 19027a6e0e..b7551ae2a4 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -1016,6 +1016,10 @@ export const scopeSupportFacetInfos: Record< description: "Type of a return value in a method declaration", scopeType: "type", }, + "type.return.lambda": { + description: "Type of a return value in a lambda declaration", + scopeType: "type", + }, "type.field.class": { description: "Type of a field in a class", scopeType: "type", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 31a3ff11b0..42d4870729 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -271,6 +271,7 @@ export const scopeSupportFacets = [ "type.constant", "type.return", "type.return.method", + "type.return.lambda", "type.field.class", "type.field.interface", "type.foreach", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index eadd80bd02..a088cad843 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -164,6 +164,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index 3d17eca5b2..2b6a7f3f0f 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -143,6 +143,7 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 4083405891..212d834da4 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -34,6 +34,7 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.interface": supported, "type.iteration.document": supported, "type.return.method": supported, + "type.return.lambda": supported, "functionCall.generic": supported, "functionCallee.generic": supported, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 8dedae9f40..72f6b2a461 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -152,6 +152,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 94bfec8135..b8a4892b96 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -161,6 +161,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": notApplicable, "type.argument.formal.lambda": notApplicable, "type.argument.formal.lambda.iteration": notApplicable, + "type.return.lambda": notApplicable, "value.argument.formal.lambda": notApplicable, "value.argument.formal.lambda.iteration": notApplicable, "value.return.lambda": notApplicable, diff --git a/queries/cpp.scm b/queries/cpp.scm index a2e752e895..907e93d7c4 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -57,9 +57,17 @@ default_value: (_) @value @name.removal.end.startOf ) @_.domain @name.removal.start.startOf -;;!! []() {} -;;! ^^^^^^^ -(lambda_expression) @anonymousFunction +;;!! []() -> int {} +;;! ^^^^^^^^^^^^^^ +;;! ^^^ +(lambda_expression + (abstract_function_declarator + parameters: (_) @type.leading.endOf + (trailing_return_type + (_) @type + )? + ) +) @anonymousFunction @type.domain ;;!! [[attribute]] ;;! ^^^^^^^^^ diff --git a/queries/go.scm b/queries/go.scm index be8c1b5aee..15c378200d 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -176,8 +176,12 @@ name: (_) @name ) @namedFunction @statement @name.domain -;;!! func() {} -(func_literal) @anonymousFunction +;;!! func() int {} +;;! ^^^^^^^^^^^^^ +;;! ^^^ +(func_literal + result: (_)? @type +) @anonymousFunction @type.domain ;;!! foo = func() {} (assignment_statement diff --git a/queries/php.scm b/queries/php.scm index 0ab470dcc7..86f6321f86 100644 --- a/queries/php.scm +++ b/queries/php.scm @@ -214,14 +214,23 @@ ";"? @namedFunction.end ) -;;!! function() {} -(anonymous_function) @anonymousFunction - -;;!! fn() => 0; +;;!! function(): int {} +;;! ^^^^^^^^^^^^^^^^^^ +;;! ^^^ +(anonymous_function + parameters: (_) @type.leading.endOf + return_type: (_)? @type +) @anonymousFunction @type.domain + +;;!! fn(): int => 0; +;;! ^^^^^^^^^^^^^^ +;;! ^^^ ;;! ^ (arrow_function + parameters: (_) @type.leading.endOf + return_type: (_)? @type body: (_) @value -) @anonymousFunction @value.domain +) @anonymousFunction @_.domain ;;!! foo() (function_call_expression diff --git a/queries/rust.scm b/queries/rust.scm index 6f9777ff74..ec9434c9b8 100644 --- a/queries/rust.scm +++ b/queries/rust.scm @@ -233,7 +233,13 @@ function: (_) @functionCallee ) @_.domain -(closure_expression) @anonymousFunction +;;!! || -> i32 {} +;;! ^^^^^^^^^^^^ +;;! ^^^ +(closure_expression + parameters: (_) @type.leading.endOf + return_type: (_)? @type +) @anonymousFunction @type.domain ;;!! let foo = [1, 2, 3]; ;;!! let foo = (1, "2", true); From a2bbdfaa219f567e0b48487527f468321051bce0 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 15:36:46 +0100 Subject: [PATCH 05/12] type.argument.formal.scope --- .../scopes/c/type/type.argument.formal.scope | 45 +++++++++--- .../scopes/go/type/type.argument.formal.scope | 39 +++++++--- .../kotlin/type/type.argument.formal.scope | 72 +++++-------------- .../kotlin/type/type.argument.formal2.scope | 39 ++++++++++ 4 files changed, 119 insertions(+), 76 deletions(-) create mode 100644 data/fixtures/scopes/kotlin/type/type.argument.formal2.scope diff --git a/data/fixtures/scopes/c/type/type.argument.formal.scope b/data/fixtures/scopes/c/type/type.argument.formal.scope index ab37958d33..b898db1c72 100644 --- a/data/fixtures/scopes/c/type/type.argument.formal.scope +++ b/data/fixtures/scopes/c/type/type.argument.formal.scope @@ -1,39 +1,62 @@ -void foo(int aaa) {} +void foo(int aaa, int bbb) {} --- [#1 Content] = 0:0-0:4 >----< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} [#1 Removal] = 0:0-0:5 >-----< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} [#1 Trailing delimiter] = 0:4-0:5 >-< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} -[#1 Domain] = 0:0-0:20 - >--------------------< -0| void foo(int aaa) {} +[#1 Domain] = 0:0-0:29 + >-----------------------------< +0| void foo(int aaa, int bbb) {} [#1 Insertion delimiter] = " " [#2 Content] = 0:9-0:12 >---< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} [#2 Removal] = 0:9-0:13 >----< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} [#2 Trailing delimiter] = 0:12-0:13 >-< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} [#2 Domain] = 0:9-0:16 >-------< -0| void foo(int aaa) {} +0| void foo(int aaa, int bbb) {} [#2 Insertion delimiter] = " " + + +[#3 Content] = 0:18-0:21 + >---< +0| void foo(int aaa, int bbb) {} + +[#3 Removal] = 0:18-0:22 + >----< +0| void foo(int aaa, int bbb) {} + +[#3 Leading delimiter] = 0:17-0:18 + >-< +0| void foo(int aaa, int bbb) {} + +[#3 Trailing delimiter] = 0:21-0:22 + >-< +0| void foo(int aaa, int bbb) {} + +[#3 Domain] = 0:18-0:25 + >-------< +0| void foo(int aaa, int bbb) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.argument.formal.scope b/data/fixtures/scopes/go/type/type.argument.formal.scope index b9950be308..b227f901aa 100644 --- a/data/fixtures/scopes/go/type/type.argument.formal.scope +++ b/data/fixtures/scopes/go/type/type.argument.formal.scope @@ -1,20 +1,39 @@ -func foo(aaa int) {} +func foo(aaa int, bbb int) {} --- -[Content] = 0:13-0:16 +[#1 Content] = 0:13-0:16 >---< -0| func foo(aaa int) {} +0| func foo(aaa int, bbb int) {} -[Removal] = 0:12-0:16 +[#1 Removal] = 0:12-0:16 >----< -0| func foo(aaa int) {} +0| func foo(aaa int, bbb int) {} -[Leading delimiter] = 0:12-0:13 +[#1 Leading delimiter] = 0:12-0:13 >-< -0| func foo(aaa int) {} +0| func foo(aaa int, bbb int) {} -[Domain] = 0:9-0:16 +[#1 Domain] = 0:9-0:16 >-------< -0| func foo(aaa int) {} +0| func foo(aaa int, bbb int) {} -[Insertion delimiter] = " " +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:22-0:25 + >---< +0| func foo(aaa int, bbb int) {} + +[#2 Removal] = 0:21-0:25 + >----< +0| func foo(aaa int, bbb int) {} + +[#2 Leading delimiter] = 0:21-0:22 + >-< +0| func foo(aaa int, bbb int) {} + +[#2 Domain] = 0:18-0:25 + >-------< +0| func foo(aaa int, bbb int) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.argument.formal.scope b/data/fixtures/scopes/kotlin/type/type.argument.formal.scope index 2fa964a0d3..5411a87fe6 100644 --- a/data/fixtures/scopes/kotlin/type/type.argument.formal.scope +++ b/data/fixtures/scopes/kotlin/type/type.argument.formal.scope @@ -1,77 +1,39 @@ -fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +fun foo(aaa: Int, bbb: Int = 0) {} --- [#1 Content] = 0:13-0:16 >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#1 Removal] = 0:11-0:16 >-----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#1 Leading delimiter] = 0:11-0:13 >--< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#1 Domain] = 0:8-0:16 >--------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +0| fun foo(aaa: Int, bbb: Int = 0) {} [#1 Insertion delimiter] = " " -[#2 Content] = 0:30-0:33 - >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Content] = 0:23-0:26 + >---< +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#2 Removal] = 0:28-0:33 - >-----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Removal] = 0:21-0:26 + >-----< +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#2 Leading delimiter] = 0:28-0:30 - >--< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Leading delimiter] = 0:21-0:23 + >--< +0| fun foo(aaa: Int, bbb: Int = 0) {} -[#2 Domain] = 0:18-0:33 - >---------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} +[#2 Domain] = 0:18-0:30 + >------------< +0| fun foo(aaa: Int, bbb: Int = 0) {} [#2 Insertion delimiter] = " " - - -[#3 Content] = 0:40-0:43 - >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#3 Removal] = 0:38-0:43 - >-----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#3 Leading delimiter] = 0:38-0:40 - >--< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#3 Domain] = 0:35-0:47 - >------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#3 Insertion delimiter] = " " - - -[#4 Content] = 0:61-0:64 - >---< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Removal] = 0:59-0:64 - >-----< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Leading delimiter] = 0:59-0:61 - >--< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Domain] = 0:49-0:68 - >-------------------< -0| fun foo(aaa: Int, vararg bbb: Int, ccc: Int = 0, vararg ddd: Int = 1) {} - -[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/type/type.argument.formal2.scope b/data/fixtures/scopes/kotlin/type/type.argument.formal2.scope new file mode 100644 index 0000000000..5911fa22fa --- /dev/null +++ b/data/fixtures/scopes/kotlin/type/type.argument.formal2.scope @@ -0,0 +1,39 @@ +fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} +--- + +[#1 Content] = 0:20-0:23 + >---< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Removal] = 0:18-0:23 + >-----< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Leading delimiter] = 0:18-0:20 + >--< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Domain] = 0:8-0:23 + >---------------< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:37-0:40 + >---< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Removal] = 0:35-0:40 + >-----< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Leading delimiter] = 0:35-0:37 + >--< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Domain] = 0:25-0:44 + >-------------------< +0| fun foo(vararg aaa: Int, vararg bbb: Int = 0) {} + +[#2 Insertion delimiter] = " " From 6aa491378c1aec5e3a11e85130c44db70f3ce2c3 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 16:04:57 +0100 Subject: [PATCH 06/12] name.method.interface statement.method.interface --- .../csharp/name/name.method.interface.scope | 45 ++++++++++++++++++ .../statement.method.interface.scope | 33 +++++++++++++ ...face.scope => name.method.interface.scope} | 0 ...scope => statement.method.interface.scope} | 0 .../java/name/name.method.interface.scope | 45 ++++++++++++++++++ .../statement.method.interface.scope | 33 +++++++++++++ .../kotlin/name/name.method.interface.scope | 45 ++++++++++++++++++ .../statement.method.interface.scope | 33 +++++++++++++ .../php/name/name.method.interface.scope | 46 +++++++++++++++++++ .../statement.method.interface.scope | 41 +++++++++++++++++ .../scala/name/name.method.interface.scope | 45 ++++++++++++++++++ .../statement.method.interface.scope | 33 +++++++++++++ .../name/name.method.interface.scope | 45 ++++++++++++++++++ .../statement.method.interface.scope | 33 +++++++++++++ data/scopeSupportFacetInfos.md | 2 + packages/common/src/scopeSupportFacets/c.ts | 2 + .../common/src/scopeSupportFacets/clojure.ts | 2 + .../common/src/scopeSupportFacets/csharp.ts | 2 + packages/common/src/scopeSupportFacets/css.ts | 2 + .../common/src/scopeSupportFacets/dart.ts | 2 + packages/common/src/scopeSupportFacets/go.ts | 8 ++-- .../common/src/scopeSupportFacets/html.ts | 2 + .../common/src/scopeSupportFacets/java.ts | 2 + .../src/scopeSupportFacets/javascript.ts | 2 + .../common/src/scopeSupportFacets/json.ts | 2 + .../common/src/scopeSupportFacets/kotlin.ts | 2 + .../common/src/scopeSupportFacets/latex.ts | 2 + packages/common/src/scopeSupportFacets/lua.ts | 2 + .../common/src/scopeSupportFacets/markdown.ts | 2 + packages/common/src/scopeSupportFacets/php.ts | 2 + .../src/scopeSupportFacets/properties.ts | 2 + .../common/src/scopeSupportFacets/python.ts | 2 + packages/common/src/scopeSupportFacets/r.ts | 2 + .../common/src/scopeSupportFacets/ruby.ts | 2 + .../common/src/scopeSupportFacets/rust.ts | 2 + .../common/src/scopeSupportFacets/scala.ts | 2 + packages/common/src/scopeSupportFacets/scm.ts | 2 + .../scopeSupportFacetInfos.ts | 8 ++++ .../scopeSupportFacets.types.ts | 2 + .../common/src/scopeSupportFacets/talon.ts | 2 + .../src/scopeSupportFacets/talonList.ts | 2 + .../src/scopeSupportFacets/typescript.ts | 2 + packages/common/src/scopeSupportFacets/xml.ts | 2 + .../common/src/scopeSupportFacets/yaml.ts | 2 + queries/scala.scm | 5 +- 45 files changed, 549 insertions(+), 5 deletions(-) create mode 100644 data/fixtures/scopes/csharp/name/name.method.interface.scope create mode 100644 data/fixtures/scopes/csharp/statement/statement.method.interface.scope rename data/fixtures/scopes/go/name/{name.field.interface.scope => name.method.interface.scope} (100%) rename data/fixtures/scopes/go/statement/{statement.field.interface.scope => statement.method.interface.scope} (100%) create mode 100644 data/fixtures/scopes/java/name/name.method.interface.scope create mode 100644 data/fixtures/scopes/java/statement/statement.method.interface.scope create mode 100644 data/fixtures/scopes/kotlin/name/name.method.interface.scope create mode 100644 data/fixtures/scopes/kotlin/statement/statement.method.interface.scope create mode 100644 data/fixtures/scopes/php/name/name.method.interface.scope create mode 100644 data/fixtures/scopes/php/statement/statement.method.interface.scope create mode 100644 data/fixtures/scopes/scala/name/name.method.interface.scope create mode 100644 data/fixtures/scopes/scala/statement/statement.method.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/name/name.method.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/statement/statement.method.interface.scope diff --git a/data/fixtures/scopes/csharp/name/name.method.interface.scope b/data/fixtures/scopes/csharp/name/name.method.interface.scope new file mode 100644 index 0000000000..ea95496634 --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.method.interface.scope @@ -0,0 +1,45 @@ +interface IFoo { + void Bar(); +} +--- + +[#1 Content] = 0:10-0:14 + >----< +0| interface IFoo { + +[#1 Removal] = 0:10-0:15 + >-----< +0| interface IFoo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface IFoo { + +[#1 Trailing delimiter] = 0:14-0:15 + >-< +0| interface IFoo { + +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| void Bar(); +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:9-1:12 + >---< +1| void Bar(); + +[#2 Leading delimiter] = 1:8-1:9 + >-< +1| void Bar(); + +[#2 Domain] = 1:4-1:15 + >-----------< +1| void Bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/statement/statement.method.interface.scope b/data/fixtures/scopes/csharp/statement/statement.method.interface.scope new file mode 100644 index 0000000000..42f69d6178 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.method.interface.scope @@ -0,0 +1,33 @@ +interface IFoo { + void Bar(); +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| void Bar(); +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:15 + >-----------< +1| void Bar(); + +[#2 Removal] = 1:0-2:0 + >--------------- +1| void Bar(); +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| void Bar(); + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/name/name.field.interface.scope b/data/fixtures/scopes/go/name/name.method.interface.scope similarity index 100% rename from data/fixtures/scopes/go/name/name.field.interface.scope rename to data/fixtures/scopes/go/name/name.method.interface.scope diff --git a/data/fixtures/scopes/go/statement/statement.field.interface.scope b/data/fixtures/scopes/go/statement/statement.method.interface.scope similarity index 100% rename from data/fixtures/scopes/go/statement/statement.field.interface.scope rename to data/fixtures/scopes/go/statement/statement.method.interface.scope diff --git a/data/fixtures/scopes/java/name/name.method.interface.scope b/data/fixtures/scopes/java/name/name.method.interface.scope new file mode 100644 index 0000000000..67e14aa2fe --- /dev/null +++ b/data/fixtures/scopes/java/name/name.method.interface.scope @@ -0,0 +1,45 @@ +interface Foo { + void bar(); +} +--- + +[#1 Content] = 0:10-0:13 + >---< +0| interface Foo { + +[#1 Removal] = 0:10-0:14 + >----< +0| interface Foo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| void bar(); +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:9-1:12 + >---< +1| void bar(); + +[#2 Leading delimiter] = 1:8-1:9 + >-< +1| void bar(); + +[#2 Domain] = 1:4-1:15 + >-----------< +1| void bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/statement/statement.method.interface.scope b/data/fixtures/scopes/java/statement/statement.method.interface.scope new file mode 100644 index 0000000000..a41c51fce4 --- /dev/null +++ b/data/fixtures/scopes/java/statement/statement.method.interface.scope @@ -0,0 +1,33 @@ +interface Foo { + void bar(); +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| void bar(); +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:15 + >-----------< +1| void bar(); + +[#2 Removal] = 1:0-2:0 + >--------------- +1| void bar(); +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| void bar(); + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/kotlin/name/name.method.interface.scope b/data/fixtures/scopes/kotlin/name/name.method.interface.scope new file mode 100644 index 0000000000..97c51045b1 --- /dev/null +++ b/data/fixtures/scopes/kotlin/name/name.method.interface.scope @@ -0,0 +1,45 @@ +interface Foo { + fun bar() +} +--- + +[#1 Content] = 0:10-0:13 + >---< +0| interface Foo { + +[#1 Removal] = 0:10-0:14 + >----< +0| interface Foo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| fun bar() +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:8-1:11 + >---< +1| fun bar() + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| fun bar() + +[#2 Domain] = 1:4-1:13 + >---------< +1| fun bar() + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/kotlin/statement/statement.method.interface.scope b/data/fixtures/scopes/kotlin/statement/statement.method.interface.scope new file mode 100644 index 0000000000..b83dae9ffe --- /dev/null +++ b/data/fixtures/scopes/kotlin/statement/statement.method.interface.scope @@ -0,0 +1,33 @@ +interface Foo { + fun bar() +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| fun bar() +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:13 + >---------< +1| fun bar() + +[#2 Removal] = 1:0-2:0 + >------------- +1| fun bar() +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| fun bar() + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/php/name/name.method.interface.scope b/data/fixtures/scopes/php/name/name.method.interface.scope new file mode 100644 index 0000000000..26358dc365 --- /dev/null +++ b/data/fixtures/scopes/php/name/name.method.interface.scope @@ -0,0 +1,46 @@ +---< +1| interface Foo { + +[#1 Removal] = 1:10-1:14 + >----< +1| interface Foo { + +[#1 Leading delimiter] = 1:9-1:10 + >-< +1| interface Foo { + +[#1 Trailing delimiter] = 1:13-1:14 + >-< +1| interface Foo { + +[#1 Domain] = 1:0-3:1 + >--------------- +1| interface Foo { +2| public function bar(); +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 2:20-2:23 + >---< +2| public function bar(); + +[#2 Leading delimiter] = 2:19-2:20 + >-< +2| public function bar(); + +[#2 Domain] = 2:4-2:26 + >----------------------< +2| public function bar(); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/statement/statement.method.interface.scope b/data/fixtures/scopes/php/statement/statement.method.interface.scope new file mode 100644 index 0000000000..f8fb427d8d --- /dev/null +++ b/data/fixtures/scopes/php/statement/statement.method.interface.scope @@ -0,0 +1,41 @@ +--------------- +1| interface Foo { +2| public function bar(); +3| } + -< + +[#1 Removal] = 0:5-3:1 + > +0| ----------------------< +2| public function bar(); + +[#2 Removal] = 2:0-3:0 + >-------------------------- +2| public function bar(); +3| } + < + +[#2 Leading delimiter] = 2:0-2:4 + >----< +2| public function bar(); + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/scala/name/name.method.interface.scope b/data/fixtures/scopes/scala/name/name.method.interface.scope new file mode 100644 index 0000000000..3311b2cf17 --- /dev/null +++ b/data/fixtures/scopes/scala/name/name.method.interface.scope @@ -0,0 +1,45 @@ +trait Foo { + def bar(): Unit +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| trait Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| trait Foo { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| trait Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| trait Foo { + +[#1 Domain] = 0:0-2:1 + >----------- +0| trait Foo { +1| def bar(): Unit +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:8-1:11 + >---< +1| def bar(): Unit + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| def bar(): Unit + +[#2 Domain] = 1:4-1:19 + >---------------< +1| def bar(): Unit + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scala/statement/statement.method.interface.scope b/data/fixtures/scopes/scala/statement/statement.method.interface.scope new file mode 100644 index 0000000000..8161142abc --- /dev/null +++ b/data/fixtures/scopes/scala/statement/statement.method.interface.scope @@ -0,0 +1,33 @@ +trait Foo { + def bar(): Unit +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------- +0| trait Foo { +1| def bar(): Unit +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:19 + >---------------< +1| def bar(): Unit + +[#2 Removal] = 1:0-2:0 + >------------------- +1| def bar(): Unit +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| def bar(): Unit + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/typescript.core/name/name.method.interface.scope b/data/fixtures/scopes/typescript.core/name/name.method.interface.scope new file mode 100644 index 0000000000..b156efcbeb --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name/name.method.interface.scope @@ -0,0 +1,45 @@ +interface Foo { + bar(): void; +} +--- + +[#1 Content] = 0:10-0:13 + >---< +0| interface Foo { + +[#1 Removal] = 0:10-0:14 + >----< +0| interface Foo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar(): void; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:7 + >---< +1| bar(): void; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar(): void; + +[#2 Domain] = 1:4-1:16 + >------------< +1| bar(): void; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/statement/statement.method.interface.scope b/data/fixtures/scopes/typescript.core/statement/statement.method.interface.scope new file mode 100644 index 0000000000..51c70b88d0 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement/statement.method.interface.scope @@ -0,0 +1,33 @@ +interface Foo { + bar(): void; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar(): void; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:16 + >------------< +1| bar(): void; + +[#2 Removal] = 1:0-2:0 + >---------------- +1| bar(): void; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar(): void; + +[#2 Insertion delimiter] = "\n" diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 18912301ba..dcef59d83d 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -259,6 +259,7 @@ - `name.iteration.enum` Iteration scope for names: enum bodies. - `name.iteration.interface` Iteration scope for names: interface bodies. - `name.method` Name of a class method +- `name.method.interface` Name of a interface method - `name.namespace` Name of a namespace - `name.resource` Name in a 'with' / 'use' / 'using' statement - `name.typeAlias` Name of a type alias @@ -339,6 +340,7 @@ - `statement.iteration.document` Iteration scope for statements: the entire document including leading and trailing empty lines. - `statement.iteration.interface` Iteration scope for statements: interface bodies. - `statement.method` A method declaration +- `statement.method.interface` A method declaration in a interface - `statement.misc` A miscellaneous statement - `statement.namespace` A namespace declaration - `statement.package` A package declaration diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 641e981e92..141fe1f946 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -222,9 +222,11 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/clojure.ts b/packages/common/src/scopeSupportFacets/clojure.ts index 6f7bd84aca..88c95c5558 100644 --- a/packages/common/src/scopeSupportFacets/clojure.ts +++ b/packages/common/src/scopeSupportFacets/clojure.ts @@ -188,10 +188,12 @@ export const clojureScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index f5bb928bcf..27685e8e3e 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -73,6 +73,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.method.interface": supported, "name.assignment": supported, "name.assignment.compound": supported, "name.constant": supported, @@ -200,6 +201,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "statement.function": supported, "statement.constructor": supported, "statement.method": supported, + "statement.method.interface": supported, "statement.functionCall": supported, "statement.if": supported, "statement.try": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 98f7ba5002..dcb8561810 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -215,10 +215,12 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/dart.ts b/packages/common/src/scopeSupportFacets/dart.ts index 8ae0e1ab18..f13c42c90a 100644 --- a/packages/common/src/scopeSupportFacets/dart.ts +++ b/packages/common/src/scopeSupportFacets/dart.ts @@ -259,9 +259,11 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = { // Interface (Dart has abstract classes instead) "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index f822bb3153..d83a2bb7a0 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -17,9 +17,9 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "statement.class": supported, "statement.interface": supported, "statement.field.class": supported, - "statement.field.interface": supported, "statement.function": supported, "statement.method": supported, + "statement.method.interface": supported, "statement.functionCall": supported, "statement.if": supported, "statement.switch": supported, @@ -124,10 +124,10 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.method.interface": supported, "name.class": supported, "name.interface": supported, "name.field.class": supported, - "name.field.interface": supported, "name.typeAlias": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, @@ -334,7 +334,9 @@ export const goScopeSupport: LanguageScopeSupportFacetMap = { notebookCell: notApplicable, "interior.cell": notApplicable, - // Interface field types + // Interface fields + "statement.field.interface": notApplicable, + "name.field.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 479815ac4c..91b992b2b5 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -193,10 +193,12 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 53206d66c5..83413aa8f8 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -112,6 +112,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "statement.field.interface": supported, "statement.constructor": supported, "statement.method": supported, + "statement.method.interface": supported, "statement.functionCall": supported, "statement.if": supported, "statement.try": supported, @@ -165,6 +166,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.field.enum": supported, "name.foreach": supported, "name.method": supported, + "name.method.interface": supported, "name.assignment": supported, "name.assignment.compound": supported, "name.constant": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index f5ce5d8794..af95dabf6a 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -321,9 +321,11 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "value.field.interface": notApplicable, "type.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 47518b680c..c4c27d7d63 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -196,10 +196,12 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/kotlin.ts b/packages/common/src/scopeSupportFacets/kotlin.ts index 9969aa1a41..1d985bd9f3 100644 --- a/packages/common/src/scopeSupportFacets/kotlin.ts +++ b/packages/common/src/scopeSupportFacets/kotlin.ts @@ -115,6 +115,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "statement.function": supported, "statement.constructor": supported, "statement.method": supported, + "statement.method.interface": supported, "statement.functionCall": supported, "statement.if": supported, "statement.try": supported, @@ -172,6 +173,7 @@ export const kotlinScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.method.interface": supported, "name.assignment": supported, "name.assignment.compound": supported, "name.constant": supported, diff --git a/packages/common/src/scopeSupportFacets/latex.ts b/packages/common/src/scopeSupportFacets/latex.ts index 9ab8231c82..71ec42391f 100644 --- a/packages/common/src/scopeSupportFacets/latex.ts +++ b/packages/common/src/scopeSupportFacets/latex.ts @@ -198,10 +198,12 @@ export const latexScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index 936bc7b5a7..f494e5bc22 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -191,8 +191,10 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 8c7345e875..1ec4c9b95b 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -196,10 +196,12 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index fabfe86d32..047b4d4e99 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -103,6 +103,7 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "statement.function": supported, "statement.constructor": supported, "statement.method": supported, + "statement.method.interface": supported, "statement.functionCall": supported, "statement.if": supported, "statement.try": supported, @@ -153,6 +154,7 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "name.function": supported, "name.constructor": supported, "name.method": supported, + "name.method.interface": supported, "name.class": supported, "name.interface": supported, "name.enum": supported, diff --git a/packages/common/src/scopeSupportFacets/properties.ts b/packages/common/src/scopeSupportFacets/properties.ts index 6039e4c6ee..8c6f311d86 100644 --- a/packages/common/src/scopeSupportFacets/properties.ts +++ b/packages/common/src/scopeSupportFacets/properties.ts @@ -168,10 +168,12 @@ export const propertiesScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index f6f9d6f630..dbec8cffe0 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -323,10 +323,12 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "value.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index 55042f3892..1c4e1a9411 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -235,10 +235,12 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/ruby.ts b/packages/common/src/scopeSupportFacets/ruby.ts index 122ead680f..832797f212 100644 --- a/packages/common/src/scopeSupportFacets/ruby.ts +++ b/packages/common/src/scopeSupportFacets/ruby.ts @@ -203,9 +203,11 @@ export const rubyScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/rust.ts b/packages/common/src/scopeSupportFacets/rust.ts index cd9190098b..f504f998c3 100644 --- a/packages/common/src/scopeSupportFacets/rust.ts +++ b/packages/common/src/scopeSupportFacets/rust.ts @@ -244,9 +244,11 @@ export const rustScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "value.field.interface": notApplicable, "type.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scala.ts b/packages/common/src/scopeSupportFacets/scala.ts index 182e168dc7..b2bb6a89c0 100644 --- a/packages/common/src/scopeSupportFacets/scala.ts +++ b/packages/common/src/scopeSupportFacets/scala.ts @@ -106,6 +106,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "statement.field.interface": supported, "statement.function": supported, "statement.method": supported, + "statement.method.interface": supported, "statement.functionCall": supported, "statement.if": supported, "statement.try": supported, @@ -160,6 +161,7 @@ export const scalaScopeSupport: LanguageScopeSupportFacetMap = { "name.foreach": supported, "name.function": supported, "name.method": supported, + "name.method.interface": supported, "name.assignment": supported, "name.assignment.compound": supported, "name.constant": supported, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index a47dcb9014..6fb32fd981 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -193,10 +193,12 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index b7551ae2a4..7af0dfa813 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -102,6 +102,10 @@ export const scopeSupportFacetInfos: Record< description: "A method declaration", scopeType: "statement", }, + "statement.method.interface": { + description: "A method declaration in a interface", + scopeType: "statement", + }, "statement.functionCall": { description: "A function call statement", scopeType: "statement", @@ -709,6 +713,10 @@ export const scopeSupportFacetInfos: Record< description: "Name of a class method", scopeType: "name", }, + "name.method.interface": { + description: "Name of a interface method", + scopeType: "name", + }, "name.constructor": { description: "Name of a constructor", scopeType: "name", diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 42d4870729..f9a626b18b 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -36,6 +36,7 @@ export const scopeSupportFacets = [ "statement.function", "statement.constructor", "statement.method", + "statement.method.interface", "statement.functionCall", "statement.if", "statement.try", @@ -200,6 +201,7 @@ export const scopeSupportFacets = [ "name.foreach", "name.function", "name.method", + "name.method.interface", "name.constructor", "name.class", "name.interface", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index a088cad843..6148bc5e64 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -192,10 +192,12 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talonList.ts b/packages/common/src/scopeSupportFacets/talonList.ts index 2b6a7f3f0f..4f0ca36941 100644 --- a/packages/common/src/scopeSupportFacets/talonList.ts +++ b/packages/common/src/scopeSupportFacets/talonList.ts @@ -171,10 +171,12 @@ export const talonListScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 212d834da4..f8fc52d8d7 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -46,12 +46,14 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "name.typeAlias": supported, "name.iteration.interface": supported, "name.iteration.enum": supported, + "name.method.interface": supported, "statement.interface": supported, "statement.enum": supported, "statement.field.interface": supported, "statement.iteration.interface": supported, "statement.typeAlias": supported, + "statement.method.interface": supported, "value.typeAlias": supported, "value.field.enum": supported, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 72f6b2a461..3554d67a3b 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -193,10 +193,12 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index b8a4892b96..6499412a37 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -201,10 +201,12 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, + "statement.method.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, + "name.method.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, diff --git a/queries/scala.scm b/queries/scala.scm index f271f66cef..347bb66c8d 100644 --- a/queries/scala.scm +++ b/queries/scala.scm @@ -7,10 +7,12 @@ (enum_definition) (trait_definition) (var_definition) + (var_declaration) (val_definition) (val_declaration) - (assignment_expression) (function_definition) + (function_declaration) + (assignment_expression) (instance_expression) (call_expression) (match_expression) @@ -19,7 +21,6 @@ (do_while_expression) (for_expression) (try_expression) - (var_declaration) (throw_expression) (type_definition) (infix_expression) From 363a15b08baca25a8ced12f3e2eda9c88615a8f2 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 16:22:03 +0100 Subject: [PATCH 07/12] named function as assigned lambda --- data/fixtures/scopes/go/namedFunction2.scope | 8 ++++---- data/fixtures/scopes/go/namedFunction3.scope | 10 ++++++++++ data/fixtures/scopes/go/namedFunction4.scope | 10 ++++++++++ data/fixtures/scopes/php/namedFunction2.scope | 16 +++++++++++++++ data/fixtures/scopes/php/namedFunction3.scope | 16 +++++++++++++++ queries/go.scm | 20 +++++++++++++++++++ 6 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 data/fixtures/scopes/go/namedFunction3.scope create mode 100644 data/fixtures/scopes/go/namedFunction4.scope create mode 100644 data/fixtures/scopes/php/namedFunction2.scope create mode 100644 data/fixtures/scopes/php/namedFunction3.scope diff --git a/data/fixtures/scopes/go/namedFunction2.scope b/data/fixtures/scopes/go/namedFunction2.scope index 44b4235299..dc5b4c7f3c 100644 --- a/data/fixtures/scopes/go/namedFunction2.scope +++ b/data/fixtures/scopes/go/namedFunction2.scope @@ -1,10 +1,10 @@ -foo = func() {} +const foo = func() {} --- [Content] = [Removal] = -[Domain] = 0:0-0:15 - >---------------< -0| foo = func() {} +[Domain] = 0:0-0:21 + >---------------------< +0| const foo = func() {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/go/namedFunction3.scope b/data/fixtures/scopes/go/namedFunction3.scope new file mode 100644 index 0000000000..66d7448576 --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction3.scope @@ -0,0 +1,10 @@ +foo := func() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| foo := func() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/go/namedFunction4.scope b/data/fixtures/scopes/go/namedFunction4.scope new file mode 100644 index 0000000000..44b4235299 --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction4.scope @@ -0,0 +1,10 @@ +foo = func() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| foo = func() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/php/namedFunction2.scope b/data/fixtures/scopes/php/namedFunction2.scope new file mode 100644 index 0000000000..490e776dae --- /dev/null +++ b/data/fixtures/scopes/php/namedFunction2.scope @@ -0,0 +1,16 @@ +---------------------< +1| $foo = function() {}; + +[Removal] = 0:5-1:21 + > +0| 0; +--- + +[Content] = +[Domain] = 1:0-1:17 + >-----------------< +1| $foo = fn() => 0; + +[Removal] = 0:5-1:17 + > +0| 0; + -----------------< + +[Insertion delimiter] = "\n\n" diff --git a/queries/go.scm b/queries/go.scm index 15c378200d..b1b1c2f95f 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -183,6 +183,26 @@ result: (_)? @type ) @anonymousFunction @type.domain +;;!! const foo = func() {} +(const_declaration + (const_spec + value: (expression_list + . + (func_literal) + . + ) + ) +) @namedFunction + +;;!! foo := func() {} +(short_var_declaration + right: (expression_list + . + (func_literal) + . + ) +) @namedFunction + ;;!! foo = func() {} (assignment_statement right: (expression_list From 1210a8925488c26e429fc7fc2541f180a5f9dbee Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 16:39:04 +0100 Subject: [PATCH 08/12] cpp lambda without parameters --- data/fixtures/scopes/cpp/anonymousFunction2.scope | 10 ++++++++++ queries/cpp.scm | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 data/fixtures/scopes/cpp/anonymousFunction2.scope diff --git a/data/fixtures/scopes/cpp/anonymousFunction2.scope b/data/fixtures/scopes/cpp/anonymousFunction2.scope new file mode 100644 index 0000000000..d91b1f790f --- /dev/null +++ b/data/fixtures/scopes/cpp/anonymousFunction2.scope @@ -0,0 +1,10 @@ +[] {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:5 + >-----< +0| [] {} + +[Insertion delimiter] = "\n" diff --git a/queries/cpp.scm b/queries/cpp.scm index 907e93d7c4..4f94c316e0 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -66,7 +66,7 @@ (trailing_return_type (_) @type )? - ) + )? ) @anonymousFunction @type.domain ;;!! [[attribute]] From d7fa461b52813caef6ec2589d3b3bae12ddd38ec Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 17:06:42 +0100 Subject: [PATCH 09/12] c/cpp type alias scopes --- .../scopes/c/name/name.typeAlias.scope | 20 ++++++++++++++++ .../c/statement/statement.typeAlias.scope | 10 ++++++++ data/fixtures/scopes/c/type/type.alias.scope | 10 ++++++++ .../scopes/c/value/value.typeAlias.scope | 24 +++++++++++++++++++ .../scopes/cpp/name/name.typeAlias.scope | 24 +++++++++++++++++++ .../cpp/statement/statement.typeAlias.scope | 10 ++++++++ .../fixtures/scopes/cpp/type/type.alias.scope | 10 ++++++++ .../scopes/cpp/value/value.typeAlias.scope | 20 ++++++++++++++++ packages/common/src/scopeSupportFacets/c.ts | 10 ++++---- .../common/src/scopeSupportFacets/csharp.ts | 22 +++++++---------- queries/c.scm | 11 ++++++++- queries/cpp.scm | 8 +++++++ 12 files changed, 159 insertions(+), 20 deletions(-) create mode 100644 data/fixtures/scopes/c/name/name.typeAlias.scope create mode 100644 data/fixtures/scopes/c/statement/statement.typeAlias.scope create mode 100644 data/fixtures/scopes/c/type/type.alias.scope create mode 100644 data/fixtures/scopes/c/value/value.typeAlias.scope create mode 100644 data/fixtures/scopes/cpp/name/name.typeAlias.scope create mode 100644 data/fixtures/scopes/cpp/statement/statement.typeAlias.scope create mode 100644 data/fixtures/scopes/cpp/type/type.alias.scope create mode 100644 data/fixtures/scopes/cpp/value/value.typeAlias.scope diff --git a/data/fixtures/scopes/c/name/name.typeAlias.scope b/data/fixtures/scopes/c/name/name.typeAlias.scope new file mode 100644 index 0000000000..f1f488cdf4 --- /dev/null +++ b/data/fixtures/scopes/c/name/name.typeAlias.scope @@ -0,0 +1,20 @@ +typedef int foo; +--- + +[Content] = 0:12-0:15 + >---< +0| typedef int foo; + +[Removal] = 0:11-0:15 + >----< +0| typedef int foo; + +[Leading delimiter] = 0:11-0:12 + >-< +0| typedef int foo; + +[Domain] = 0:0-0:16 + >----------------< +0| typedef int foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/statement/statement.typeAlias.scope b/data/fixtures/scopes/c/statement/statement.typeAlias.scope new file mode 100644 index 0000000000..bd2cf58bfd --- /dev/null +++ b/data/fixtures/scopes/c/statement/statement.typeAlias.scope @@ -0,0 +1,10 @@ +typedef int foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| typedef int foo; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/type/type.alias.scope b/data/fixtures/scopes/c/type/type.alias.scope new file mode 100644 index 0000000000..c3ea7acae3 --- /dev/null +++ b/data/fixtures/scopes/c/type/type.alias.scope @@ -0,0 +1,10 @@ +typedef int foo; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| typedef int foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/value/value.typeAlias.scope b/data/fixtures/scopes/c/value/value.typeAlias.scope new file mode 100644 index 0000000000..ad8b57a4a6 --- /dev/null +++ b/data/fixtures/scopes/c/value/value.typeAlias.scope @@ -0,0 +1,24 @@ +typedef int foo; +--- + +[Content] = 0:8-0:11 + >---< +0| typedef int foo; + +[Removal] = 0:8-0:12 + >----< +0| typedef int foo; + +[Leading delimiter] = 0:7-0:8 + >-< +0| typedef int foo; + +[Trailing delimiter] = 0:11-0:12 + >-< +0| typedef int foo; + +[Domain] = 0:0-0:16 + >----------------< +0| typedef int foo; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name/name.typeAlias.scope b/data/fixtures/scopes/cpp/name/name.typeAlias.scope new file mode 100644 index 0000000000..d324dfec1d --- /dev/null +++ b/data/fixtures/scopes/cpp/name/name.typeAlias.scope @@ -0,0 +1,24 @@ +using Foo = Bar; +--- + +[Content] = 0:6-0:9 + >---< +0| using Foo = Bar; + +[Removal] = 0:0-0:12 + >------------< +0| using Foo = Bar; + +[Leading delimiter] = 0:5-0:6 + >-< +0| using Foo = Bar; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| using Foo = Bar; + +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/statement/statement.typeAlias.scope b/data/fixtures/scopes/cpp/statement/statement.typeAlias.scope new file mode 100644 index 0000000000..1c156e1382 --- /dev/null +++ b/data/fixtures/scopes/cpp/statement/statement.typeAlias.scope @@ -0,0 +1,10 @@ +using Foo = Bar; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/type/type.alias.scope b/data/fixtures/scopes/cpp/type/type.alias.scope new file mode 100644 index 0000000000..6c60c38ea2 --- /dev/null +++ b/data/fixtures/scopes/cpp/type/type.alias.scope @@ -0,0 +1,10 @@ +using Foo = Bar; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/value/value.typeAlias.scope b/data/fixtures/scopes/cpp/value/value.typeAlias.scope new file mode 100644 index 0000000000..0ab94bc4ae --- /dev/null +++ b/data/fixtures/scopes/cpp/value/value.typeAlias.scope @@ -0,0 +1,20 @@ +using Foo = Bar; +--- + +[Content] = 0:12-0:15 + >---< +0| using Foo = Bar; + +[Removal] = 0:9-0:15 + >------< +0| using Foo = Bar; + +[Leading delimiter] = 0:9-0:12 + >---< +0| using Foo = Bar; + +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 141fe1f946..ee999f98a3 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -28,6 +28,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "statement.return": supported, "statement.break": supported, "statement.continue": supported, + "statement.typeAlias": supported, "statement.namespace": supported, "statement.import": supported, "statement.iteration.document": supported, @@ -105,6 +106,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.enum": supported, "name.field.class": supported, "name.field.enum": supported, + "name.typeAlias": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, "name.iteration.block": supported, @@ -119,6 +121,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.return": supported, "value.switch": supported, "value.field.enum": supported, + "value.typeAlias": supported, "value.iteration.block": supported, "value.iteration.class": supported, "value.iteration.enum": supported, @@ -133,6 +136,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": supported, "type.cast": supported, "type.class": supported, + "type.alias": supported, "type.return": supported, "type.iteration.block": supported, "type.iteration.class": supported, @@ -206,12 +210,6 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.command": notApplicable, "interior.command": notApplicable, - // Type alias - "type.alias": notApplicable, - "statement.typeAlias": notApplicable, - "name.typeAlias": notApplicable, - "value.typeAlias": notApplicable, - // Notebook cell notebookCell: notApplicable, "interior.cell": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 27685e8e3e..f935f7168c 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -62,6 +62,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.lambda.iteration": supported, "name.argument.formal": supported, "name.argument.catch": supported, + "name.argument.actual": supported, + "name.argument.actual.iteration": supported, "name.namespace": supported, "name.class": supported, "name.interface": supported, @@ -84,6 +86,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.iteration.interface": supported, "name.iteration.enum": supported, "name.iteration.document": supported, + "name.typeAlias": supported, "value.argument.formal": supported, "value.argument.formal.iteration": supported, @@ -93,6 +96,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.constructor.iteration": supported, "value.argument.formal.lambda": supported, "value.argument.formal.lambda.iteration": supported, + "value.argument.actual": supported, + "value.argument.actual.iteration": supported, "value.field.class": supported, "value.field.enum": supported, "value.field.interface": supported, @@ -112,6 +117,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.class": supported, "value.iteration.enum": supported, "value.iteration.document": supported, + "value.typeAlias": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, @@ -140,6 +146,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.class": supported, "type.iteration.interface": supported, "type.iteration.document": supported, + "type.alias": supported, "key.mapPair": supported, "key.mapPair.iteration": supported, @@ -221,6 +228,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "statement.throw": supported, "statement.break": supported, "statement.continue": supported, + "statement.resource": supported, + "statement.typeAlias": supported, "statement.import": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, @@ -272,14 +281,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "key.attribute": notApplicable, "value.attribute": notApplicable, - // Keyword argument - "name.argument.actual": notApplicable, - "name.argument.actual.iteration": notApplicable, - "value.argument.actual": notApplicable, - "value.argument.actual.iteration": notApplicable, - // Resource syntax - "statement.resource": notApplicable, "interior.resource": notApplicable, "type.resource": notApplicable, "name.resource": notApplicable, @@ -293,12 +295,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.destructuring": notApplicable, "value.assignment.destructuring": notApplicable, - // Type alias - "type.alias": notApplicable, - "statement.typeAlias": notApplicable, - "name.typeAlias": notApplicable, - "value.typeAlias": notApplicable, - // Enum calls "functionCall.enum": notApplicable, "functionCallee.enum": notApplicable, diff --git a/queries/c.scm b/queries/c.scm index d09dd046c8..f510cdc37a 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -118,6 +118,15 @@ (#type? @_dummy struct_specifier union_specifier enum_specifier) ) @_.domain @class @type +;;!! typedef int foo; +;;! ^^^ +;;! ^^^ +(type_definition + type: (_) @value + declarator: (type_identifier) @name + (#not-type? @value struct_specifier union_specifier enum_specifier) +) @type @_.domain + ;;!! enum Foo {} (enumerator_list "{" @name.iteration.start.endOf @value.iteration.start.endOf @@ -219,7 +228,7 @@ (_ type: (_) @type ) @_.domain - (#not-type? @_.domain type_definition type_descriptor cast_expression) + (#not-type? @_.domain type_definition type_descriptor cast_expression alias_declaration) ) ;;!! (int)5.5; diff --git a/queries/cpp.scm b/queries/cpp.scm index 4f94c316e0..6d4d925cad 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -44,6 +44,14 @@ name: (_) @name ) @_.domain +;;!! using Foo = Bar; +;;! ^^^ +;;! ^^^ +(alias_declaration + name: (_) @name @value.leading.endOf + type: (_) @value @name.removal.end.startOf +) @type @_.domain @name.removal.start.startOf + (field_declaration_list "{" @namedFunction.iteration.start.endOf "}" @namedFunction.iteration.end.startOf From 25f86d9b7cd2f1cb12e8b1532f4b7255f98c751f Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 17:49:16 +0100 Subject: [PATCH 10/12] csharp type alias --- .../scopes/csharp/name/name.typeAlias.scope | 24 +++++++++++++++++++ .../csharp/statement/statement.resource.scope | 10 ++++++++ .../statement/statement.typeAlias.scope | 10 ++++++++ .../scopes/csharp/type/type.alias.scope | 10 ++++++++ .../scopes/csharp/value/value.typeAlias.scope | 20 ++++++++++++++++ .../common/src/scopeSupportFacets/csharp.ts | 10 ++++---- queries/csharp.scm | 10 ++++++++ 7 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 data/fixtures/scopes/csharp/name/name.typeAlias.scope create mode 100644 data/fixtures/scopes/csharp/statement/statement.resource.scope create mode 100644 data/fixtures/scopes/csharp/statement/statement.typeAlias.scope create mode 100644 data/fixtures/scopes/csharp/type/type.alias.scope create mode 100644 data/fixtures/scopes/csharp/value/value.typeAlias.scope diff --git a/data/fixtures/scopes/csharp/name/name.typeAlias.scope b/data/fixtures/scopes/csharp/name/name.typeAlias.scope new file mode 100644 index 0000000000..d324dfec1d --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.typeAlias.scope @@ -0,0 +1,24 @@ +using Foo = Bar; +--- + +[Content] = 0:6-0:9 + >---< +0| using Foo = Bar; + +[Removal] = 0:0-0:12 + >------------< +0| using Foo = Bar; + +[Leading delimiter] = 0:5-0:6 + >-< +0| using Foo = Bar; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| using Foo = Bar; + +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/statement/statement.resource.scope b/data/fixtures/scopes/csharp/statement/statement.resource.scope new file mode 100644 index 0000000000..0a27b87971 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.resource.scope @@ -0,0 +1,10 @@ +using (var foo = create()) {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:29 + >-----------------------------< +0| using (var foo = create()) {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement/statement.typeAlias.scope b/data/fixtures/scopes/csharp/statement/statement.typeAlias.scope new file mode 100644 index 0000000000..1c156e1382 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement/statement.typeAlias.scope @@ -0,0 +1,10 @@ +using Foo = Bar; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/type/type.alias.scope b/data/fixtures/scopes/csharp/type/type.alias.scope new file mode 100644 index 0000000000..6c60c38ea2 --- /dev/null +++ b/data/fixtures/scopes/csharp/type/type.alias.scope @@ -0,0 +1,10 @@ +using Foo = Bar; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value/value.typeAlias.scope b/data/fixtures/scopes/csharp/value/value.typeAlias.scope new file mode 100644 index 0000000000..0ab94bc4ae --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.typeAlias.scope @@ -0,0 +1,20 @@ +using Foo = Bar; +--- + +[Content] = 0:12-0:15 + >---< +0| using Foo = Bar; + +[Removal] = 0:9-0:15 + >------< +0| using Foo = Bar; + +[Leading delimiter] = 0:9-0:12 + >---< +0| using Foo = Bar; + +[Domain] = 0:0-0:16 + >----------------< +0| using Foo = Bar; + +[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index f935f7168c..0e37f3f3ed 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -65,6 +65,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.actual": supported, "name.argument.actual.iteration": supported, "name.namespace": supported, + "name.resource": supported, "name.class": supported, "name.interface": supported, "name.enum": supported, @@ -112,6 +113,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": supported, "value.yield": supported, "value.throw": supported, + "value.resource": supported, "value.switch": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -135,6 +137,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.foreach": supported, "type.field.class": supported, "type.field.interface": supported, + "type.resource": supported, "type.return": supported, "type.return.method": supported, "type.constant": supported, @@ -260,6 +263,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "interior.switch": supported, "interior.switchCase": supported, "interior.try": supported, + "interior.resource": supported, "collectionItem.unenclosed.singleLine": supported, "collectionItem.unenclosed.multiLine": supported, @@ -281,12 +285,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "key.attribute": notApplicable, "value.attribute": notApplicable, - // Resource syntax - "interior.resource": notApplicable, - "type.resource": notApplicable, - "name.resource": notApplicable, - "value.resource": notApplicable, - // Pattern destructuring "statement.variable.destructuring": notApplicable, "statement.assignment.destructuring": notApplicable, diff --git a/queries/csharp.scm b/queries/csharp.scm index 67a2a72552..e6f60118ee 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -502,6 +502,16 @@ ")" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf ) +;;!! using Foo = Bar; +;;! ^^^ +;;! ^^^ +(using_directive + (name_equals + (_) @name @value.leading.endOf + ) + (_) @value @name.removal.end.startOf +) @type @_.domain @name.removal.start.startOf + ;;!! int foo, bar; ;;! ^^^ ^^^ ( From 3e6044293b903981752872fd16a52753319b6848 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 20:35:26 +0100 Subject: [PATCH 11/12] csharp --- .../csharp/interior/interior.resource.scope | 10 ++++ .../name/name.argument.actual.iteration.scope | 13 +++++ .../csharp/name/name.argument.actual.scope | 39 +++++++++++++ .../scopes/csharp/name/name.resource.scope | 24 ++++++++ .../csharp/statement/statement.resource.scope | 4 +- .../scopes/csharp/type/type.resource.scope | 20 +++++++ .../value.argument.actual.iteration.scope | 13 +++++ .../csharp/value/value.argument.actual.scope | 39 +++++++++++++ .../scopes/csharp/value/value.resource.scope | 20 +++++++ queries/csharp.scm | 58 +++++++++++++++---- 10 files changed, 228 insertions(+), 12 deletions(-) create mode 100644 data/fixtures/scopes/csharp/interior/interior.resource.scope create mode 100644 data/fixtures/scopes/csharp/name/name.argument.actual.iteration.scope create mode 100644 data/fixtures/scopes/csharp/name/name.argument.actual.scope create mode 100644 data/fixtures/scopes/csharp/name/name.resource.scope create mode 100644 data/fixtures/scopes/csharp/type/type.resource.scope create mode 100644 data/fixtures/scopes/csharp/value/value.argument.actual.iteration.scope create mode 100644 data/fixtures/scopes/csharp/value/value.argument.actual.scope create mode 100644 data/fixtures/scopes/csharp/value/value.resource.scope diff --git a/data/fixtures/scopes/csharp/interior/interior.resource.scope b/data/fixtures/scopes/csharp/interior/interior.resource.scope new file mode 100644 index 0000000000..073fa38139 --- /dev/null +++ b/data/fixtures/scopes/csharp/interior/interior.resource.scope @@ -0,0 +1,10 @@ +using (Foo foo = create()) { } +--- + +[Content] = +[Removal] = +[Domain] = 0:28-0:29 + >-< +0| using (Foo foo = create()) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.argument.actual.iteration.scope b/data/fixtures/scopes/csharp/name/name.argument.actual.iteration.scope new file mode 100644 index 0000000000..8f9729aaf4 --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.argument.actual.iteration.scope @@ -0,0 +1,13 @@ +foo(aaa: 0, bbb: 1); +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:20 + >--------------------< +0| foo(aaa: 0, bbb: 1); + + +[#2 Content] = +[#2 Domain] = 0:4-0:18 + >--------------< +0| foo(aaa: 0, bbb: 1); diff --git a/data/fixtures/scopes/csharp/name/name.argument.actual.scope b/data/fixtures/scopes/csharp/name/name.argument.actual.scope new file mode 100644 index 0000000000..ac09ba8602 --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.argument.actual.scope @@ -0,0 +1,39 @@ +foo(aaa: 0, bbb: 1); +--- + +[#1 Content] = 0:4-0:7 + >---< +0| foo(aaa: 0, bbb: 1); + +[#1 Removal] = 0:4-0:9 + >-----< +0| foo(aaa: 0, bbb: 1); + +[#1 Trailing delimiter] = 0:7-0:9 + >--< +0| foo(aaa: 0, bbb: 1); + +[#1 Domain] = 0:4-0:10 + >------< +0| foo(aaa: 0, bbb: 1); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:12-0:15 + >---< +0| foo(aaa: 0, bbb: 1); + +[#2 Removal] = 0:12-0:17 + >-----< +0| foo(aaa: 0, bbb: 1); + +[#2 Trailing delimiter] = 0:15-0:17 + >--< +0| foo(aaa: 0, bbb: 1); + +[#2 Domain] = 0:12-0:18 + >------< +0| foo(aaa: 0, bbb: 1); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name/name.resource.scope b/data/fixtures/scopes/csharp/name/name.resource.scope new file mode 100644 index 0000000000..ef3090c5a6 --- /dev/null +++ b/data/fixtures/scopes/csharp/name/name.resource.scope @@ -0,0 +1,24 @@ +using (Foo foo = create()) {} +--- + +[Content] = 0:11-0:14 + >---< +0| using (Foo foo = create()) {} + +[Removal] = 0:11-0:15 + >----< +0| using (Foo foo = create()) {} + +[Leading delimiter] = 0:10-0:11 + >-< +0| using (Foo foo = create()) {} + +[Trailing delimiter] = 0:14-0:15 + >-< +0| using (Foo foo = create()) {} + +[Domain] = 0:0-0:29 + >-----------------------------< +0| using (Foo foo = create()) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/statement/statement.resource.scope b/data/fixtures/scopes/csharp/statement/statement.resource.scope index 0a27b87971..80586b0635 100644 --- a/data/fixtures/scopes/csharp/statement/statement.resource.scope +++ b/data/fixtures/scopes/csharp/statement/statement.resource.scope @@ -1,10 +1,10 @@ -using (var foo = create()) {} +using (Foo foo = create()) {} --- [Content] = [Removal] = [Domain] = 0:0-0:29 >-----------------------------< -0| using (var foo = create()) {} +0| using (Foo foo = create()) {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/type/type.resource.scope b/data/fixtures/scopes/csharp/type/type.resource.scope new file mode 100644 index 0000000000..384029a36b --- /dev/null +++ b/data/fixtures/scopes/csharp/type/type.resource.scope @@ -0,0 +1,20 @@ +using (Foo foo = bar()) {} +--- + +[Content] = 0:7-0:10 + >---< +0| using (Foo foo = bar()) {} + +[Removal] = 0:7-0:11 + >----< +0| using (Foo foo = bar()) {} + +[Trailing delimiter] = 0:10-0:11 + >-< +0| using (Foo foo = bar()) {} + +[Domain] = 0:0-0:26 + >--------------------------< +0| using (Foo foo = bar()) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value/value.argument.actual.iteration.scope b/data/fixtures/scopes/csharp/value/value.argument.actual.iteration.scope new file mode 100644 index 0000000000..8f9729aaf4 --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.argument.actual.iteration.scope @@ -0,0 +1,13 @@ +foo(aaa: 0, bbb: 1); +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:20 + >--------------------< +0| foo(aaa: 0, bbb: 1); + + +[#2 Content] = +[#2 Domain] = 0:4-0:18 + >--------------< +0| foo(aaa: 0, bbb: 1); diff --git a/data/fixtures/scopes/csharp/value/value.argument.actual.scope b/data/fixtures/scopes/csharp/value/value.argument.actual.scope new file mode 100644 index 0000000000..5405467344 --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.argument.actual.scope @@ -0,0 +1,39 @@ +foo(aaa: 0, bbb: 1); +--- + +[#1 Content] = 0:9-0:10 + >-< +0| foo(aaa: 0, bbb: 1); + +[#1 Removal] = 0:7-0:10 + >---< +0| foo(aaa: 0, bbb: 1); + +[#1 Leading delimiter] = 0:7-0:9 + >--< +0| foo(aaa: 0, bbb: 1); + +[#1 Domain] = 0:4-0:10 + >------< +0| foo(aaa: 0, bbb: 1); + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:17-0:18 + >-< +0| foo(aaa: 0, bbb: 1); + +[#2 Removal] = 0:15-0:18 + >---< +0| foo(aaa: 0, bbb: 1); + +[#2 Leading delimiter] = 0:15-0:17 + >--< +0| foo(aaa: 0, bbb: 1); + +[#2 Domain] = 0:12-0:18 + >------< +0| foo(aaa: 0, bbb: 1); + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value/value.resource.scope b/data/fixtures/scopes/csharp/value/value.resource.scope new file mode 100644 index 0000000000..0dff3b615b --- /dev/null +++ b/data/fixtures/scopes/csharp/value/value.resource.scope @@ -0,0 +1,20 @@ +using (Foo foo = create()) {} +--- + +[Content] = 0:17-0:25 + >--------< +0| using (Foo foo = create()) {} + +[Removal] = 0:14-0:25 + >-----------< +0| using (Foo foo = create()) {} + +[Leading delimiter] = 0:14-0:17 + >---< +0| using (Foo foo = create()) {} + +[Domain] = 0:0-0:29 + >-----------------------------< +0| using (Foo foo = create()) {} + +[Insertion delimiter] = " " diff --git a/queries/csharp.scm b/queries/csharp.scm index e6f60118ee..72accbb6fe 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -44,8 +44,10 @@ (using_statement) (while_statement) (yield_statement) + ;; Disabled on purpose. This is the entire body of statements. ;; (block) + ;; Disabled on purpose. We have a better definition of this below. ;; (if_statement) ] @statement @@ -353,17 +355,20 @@ ;;! ^^^^^^ ;;! ^^^ ;;! ^ -(_ - (variable_declaration - type: (_) @type - (variable_declarator - (identifier) @name @value.leading.endOf @name.removal.end.endOf - (equals_value_clause - (_) @value @name.removal.end.startOf - )? +( + (_ + (variable_declaration + type: (_) @type + (variable_declarator + (identifier) @name @value.leading.endOf @name.removal.end.endOf + (equals_value_clause + (_) @value @name.removal.end.startOf + )? + ) ) - ) -) @_.domain @name.removal.start.startOf + ) @_.domain @name.removal.start.startOf + (#not-type? @_.domain using_statement) +) ;;!! aaa = "bbb"; ;;! ^^^ @@ -472,6 +477,23 @@ (#child-range! @argumentList 1 -2) ) @argumentList.domain @argumentOrParameter.iteration.domain +;;!! foo(aaa: 0, bbb: 1); +;;! ^^^^^^^^^^^^^^ +(argument_list + "(" @name.iteration.start.endOf @value.iteration.start.endOf + ")" @name.iteration.end.startOf @value.iteration.end.startOf +) + +;;!! foo(aaa: 0, bbb: 1); +;;! ^^^ ^^^ +;;! ^ ^ +(argument + (name_colon + (_) @name @value.leading.endOf + ) + (_) @value @name.trailing.startOf +) @_.domain + ;; !! void foo(int a, int b) ;; ! ^^^^^ ^^^^^ ( @@ -512,6 +534,22 @@ (_) @value @name.removal.end.startOf ) @type @_.domain @name.removal.start.startOf +;;!! using (Foo foo = create()) {} +;;! ^^^ +;;! ^^^ +;;! ^^^^^^^^ +(using_statement + (variable_declaration + type: (_) @type + (variable_declarator + (identifier) @name @value.leading.endOf + (equals_value_clause + (_) @value + ) + ) + ) +) @_.domain + ;;!! int foo, bar; ;;! ^^^ ^^^ ( From 9e1ee189608a912352631d9b4226a045ecd6b6d8 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 28 Feb 2026 20:39:10 +0100 Subject: [PATCH 12/12] trim trailing --- queries/csharp.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/csharp.scm b/queries/csharp.scm index 72accbb6fe..edcadfe7da 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -535,7 +535,7 @@ ) @type @_.domain @name.removal.start.startOf ;;!! using (Foo foo = create()) {} -;;! ^^^ +;;! ^^^ ;;! ^^^ ;;! ^^^^^^^^ (using_statement