diff --git a/data/fixtures/scopes/cpp/namedFunction.method.iteration.class.scope b/data/fixtures/scopes/cpp/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/cpp/namedFunction.method.iteration.class.scope rename to data/fixtures/scopes/cpp/namedFunction.iteration.class.scope diff --git a/data/fixtures/scopes/csharp/namedFunction/namedFunction.method.iteration.class.scope b/data/fixtures/scopes/csharp/namedFunction/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/csharp/namedFunction/namedFunction.method.iteration.class.scope rename to data/fixtures/scopes/csharp/namedFunction/namedFunction.iteration.class.scope diff --git a/data/fixtures/scopes/java/namedFunction.method.iteration.class.scope b/data/fixtures/scopes/java/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/java/namedFunction.method.iteration.class.scope rename to data/fixtures/scopes/java/namedFunction.iteration.class.scope diff --git a/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method.iteration.class.scope b/data/fixtures/scopes/javascript.core/namedFunction/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/javascript.core/namedFunction/namedFunction.method.iteration.class.scope rename to data/fixtures/scopes/javascript.core/namedFunction/namedFunction.iteration.class.scope diff --git a/data/fixtures/scopes/python/namedFunction/namedFunction.method.iteration.class.scope b/data/fixtures/scopes/python/namedFunction/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/python/namedFunction/namedFunction.method.iteration.class.scope rename to data/fixtures/scopes/python/namedFunction/namedFunction.iteration.class.scope diff --git a/data/fixtures/scopes/scss/namedFunction.iteration.block.scope b/data/fixtures/scopes/scss/namedFunction.iteration.class.scope similarity index 100% rename from data/fixtures/scopes/scss/namedFunction.iteration.block.scope rename to data/fixtures/scopes/scss/namedFunction.iteration.class.scope diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 723b58d72f..6ac53724b6 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -241,10 +241,9 @@ - `namedFunction` A named function declaration - `namedFunction.constructor` A constructor declaration in a class -- `namedFunction.iteration.block` Iteration scope for named functions: statement blocks (body of functions/if-statements/for-loops/etc). +- `namedFunction.iteration.class` Iteration scope for named functions: class bodies. - `namedFunction.iteration.document` Iteration scope for named functions: the entire document including leading and trailing empty lines. - `namedFunction.method` A named method declaration in a class -- `namedFunction.method.iteration.class` Iteration scope for named functions: class bodies. ### nonWhitespaceSequence diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 6202600682..5e7cd84952 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -186,9 +186,6 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Nested class "class.iteration.block": notApplicable, - // Nested function - "namedFunction.iteration.block": notApplicable, - // Try catch "branch.try": notApplicable, "branch.try.iteration": notApplicable, @@ -279,7 +276,7 @@ export const cScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.argument.formal.method": notApplicable, "name.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, "namedFunction.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.argument.formal.method": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 7dfb88c4fa..a1855015f8 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -43,7 +43,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "functionCallee.constructor": supported, "namedFunction.method": supported, - "namedFunction.method.iteration.class": supported, + "namedFunction.iteration.class": supported, "namedFunction.constructor": supported, "name.argument.formal.method": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 1688599a98..22fac31308 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -26,7 +26,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.document": supported, "namedFunction.constructor": supported, "namedFunction.method": supported, - "namedFunction.method.iteration.class": supported, + "namedFunction.iteration.class": supported, "branch.if": supported, "branch.if.elif.else": supported, @@ -225,9 +225,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, - // Functions in blocks - "namedFunction.iteration.block": notApplicable, - // Resource syntax "interior.resource": notApplicable, "type.resource": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 6f13b75d19..f2be42cfbf 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -58,7 +58,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -199,7 +199,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, "name.variable": notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, namedFunction: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index dd53a33879..284c0e1903 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -36,7 +36,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -178,7 +178,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.variable": notApplicable, "name.namespace": notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, "section.iteration.document": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index c9cb5bb22e..d2e6e53cf4 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -83,7 +83,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.constructor": supported, "namedFunction.method": supported, - "namedFunction.method.iteration.class": supported, + "namedFunction.iteration.class": supported, ifStatement: supported, statement: supported, @@ -190,7 +190,6 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { // Functions (not methods) namedFunction: notApplicable, "namedFunction.iteration.document": notApplicable, - "namedFunction.iteration.block": notApplicable, "argument.formal.singleLine": notApplicable, "argument.formal.multiLine": notApplicable, "argument.formal.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index ac75aca1aa..e1cd225675 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -36,7 +36,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { namedFunction: supported, "namedFunction.iteration.document": supported, "namedFunction.method": supported, - "namedFunction.method.iteration.class": supported, + "namedFunction.iteration.class": supported, "namedFunction.constructor": supported, functionCall: supported, @@ -180,9 +180,6 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { // Nested classes "class.iteration.block": notApplicable, - // Nested functions. Technically supported, but creates problem with `every funk` in a method. - "namedFunction.iteration.block": notApplicable, - // Section section: notApplicable, "section.iteration.document": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 87b3da8d03..89c9aa4410 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -39,7 +39,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -191,7 +191,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, namedFunction: notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, notebookCell: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 55519b0950..8a93ba90d4 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -35,7 +35,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -189,7 +189,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, namedFunction: notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, pairDelimiter: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index 67463d6e23..c72614305c 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -76,7 +76,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.constructor": supported, "namedFunction.iteration.document": supported, "namedFunction.method": supported, - "namedFunction.method.iteration.class": supported, + "namedFunction.iteration.class": supported, "argument.actual.singleLine": supported, "argument.actual.multiLine": supported, @@ -228,9 +228,6 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { // Nested classes "class.iteration.block": notApplicable, - // Nested functions. Technically supported, but creates problem with `every funk` in a method. - "namedFunction.iteration.block": notApplicable, - // Type. Python have some types, but not these. "type.alias": notApplicable, "type.cast": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 3c44f539c2..42a7ac3492 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -41,7 +41,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -189,7 +189,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, namedFunction: notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, notebookCell: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index b732cec19a..f1504fdd65 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -114,19 +114,15 @@ export const scopeSupportFacetInfos: Record< description: "A named method declaration in a class", scopeType: "namedFunction", }, - "namedFunction.method.iteration.class": classIter( - "namedFunction", - "named functions", - ), "namedFunction.constructor": { description: "A constructor declaration in a class", scopeType: "namedFunction", }, - "namedFunction.iteration.block": blockIter( + "namedFunction.iteration.document": documentIter( "namedFunction", "named functions", ), - "namedFunction.iteration.document": documentIter( + "namedFunction.iteration.class": classIter( "namedFunction", "named functions", ), diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index b32070d15c..5677a8aa86 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -44,11 +44,10 @@ export const scopeSupportFacets = [ "anonymousFunction", "namedFunction", - "namedFunction.iteration.block", - "namedFunction.iteration.document", - "namedFunction.method", - "namedFunction.method.iteration.class", "namedFunction.constructor", + "namedFunction.method", + "namedFunction.iteration.document", + "namedFunction.iteration.class", "functionCall", "functionCall.constructor", diff --git a/packages/common/src/scopeSupportFacets/scss.ts b/packages/common/src/scopeSupportFacets/scss.ts index faa28f5e15..fa3f161bb7 100644 --- a/packages/common/src/scopeSupportFacets/scss.ts +++ b/packages/common/src/scopeSupportFacets/scss.ts @@ -10,7 +10,7 @@ export const scssScopeSupport: LanguageScopeSupportFacetMap = { "comment.line": supported, namedFunction: supported, - "namedFunction.iteration.block": supported, + "namedFunction.iteration.class": supported, "namedFunction.iteration.document": supported, "name.argument.formal": supported, diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 18ccd765f7..c3e2247715 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -66,7 +66,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -204,7 +204,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, namedFunction: notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, notebookCell: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index b4ba7bf93e..243ff64733 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -36,7 +36,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -188,7 +188,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, namedFunction: notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, notebookCell: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 9be1ff4f9c..e24208433e 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -45,7 +45,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.field.class": notApplicable, "value.iteration.class": notApplicable, "interior.class": notApplicable, - "namedFunction.method.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, // Interface "statement.interface": notApplicable, @@ -195,7 +195,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.variable.pattern": notApplicable, namedFunction: notApplicable, "namedFunction.constructor": notApplicable, - "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, notebookCell: notApplicable, diff --git a/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md b/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md index 94e019630e..9f5c6755ef 100644 --- a/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md +++ b/packages/cursorless-org-docs/src/docs/contributing/adding-a-new-scope.md @@ -34,9 +34,8 @@ For example, if you'd like to add support for the `namedFunction` facet of the ` ```ts namedFunction: supported, "namedFunction.method": supported, - "namedFunction.method.iteration.class": supported, + "namedFunction.iteration.class": supported, "namedFunction.constructor": supported, - "namedFunction.iteration.block": supported, "namedFunction.iteration.document": supported, ```